mirror of
https://github.com/phiresky/sql.js-httpvfs.git
synced 2024-11-12 14:12:36 +01:00
20 lines
547 B
Bash
Executable File
20 lines
547 B
Bash
Executable File
set -eu
|
|
|
|
indb="$1"
|
|
outdir="$2"
|
|
|
|
bytes="$(stat --printf="%s" "$indb")"
|
|
serverChunkSize=$((50 * 1024 * 1024))
|
|
suffixLength=3
|
|
rm -f "$outdir/db.sqlite3"*
|
|
split "$indb" --bytes=$serverChunkSize "$outdir/db.sqlite3." --suffix-length=$suffixLength --numeric-suffixes
|
|
requestChunkSize="$(sqlite3 "$indb" 'pragma page_size')"
|
|
echo '
|
|
{
|
|
"requestChunkSize": '$requestChunkSize',
|
|
"databaseLengthBytes": '$bytes',
|
|
"serverChunkSize": '$serverChunkSize',
|
|
"urlPrefix": "db.sqlite3.",
|
|
"suffixLength": '$suffixLength'
|
|
}
|
|
' > "$outdir/config.json" |