Added
Link Here
|
1 |
--- emacsql-sqlite.el.orig 2020-07-14 00:28:59 UTC |
2 |
+++ emacsql-sqlite.el |
3 |
@@ -33,16 +33,7 @@ |
4 |
"sqlite/emacsql-sqlite") |
5 |
"Relative path to emacsql executable.") |
6 |
|
7 |
-(defvar emacsql-sqlite-executable |
8 |
- (expand-file-name emacsql-sqlite-executable-path |
9 |
- (if (or (file-writable-p emacsql-sqlite-data-root) |
10 |
- (file-exists-p (expand-file-name |
11 |
- emacsql-sqlite-executable-path |
12 |
- emacsql-sqlite-data-root))) |
13 |
- emacsql-sqlite-data-root |
14 |
- (expand-file-name |
15 |
- (concat "emacsql/" emacsql-version) |
16 |
- user-emacs-directory))) |
17 |
+(defvar emacsql-sqlite-executable "%%PREFIX%%/bin/emacsql-sqlite" |
18 |
"Path to the EmacSQL backend (this is not the sqlite3 shell).") |
19 |
|
20 |
(defvar emacsql-sqlite-reserved |
21 |
@@ -100,6 +91,7 @@ used.") |
22 |
(emacsql-wait connection) |
23 |
(emacsql connection [:pragma (= busy-timeout $s1)] |
24 |
(/ (* emacsql-global-timeout 1000) 2)) |
25 |
+ (emacsql connection [:pragma (= foreign_keys 1)]) |
26 |
(emacsql-register connection))) |
27 |
|
28 |
(cl-defun emacsql-sqlite (file &key debug) |
29 |
@@ -163,12 +155,11 @@ If called with non-nil ASYNC the return value is meani |
30 |
if path return it)) |
31 |
(src (expand-file-name "sqlite" emacsql-sqlite-data-root)) |
32 |
(files (mapcar (lambda (f) (expand-file-name f src)) |
33 |
- '("sqlite3.c" "emacsql.c"))) |
34 |
+ '("emacsql.c"))) |
35 |
(cflags (list (format "-I%s" src) (format "-O%d" (or o-level 2)))) |
36 |
(ldlibs (cl-case system-type |
37 |
(windows-nt (list)) |
38 |
- (berkeley-unix (list "-lm")) |
39 |
- (otherwise (list "-lm" "-ldl")))) |
40 |
+ (otherwise (list "-lsqlite3")))) |
41 |
(options (emacsql-sqlite-compile-switches)) |
42 |
(output (list "-o" emacsql-sqlite-executable)) |
43 |
(arguments (nconc cflags options files ldlibs output))) |