[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql 8a66563af6 105/427: Combine :insert and :into.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql 8a66563af6 105/427: Combine :insert and :into. |
Date: |
Tue, 13 Dec 2022 02:59:32 -0500 (EST) |
branch: elpa/emacsql
commit 8a66563af6e6aae8077001aa41712289cc7b4fef
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Combine :insert and :into.
SQLite has no other use of :into, so no reason to keep it around.
---
README.md | 16 ++++------------
emacsql-tests.el | 4 ++--
emacsql.el | 13 +++++--------
3 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/README.md b/README.md
index ef41cdfef4..dfbf1a6438 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ shouldn't impact normal use of the database.
(emacsql db [:create-table people [name (id integer :unique) (salary float)]])
;; Insert some data:
-(emacsql db [:insert :into people
+(emacsql db [:insert-into people
:values (["Jeff" 1000 60000.0] ["Susan" 1001 64000.0])])
;; Query the database for results:
@@ -143,12 +143,12 @@ Provides `FROM`.
[... :from employees]
```
-#### :into `<table>`
+#### :insert-into `<table>`
-Provides `INTO`.
+Provides `INSERT INTO`.
```el
-[... :into employees]
+[:insert-into employees ...]
```
#### :delete
@@ -159,14 +159,6 @@ Provides `DELETE`.
[:delete :from employees :where ...]
```
-#### :insert
-
-Provides `INSERT`.
-
-```el
-[:insert :into employees ...]
-```
-
#### :replace
Provides `REPLACE`.
diff --git a/emacsql-tests.el b/emacsql-tests.el
index 19299426a7..8773cf9d29 100644
--- a/emacsql-tests.el
+++ b/emacsql-tests.el
@@ -69,14 +69,14 @@
"UPDATE people SET id = 10;")
(emacsql-tests-query [:select * :from people :where (in name $1)] '([FOO
BAR])
"SELECT * FROM people WHERE name IN ('FOO', 'BAR');")
- (emacsql-tests-query [:insert :into foo :values [nil $1]] '(10.1)
+ (emacsql-tests-query [:insert-into foo :values [nil $1]] '(10.1)
"INSERT INTO foo VALUES (NULL, 10.1);"))
(ert-deftest emacsql-system ()
(emacsql-with-connection (db nil)
(emacsql db [:create-table foo [x]])
(should-error (emacsql db [:create-table foo [x]]))
- (emacsql db [:insert :into foo :values ([1] [2] [3])])
+ (emacsql db [:insert-into foo :values ([1] [2] [3])])
(should (equal (emacsql db [:select * :from foo])
'((1) (2) (3))))))
diff --git a/emacsql.el b/emacsql.el
index 43fb473aba..1f5f8518f6 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -36,7 +36,7 @@
;; Insert values into a table with `emacsql-insert'.
-;; (emacsql db [:insert :into people
+;; (emacsql db [:insert-into people
;; :values (["Jeff" 1000 60000.0] ["Susan" 1001 64000.0])])
;; Currently all actions are synchronous and Emacs will block until
@@ -135,7 +135,7 @@ CONN-SPEC is a connection specification like the call to
(emacsql-with-connection (db \"company.db\")
(emacsql db [:create-table foo [x]])
- (emacsql db [:insert :into foo :values ([1] [2] [3])])
+ (emacsql db [:insert-into foo :values ([1] [2] [3])])
(emacsql db [:select * :from foo]))"
(declare (indent 1))
`(let ((,(car conn-spec) (emacsql-connect ,@(cdr conn-spec))))
@@ -484,9 +484,9 @@ definitions for return from a `emacsql-defexpander'."
(emacsql-with-vars "FROM "
(var table :identifier)))
-(emacsql-defexpander :into (table)
- "Expands to the INTO keyword."
- (emacsql-with-vars "INTO "
+(emacsql-defexpander :insert-into (table)
+ "Expands to the INSERT INTO keywords."
+ (emacsql-with-vars "INSERT INTO "
(var table :identifier)))
(emacsql-defexpander :where (expr)
@@ -505,9 +505,6 @@ definitions for return from a `emacsql-defexpander'."
(emacsql-defexpander :delete ()
(list "DELETE"))
-(emacsql-defexpander :insert ()
- (list "INSERT"))
-
(emacsql-defexpander :replace ()
(list "REPLACE"))
- [nongnu] elpa/emacsql 02acd07072 328/427: Ensure executable variable is defined at compile time., (continued)
- [nongnu] elpa/emacsql 02acd07072 328/427: Ensure executable variable is defined at compile time., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 2ffcc95c67 338/427: Fix a typo in the doc-string of emacsql-with-params., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 74bd11bc09 334/427: Fix up package description headers., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5df2891557 349/427: Use cl-generic package, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e8c090e11f 353/427: Improve Makefile portability and dump Cask, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 0ba12b89d5 084/427: Drop "work in progress.", ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 364bf466ea 086/427: Linkify the issue in the README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql dd3f153406 089/427: Drop old with-errors macro., ELPA Syncer, 2022/12/13
- [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 <=
- [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, 2022/12/13
- [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