Make it all work

This commit is contained in:
Vincent Riquer 2025-11-11 04:56:34 +01:00
parent eb45983613
commit 4e052a33d4
16 changed files with 49 additions and 45 deletions

View File

@ -7,6 +7,7 @@
* Don't print useless information (stuff that handled 0 files and such)
* Store transcoded file paths relative to their destination's root
* Add missing error codes (used but not declared)
* Support for newline character in filenames
# 1.0.4
## `BREAKING CHANGES`

View File

@ -26,7 +26,7 @@ Select() {
"WHERE ${where_statement[@]})" \
",'SQL::Select:not found'" \
");" >&3
read -u 4 -d$'\0' results
read -u 4 -r -d $'\0' results
if ! [[ $results == "SQL::Select:not found" ]]
then
echo "$results"

View File

@ -3,9 +3,12 @@ openDatabase() {
[[ -f "$database" ]] || populate_db=1
rm -f "$tempdir"/sqlite.{in,out}
mkfifo "$tempdir"/sqlite.{in,out}
sqlite3 -bail -newline $'\0' \
stdbuf -o0 sqlite3 -bail \
-newline $'::AtOM:SQL:EOL::\n' \
"$database" \
< "$tempdir/sqlite.in" \
| stdbuf -o0 \
sed 's/::AtOM:SQL:EOL::/\x0/g;s/\(\x0\)\xA/\1/g' \
> "$tempdir/sqlite.out" &
exec 3> "$tempdir"/sqlite.in
exec 4< "$tempdir"/sqlite.out
@ -21,7 +24,7 @@ openDatabase() {
echo 'PRAGMA recursive_triggers = ON;' >&3
echo 'PRAGMA temp_store = 2;' >&3
echo 'PRAGMA locking_mode = EXCLUSIVE;' >&3
read -u4 -d $'\0'
read -u4 -r -d $'\0'
unset REPLY
checkDatabaseVersion
}