[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql 54c180017e 138/427: Add :pragma and note in README
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql 54c180017e 138/427: Add :pragma and note in README. |
Date: |
Tue, 13 Dec 2022 02:59:36 -0500 (EST) |
branch: elpa/emacsql
commit 54c180017e21a8e441480c915c8b44fd997b254a
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Add :pragma and note in README.
---
README.md | 17 +++++++++++++++--
emacsql.el | 4 ++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index e58c86ce2b..8c554d7a9b 100644
--- a/README.md
+++ b/README.md
@@ -93,8 +93,13 @@ the details on what each of these means.
:foreign (subjectid subject id :on-delete :cascade))
```
-Put the keys in a vector if the reference is composite, but remember
-that the cardinality must match.
+Put the keys in a vector if the reference is composite. Also remember
+that foreign key checks are currently disabled by default in SQLite,
+so you'll need to enable it for each connection.
+
+```el
+(emacsql db [:pragma (= foreign_keys on)])
+```
## Operators
@@ -271,6 +276,14 @@ Provides `UNION`, `UNION ALL`, `DIFFERENCE`, and `EXCEPT`.
[:select * :from sales :union :select * :from accounting]
```
+#### :pragma `<expr>`
+
+Provides `PRAGMA`.
+
+```el
+(emacsql db [:pragma (= foreign_keys on)])
+```
+
### Templates
To make statement compilation faster, and to avoid making you build up
diff --git a/emacsql.el b/emacsql.el
index 6e44c2a2bd..158a23e439 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -678,6 +678,10 @@ definitions for return from a `emacsql-defexpander'."
(emacsql-defexpander :except ()
(list "EXCEPT"))
+(emacsql-defexpander :pragma (expr)
+ (emacsql-with-vars "PRAGMA "
+ (expr expr)))
+
(provide 'emacsql)
;;; emacsql.el ends here
- [nongnu] elpa/emacsql 72c1954517 096/427: Block on connection until the output has flushed., (continued)
- [nongnu] elpa/emacsql 72c1954517 096/427: Block on connection until the output has flushed., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1e9857ccc4 103/427: Allow variables inside vectors., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8a66563af6 105/427: Combine :insert and :into., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d04ef64ce0 109/427: Add IF NOT EXISTS and TEMPORARY to CREATE TABLE., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 58641b9827 115/427: Fill out keywords in README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fc941d7c75 118/427: Capture a common identifier vector pattern., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a09911a205 125/427: Add LIMIT and OFFSET expanders., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8945af0dd8 129/427: Add :check and allow schemas to have variables., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4206b17f39 134/427: Add support for AS with CREATE TABLE., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6c32f02139 137/427: Add emacsql-thread macro., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 54c180017e 138/427: Add :pragma and note in README.,
ELPA Syncer <=
- [nongnu] elpa/emacsql 5e2ab842f7 139/427: Add foreign key test., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 42c2fd7569 145/427: Tweak limitation wording., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fe0c7004fc 146/427: Add :begin, :commit, and :rollback., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 2550196816 162/427: Drop SQLite version requirements., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9a1b4209ba 164/427: Add PostgreSQL front-end., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5f4c2ed5a7 166/427: Add emacsql-psql-unavailable-p., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1d0ef4011c 167/427: Make emacsql-connection abstract., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 64c3a03d62 169/427: Flesh out some more README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9f6c10eca0 172/427: Move error checking out to helper mix-in., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4f76b94f7c 168/427: Set psql to print nil for NULL., ELPA Syncer, 2022/12/13