summaryrefslogtreecommitdiff
path: root/data/english.awk
diff options
context:
space:
mode:
authorDominique Leuenberger <dimstar@opensuse.org>2023-02-24 13:38:56 +0100
committerPeng Wu <alexepico@gmail.com>2023-02-27 10:33:15 +0800
commit96042887815b4700c7cafa64cf88942af438ea98 (patch)
treed9224860bcaebc1d1689d996421f9a3b2928e219 /data/english.awk
parent80bab3368b692acc25957e2649568fda640c4356 (diff)
downloadibus-libpinyin-96042887815b4700c7cafa64cf88942af438ea98.tar.gz
build: fix awk scripts to work properly when used againts sqlite 3.41.0
The SQL standard requires double-quotes around identifiers and single-quotes around string literals. For example: "this is a legal SQL column name" 'this is an SQL string literal' With sqlite 3.41.0, this is being enforced on the CLI
Diffstat (limited to 'data/english.awk')
-rw-r--r--data/english.awk8
1 files changed, 4 insertions, 4 deletions
diff --git a/data/english.awk b/data/english.awk
index c5dc0aa..8b32f3f 100644
--- a/data/english.awk
+++ b/data/english.awk
@@ -5,9 +5,9 @@ BEGIN {
print "BEGIN TRANSACTION;"
# Create english table
- print "CREATE TABLE IF NOT EXISTS \"english\" ( " \
- "\"word\" TEXT NOT NULL PRIMARY KEY," \
- "\"freq\" FLOAT NOT NULL DEFAULT(0)" \
+ print "CREATE TABLE IF NOT EXISTS 'english' ( " \
+ "'word' TEXT NOT NULL PRIMARY KEY," \
+ "'freq' FLOAT NOT NULL DEFAULT(0)" \
");";
# Create desc table
@@ -16,7 +16,7 @@ BEGIN {
}
# Insert data into english table
- { printf "INSERT INTO english (word, freq) VALUES (\"%s\", %f);\n", $1, $2}
+ { printf "INSERT INTO english (word, freq) VALUES ('%s', %f);\n", $1, $2}
#quit sqlite3
END {