;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\207" [require cl-lib cl-generic eieio url url-http emacsql] 2) #@39 Directory where EmacSQL is installed. (defvar emacsql-sqlite-data-root (byte-code "\302\206 !\207" [load-file-name buffer-file-name file-name-directory] 2) (#$ . 237)) #@62 Path to the EmacSQL backend (this is not the sqlite3 shell). (defvar emacsql-sqlite-executable (byte-code "\302\303>\203 \304\202\f\305 \"\207" [system-type emacsql-sqlite-data-root expand-file-name (windows-nt cygwin ms-dos) "sqlite/emacsql-sqlite.exe" "sqlite/emacsql-sqlite"] 3) (#$ . 414)) #@82 List of all of SQLite's reserved words. http://www.sqlite.org/lang_keywords.html (defvar emacsql-sqlite-reserved (emacsql-register-reserved '(ABORT ACTION ADD AFTER ALL ALTER ANALYZE AND AS ASC ATTACH AUTOINCREMENT BEFORE BEGIN BETWEEN BY CASCADE CASE CAST CHECK COLLATE COLUMN COMMIT CONFLICT CONSTRAINT CREATE CROSS CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP DATABASE DEFAULT DEFERRABLE DEFERRED DELETE DESC DETACH DISTINCT DROP EACH ELSE END ESCAPE EXCEPT EXCLUSIVE EXISTS EXPLAIN FAIL FOR FOREIGN FROM FULL GLOB GROUP HAVING IF IGNORE IMMEDIATE IN INDEX INDEXED INITIALLY INNER INSERT INSTEAD INTERSECT INTO IS ISNULL JOIN KEY LEFT LIKE LIMIT MATCH NATURAL NO NOT NOTNULL NULL OF OFFSET ON OR ORDER OUTER PLAN PRAGMA PRIMARY QUERY RAISE RECURSIVE REFERENCES REGEXP REINDEX RELEASE RENAME REPLACE RESTRICT RIGHT ROLLBACK ROW SAVEPOINT SELECT SET TABLE TEMP TEMPORARY THEN TO TRANSACTION TRIGGER UNION UNIQUE UPDATE USING VACUUM VALUES VIEW VIRTUAL WHEN WHERE WITH WITHOUT)) (#$ . 717)) (byte-code "\300\301\302\303!\"\210\300\304\305\303!\"\210\300\306\304\"\210\307\306\310\311#\210\312\303\313\304#\314\303\315\316\317$\210\320\321\322\323\322\324%\207" [defalias emacsql-sqlite-connection-p eieio-make-class-predicate emacsql-sqlite-connection emacsql-sqlite-connection--eieio-childp eieio-make-child-predicate emacsql-sqlite-connection-child-p make-obsolete "use (cl-typep ... \\='emacsql-sqlite-connection) instead" "25.1" define-symbol-prop cl-deftype-satisfies eieio-defclass-internal (emacsql-connection emacsql-protocol-mixin) ((file :initarg :file :type (or null string) :documentation "Database file name.") (types :allocation :class :reader emacsql-types :initform '((integer "INTEGER") (float "REAL") (object "TEXT") (nil nil)))) ((:documentation "A connection to a SQLite database.")) cl-generic-define-method emacsql-types nil ((this emacsql-sqlite-connection)) #[257 "\300\301\"\207" [slot-value types] 4 "Access the slot `types' from object of class `emacsql-sqlite-connection'.\n\n(fn THIS)"]] 7) #@82 Create a new object of class type `emacsql-sqlite-connection'. (fn &rest SLOTS) (defalias 'emacsql-sqlite-connection #[128 "\300\301\302#\207" [apply make-instance emacsql-sqlite-connection] 5 (#$ . 2743)]) (byte-code "\300\301\302\303#\300\207" [function-put emacsql-sqlite-connection compiler-macro emacsql-sqlite-connection--anon-cmacro] 4) #@26 (fn WHOLE &rest SLOTS) (defalias 'emacsql-sqlite-connection--anon-cmacro #[385 "\211@;\204\207\300\301\302@@#@\303@DABB\"\207" [macroexp-warn-and-return format "Obsolete name arg %S to constructor %S" identity] 7 (#$ . 3095)]) (cl-generic-define-method 'initialize-instance '(:after) '((connection emacsql-sqlite-connection) &rest _) nil #[385 "\305 \210\306\307\211\310\311\"\312\313!\203\314!\202\315\316\317 $\320\321#\266\211\322\323\"\266\324!\210\325\326\f\327_\330\245#\210\331!+\207" [process-connection-type coding-system-for-write coding-system-for-read emacsql-sqlite-executable emacsql-global-timeout emacsql-sqlite-ensure-binary nil utf-8-auto slot-value file generate-new-buffer " *emacsql-sqlite*" expand-file-name ":memory:" start-process "emacsql-sqlite" eieio-oset process set-process-sentinel #[514 "\300\301!!\207" [kill-buffer process-buffer] 5 "\n\n(fn PROC _)"] emacsql-wait emacsql [:pragma (= busy-timeout $s1)] 1000 2 emacsql-register] 12 "\n\n(fn CONNECTION &rest ##)"]) #@212 Open a connected to database stored in FILE. If FILE is nil use an in-memory database. :debug LOG -- When non-nil, log all SQLite commands to a log buffer. This is for debugging purposes. (fn FILE &key DEBUG) (defalias 'emacsql-sqlite #[385 "\300\301\"A@\211\2031\211@\302>\203\211AA\262\202\303>A@\203(\304\262\202\305\306@\"\210\202\210\307\310\311#\203?\312!\210\207" [plist-member :debug (:debug :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:debug)" make-instance emacsql-sqlite-connection :file emacsql-enable-debugging] 7 (#$ . 4135)]) (byte-code "\300\301\302\303\302\304%\210\300\305\302\306\302\307%\207" [cl-generic-define-method emacsql-close nil ((connection emacsql-sqlite-connection)) #[257 "\300!\301!\205\f\302!\207" [emacsql-process process-live-p process-send-eof] 4 "Gracefully exits the SQLite subprocess.\n\n(fn CONNECTION)"] emacsql-send-message ((connection emacsql-sqlite-connection) message) #[514 "\300!\301\302\303\304!\"\"\210\301\"\210\301\305\"\207" [emacsql-process process-send-string format "%d " string-bytes "\n"] 9 "\n\n(fn CONNECTION MESSAGE)"]] 6) #@56 List of regexp's mapping sqlite3 output to conditions. (defvar emacsql-sqlite-condition-alist '(((1 4 9 12 17 18 20 21 22 25) emacsql-error) ((2) emacsql-internal) ((3 8 10 13 14 15 23) emacsql-access) ((5 6) emacsql-locked) ((7) emacsql-memory) ((11 16 24 26) emacsql-corruption) ((19) emacsql-constraint) ((27 28) emacsql-warning)) (#$ . 5295)) (cl-generic-define-method 'emacsql-handle nil '((_ emacsql-sqlite-connection) code message) nil #[771 "\301\302\303\304$A@\206 \305C\"\207" [emacsql-sqlite-condition-alist signal cl-assoc :test memql emacsql-error] 9 "Get condition for MESSAGE provided from SQLite.\n\n(fn _ CODE MESSAGE)"]) #@66 Return the compilation switches from the Makefile under sqlite/. (defalias 'emacsql-sqlite-compile-switches #[0 "\302\303\"\304\305\306\307\"r\211q\210\310\311\"\216\312!\210eb\210\304\313\314\304\315#\203-\316\317!B\262\202\211\237\262*\262)\207" [emacsql-sqlite-data-root case-fold-search expand-file-name "sqlite/Makefile" nil generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents re-search-forward "-D[A-Z0-9_=]+" :no-error match-string 0] 7 (#$ . 5944)]) #@164 Compile the SQLite back-end for EmacSQL, returning non-nil on success. If called with non-nil ASYNC the return value is meaningless. (fn &optional O-LEVEL ASYNC) (defalias 'emacsql-sqlite-compile #[512 "\305\306!\307\310\"\311\312\313\"\314\"\315\316\"\315\317\206\320\"D \321>\203'\322C\202*\322\323D\324 \325\nD\244\244\244\244\204C\326\327\330!\210\207\327\331!\210\332 !r\211q\210\333\334\335\nB\336#\337\261\210\340\341\n\326 \203j\342\202k\333\333&*\342=\207" [emacsql-sqlite-data-root system-type emacsql-sqlite-executable byte-compile-log-buffer inhibit-read-only executable-find "cc" expand-file-name "sqlite" mapcar make-closure #[257 "\301\300\"\207" [V0 expand-file-name] 4 "\n\n(fn F)"] ("sqlite3.c" "emacsql.c") format "-I%s" "-O%d" 2 (windows-nt berkeley-unix) "-lm" "-ldl" emacsql-sqlite-compile-switches "-o" nil message "Could not find C compiler, skipping SQLite build" "Compiling EmacSQL SQLite binary ..." get-buffer-create t mapconcat identity " " "\n" apply call-process 0] 18 (#$ . 6501)]) #@75 Ensure the EmacSQL SQLite binary is available, signaling an error if not. (defalias 'emacsql-sqlite-ensure-binary #[0 "\301!?\205\3021\303\304!0\202\210\305?\205\306\307!\207" [emacsql-sqlite-executable file-exists-p (error) emacsql-sqlite-compile 2 nil error "No EmacSQL SQLite binary available, aborting"] 2 (#$ . 7551)]) (provide 'emacsql-sqlite)