This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/lua | |
-- Usage: mysql2sqlite.lua [data base name] | |
-- $ ./mysql2sqlite.lua my_database | |
-- $ ./mysql2sqlite.lua "my_database my_table" | |
-- $ ./mysql2sqlite | |
-- Set here the path to the temp file you want mysqldump to dump the database into | |
local mysqldump_file = '/tmp/lua.sql' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2015 esperlu | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DRYRUN=yes | |
if [ "$1" = "-p" ]; then | |
DRYRUN=no | |
fi | |
DBFILE=~/.config/darktable/library.db | |
TMPFILE=$(mktemp -t tmp.XXXXXXXXXX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DRYRUN=yes | |
if [ "$1" = "-p" ]; then | |
DRYRUN=no | |
fi | |
DBFILE=~/.config/darktable/library.db | |
TMPFILE=$(mktemp -t tmp.XXXXXXXXXX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DRYRUN=yes | |
if [ "$1" = "-p" ]; then | |
DRYRUN=no | |
fi | |
DBFILE=~/.config/darktable/library.db | |
TMPFILE=$(mktemp -t tmp.XXXXXXXXXX) |