[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql e900f99091 075/427: Update examples.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql e900f99091 075/427: Update examples. |
Date: |
Tue, 13 Dec 2022 02:59:29 -0500 (EST) |
branch: elpa/emacsql
commit e900f990910e6447966e7ee91f27494b3ff204d9
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Update examples.
---
README.md | 13 +++++++++----
emacsql.el | 9 +++++----
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 560959af0f..d189cbbe10 100644
--- a/README.md
+++ b/README.md
@@ -27,15 +27,20 @@ Requires Emacs 24 or later.
(emacsql db [:create-table people [name (id integer :unique) (salary float)]])
;; Insert some data:
-(emacsql-insert db 'people ["Jeff" 1000 60000.0]
- ["Susan" 1001 64000.0])
+(emacsql db [:insert :into people
+ :values (["Jeff" 1000 60000.0] ["Susan" 1001 64000.0])])
;; Query the database for results:
-(emacsql db [:select [name id] :from people :where (> salary 62000)])
+(emacsql db [:select [name id]
+ :from people
+ :where (> salary 62000)])
;; => (("Susan" 1001))
;; Queries can be templates, using $1, $2, etc.:
-(emacsql db [:select [name id] :from people :where (> salary $1)] 50000)
+(emacsql db [:select [name id]
+ :from people
+ :where (> salary $1)]
+ 50000)
;; => (("Jeff" 1000) ("Susan" 1001))
```
diff --git a/emacsql.el b/emacsql.el
index 5dd6ba7fed..c0fa338734 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -28,16 +28,16 @@
;; Table identifiers can be any lisp object: string, symbol, etc. I
;; suggest using a symbol. Use `emacsql-create' to create a table.
-;; (emacsql-create db 'employees [name id salary])
+;; (emacsql db [:create-table people [name id salary]])
;; Column constraints can optionally be provided.
-;; (emacsql-create db 'employees [name (id integer) (salary real)])
+;; (emacsql db [:create-table people [name (id integer :unique) salary]])
;; Insert values into a table with `emacsql-insert'.
-;; (emacsql-insert db 'employees ["Jeff" 1000 60000.0]
-;; ["Susan" 1001 64000.0])
+;; (emacsql db [:insert :into people
+;; :values (["Jeff" 1000 60000.0] ["Susan" 1001 64000.0])])
;; Currently all actions are synchronous and Emacs will block until
;; SQLite has indicated it is finished processing the last command.
@@ -48,6 +48,7 @@
;; ;; => (("Susan" 1001))
;; Queries can be templates using $1, $2, etc.:
+
;; (emacsql db
;; [:select [name id] :from employees :where (> salary $1)]
;; 50000)
- [nongnu] elpa/emacsql 578a71d2d8 157/427: Re-order some definitions to group them., (continued)
- [nongnu] elpa/emacsql 578a71d2d8 157/427: Re-order some definitions to group them., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 935cca89a9 176/427: Add updated information about Windows., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b3aea1e6af 055/427: Oops, fix >= back., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c4396ec5e6 057/427: Fix a bunch of warnings., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e9fbc4a913 061/427: Fill out a Makefile., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 829298d5a7 063/427: Add dependency listing., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 231ec586ca 088/427: Drop forced process coding system., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql eba26bead6 102/427: Add emacsql-compile function for debugging., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d5cfaee783 158/427: Be more precise about error messages., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f512300aba 054/427: Fix a few things in emacsql-expr., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e900f99091 075/427: Update examples.,
ELPA Syncer <=
- [nongnu] elpa/emacsql 1116a0873e 163/427: Turn everything into generic functions., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 47d9476a02 142/427: Add tests for quote operator., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql cd5e856ea6 150/427: Add :autoincrement., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f31120edb6 155/427: Fix up documentation headers., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql adfbc7ed83 156/427: Add emacsql-show-last-sql., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 60d92d3051 159/427: Change the output mode to list., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d2f1bcef5d 165/427: Rename add-connection to register., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9dcfebfba7 030/427: Factor out schema->string code., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1f6c06bda9 050/427: Use expr expansion in :where expander., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 39aa16906a 034/427: Remove redundant wait., ELPA Syncer, 2022/12/13