Codebase list emacsql-sqlite3 / 998ba54
doc: refinement. Zhu Zihao 4 years ago
2 changed file(s) with 52 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
0 # Created 2019-09-26 Thu 23:42
0 # Created 2019-12-11 Wed 20:28
11 #+TITLE: Yet another EmacSQL backend for SQLite
22 #+AUTHOR: Zhu Zihao
33 * README
1010 This is yet another [[https://github.com/skeeto/emacsql][EmacSQL]] backend for SQLite, which use official =sqlite3=
1111 executable to access SQL database.
1212
13 The tests don't pass under Emacs 25.1 for unknown reason, so we don't support
14 Emacs 25.1 currently. But any PR to improve this are welcomed.
15
1613 ** Installation
1714
1815 =emacsql-sqlite3= is available on melpa.
1916
2017 ** Usage
2118
22 You need to install =sqlite3= official CLI tool, 3.8.2 version or above were
23 tested, =emacsql-sqlite3= may won't work if you using lower version.
19 For Emacs users, please notice that this package won't provide any feature for
20 convenience. *If you don't sure you need this, you probably don't need this.*
2421
25 =sqlite3= CLI tool will load =~/.sqliterc= if presented, =emacsql-sqlite3=
26 will get undefined behaviour if any error occurred during the load progress.
22 For package developers, this package can be a replacement of [[https://github.com/skeeto/emacsql][emacsql-sqlite]] and
23 it doesn't require user to have a C compiler, but please read following
24 precautions.
25
26 - You need to install =sqlite3= official CLI tool, 3.8.2 version or above were
27 tested, =emacsql-sqlite3= may won't work if you using lower version.
28
29 - =sqlite3= CLI tool will load =~/.sqliterc= if presented, =emacsql-sqlite3=
30 will get undefined behaviour if any error occurred during the load progress.
31 It's better to keep this file empty.
32
33 - This package should be compatible with =emacsql-sqlite3= for most cases. But
34 foreign key support was disabled by default. To enable this feature, use
35 ~(emacsql <db> [:pragma (= foreign_keys ON)])~
2736
2837 The only entry point to a EmacSQL interface is =emacsql-sqlite3=, for more
29 information, please check EmacSQL's README.
38 information, please check [[https://github.com/skeeto/emacsql/blob/master/README.md][EmacSQL's README]].
3039
3140 ** About Closql
3241
3342 [[https://github.com/emacscollective/closql][closql]] is using =emacsql-sqlite= as backend, you can use following code to force
34 closql use =emacsql-sqlite3= since it's full compatible.
43 closql use =emacsql-sqlite3=.
3544
36 #+BEGIN_SRC emacs-lisp
45 #+begin_src emacs-lisp
3746 (with-eval-after-load 'closql
3847 (defclass closql-database (emacsql-sqlite3-connection)
3948 ((object-class :allocation :class))))
40 #+END_SRC
49 #+end_src
50
51 ** Known issue
52
53 The tests don't pass under Emacs 25.1 for unknown reason, so we don't support
54 Emacs 25.1 currently like [[https://github.com/skeeto/emacsql][emacsql-sqlite]]. But any PR to improve this are
55 welcomed.
3434 ;; This is yet another [[https://github.com/skeeto/emacsql][EmacSQL]] backend for SQLite, which use official =sqlite3=
3535 ;; executable to access SQL database.
3636
37 ;; The tests don't pass under Emacs 25.1 for unknown reason, so we don't support
38 ;; Emacs 25.1 currently. But any PR to improve this are welcomed.
39
4037 ;; ** Installation
4138
4239 ;; =emacsql-sqlite3= is available on melpa.
4340
4441 ;; ** Usage
4542
46 ;; You need to install =sqlite3= official CLI tool, 3.8.2 version or above were
47 ;; tested, =emacsql-sqlite3= may won't work if you using lower version.
48
49 ;; =sqlite3= CLI tool will load =~/.sqliterc= if presented, =emacsql-sqlite3=
50 ;; will get undefined behaviour if any error occurred during the load progress.
43 ;; For Emacs users, please notice that this package won't provide any feature for
44 ;; convenience. *If you don't sure you need this, you probably don't need this.*
45
46 ;; For package developers, this package can be a replacement of [[https://github.com/skeeto/emacsql][emacsql-sqlite]] and
47 ;; it doesn't require user to have a C compiler, but please read following
48 ;; precautions.
49
50 ;; - You need to install =sqlite3= official CLI tool, 3.8.2 version or above were
51 ;; tested, =emacsql-sqlite3= may won't work if you using lower version.
52
53 ;; - =sqlite3= CLI tool will load =~/.sqliterc= if presented, =emacsql-sqlite3=
54 ;; will get undefined behaviour if any error occurred during the load progress.
55 ;; It's better to keep this file empty.
56
57 ;; - This package should be compatible with =emacsql-sqlite3= for most cases. But
58 ;; foreign key support was disabled by default. To enable this feature, use
59 ;; ~(emacsql <db> [:pragma (= foreign_keys ON)])~
5160
5261 ;; The only entry point to a EmacSQL interface is =emacsql-sqlite3=, for more
53 ;; information, please check EmacSQL's README.
62 ;; information, please check [[https://github.com/skeeto/emacsql/blob/master/README.md][EmacSQL's README]].
5463
5564 ;; ** About Closql
5665
5766 ;; [[https://github.com/emacscollective/closql][closql]] is using =emacsql-sqlite= as backend, you can use following code to force
58 ;; closql use =emacsql-sqlite3= since it's full compatible.
67 ;; closql use =emacsql-sqlite3=.
5968
6069 ;; #+BEGIN_SRC emacs-lisp :results none
6170 ;; (with-eval-after-load 'closql
6271 ;; (defclass closql-database (emacsql-sqlite3-connection)
6372 ;; ((object-class :allocation :class))))
6473 ;; #+END_SRC
74
75 ;; ** Known issue
76
77 ;; The tests don't pass under Emacs 25.1 for unknown reason, so we don't support
78 ;; Emacs 25.1 currently like [[https://github.com/skeeto/emacsql][emacsql-sqlite]]. But any PR to improve this are
79 ;; welcomed.
6580
6681 ;; * _ :ignore:
6782