summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Thomsen <bruno.thomsen@gmail.com>2020-07-16 19:29:13 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-08-03 09:41:48 +0200
commitb550c0d4eea7aca5453d3ead7247557b0c96a014 (patch)
treea6862bce5911d532a8985601fc6bf99731d570f3
parent996421fe512c5ee65cfe2594e0764a0d03c9eb5e (diff)
downloadptxdist-b550c0d4eea7aca5453d3ead7247557b0c96a014.tar.gz
ptxdist-b550c0d4eea7aca5453d3ead7247557b0c96a014.tar.xz
sqlite: config: enable foreign keys by default
Support for foreign_keys pragma is already enabled at compile time. This allows turning on the feature by default on new database connections. Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com> Message-Id: <20200716172913.6053-1-bruno.thomsen@gmail.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/sqlite.in8
-rw-r--r--rules/sqlite.make1
2 files changed, 9 insertions, 0 deletions
diff --git a/rules/sqlite.in b/rules/sqlite.in
index 7b60edf3e..e6e01ba97 100644
--- a/rules/sqlite.in
+++ b/rules/sqlite.in
@@ -30,6 +30,14 @@ config SQLITE_READLINE
help
Enable readline support
+config SQLITE_FOREIGN_KEYS
+ bool
+ prompt "enable foreign keys by default"
+ help
+ Enable foreign keys support by default on database
+ connections. This ensures database schema constrains
+ are enforced by default e.g. consistency between tables.
+
comment "install options"
config SQLITE_TOOL
diff --git a/rules/sqlite.make b/rules/sqlite.make
index b23c2d377..67a66a371 100644
--- a/rules/sqlite.make
+++ b/rules/sqlite.make
@@ -45,6 +45,7 @@ SQLITE_CONF_ENV := \
-DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_ENABLE_FTS3_PARENTHESIS=1 \
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
+ -DSQLITE_DEFAULT_FOREIGN_KEYS=$(call ptx/ifdef, PTXCONF_SQLITE_FOREIGN_KEYS,1,0) \
-DSQLITE_SOUNDEX=1 \
"