doc: refinement.
Zhu Zihao
4 years ago
0 | # Created 2019-09-26 Thu 23:42 | |
0 | # Created 2019-12-11 Wed 20:28 | |
1 | 1 | #+TITLE: Yet another EmacSQL backend for SQLite |
2 | 2 | #+AUTHOR: Zhu Zihao |
3 | 3 | * README |
10 | 10 | This is yet another [[https://github.com/skeeto/emacsql][EmacSQL]] backend for SQLite, which use official =sqlite3= |
11 | 11 | executable to access SQL database. |
12 | 12 | |
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 | ||
16 | 13 | ** Installation |
17 | 14 | |
18 | 15 | =emacsql-sqlite3= is available on melpa. |
19 | 16 | |
20 | 17 | ** Usage |
21 | 18 | |
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.* | |
24 | 21 | |
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)])~ | |
27 | 36 | |
28 | 37 | 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]]. | |
30 | 39 | |
31 | 40 | ** About Closql |
32 | 41 | |
33 | 42 | [[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=. | |
35 | 44 | |
36 | #+BEGIN_SRC emacs-lisp | |
45 | #+begin_src emacs-lisp | |
37 | 46 | (with-eval-after-load 'closql |
38 | 47 | (defclass closql-database (emacsql-sqlite3-connection) |
39 | 48 | ((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. |
34 | 34 | ;; This is yet another [[https://github.com/skeeto/emacsql][EmacSQL]] backend for SQLite, which use official =sqlite3= |
35 | 35 | ;; executable to access SQL database. |
36 | 36 | |
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 | ||
40 | 37 | ;; ** Installation |
41 | 38 | |
42 | 39 | ;; =emacsql-sqlite3= is available on melpa. |
43 | 40 | |
44 | 41 | ;; ** Usage |
45 | 42 | |
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)])~ | |
51 | 60 | |
52 | 61 | ;; 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]]. | |
54 | 63 | |
55 | 64 | ;; ** About Closql |
56 | 65 | |
57 | 66 | ;; [[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=. | |
59 | 68 | |
60 | 69 | ;; #+BEGIN_SRC emacs-lisp :results none |
61 | 70 | ;; (with-eval-after-load 'closql |
62 | 71 | ;; (defclass closql-database (emacsql-sqlite3-connection) |
63 | 72 | ;; ((object-class :allocation :class)))) |
64 | 73 | ;; #+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. | |
65 | 80 | |
66 | 81 | ;; * _ :ignore: |
67 | 82 |