remove: lmdb

add: sqlite
add: new commands
This commit is contained in:
Tobias Reisinger 2020-08-24 16:00:08 +02:00
parent a37bdc4870
commit 9602e6e937
33 changed files with 1403 additions and 752 deletions

33
compile_sql.sh Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env sh
to_header () {
if [ -f ./include/sql/$1.h ]
then
if [ -z $(find ./sql/$1.sql -newer ./include/sql/$1.h -print) ]
then
return
fi
fi
echo "Compiling $1"
xxd -i sql/$1.sql | sed 's/\([0-9a-f]\)$/\0, 0x00/' > ./include/sql/$1.h
}
cd "$(dirname "$0")";
migration_num=0;
while [ -f ./sql/migration_$migration_num.sql ]
do
if [ -f ./include/migrations/$migration_num.sql.h ]
then
if [ -z $(find ./sql/migration_$migration_num.sql -newer ./include/sql/migration_$migration_num.h -print) ]
then
migration_num=$((migration_num+1))
continue
fi
fi
to_header "migration_$migration_num"
migration_num=$((migration_num+1))
done
cd $PWD;