aboutsummaryrefslogtreecommitdiffstats
path: root/src/sqlite.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2026 to copyright years.Sean Whitton12 days1-1/+1
|
* Support file:// URIs and readonly DB in 'sqlite-open'Eli Zaretskii2025-04-141-5/+15
| | | | | | | | | * src/sqlite.c (Fsqlite_open): Two new optional arguments, READONLY and DISABLE-URI. Doc fix. * etc/NEWS: * doc/lispref/text.texi (Database): Document the new optional arguments to 'sqlite-open'. (Bug#65274)
* Merge branch 'scratch/no-purespace' into 'master'Stefan Kangas2025-02-011-4/+4
|\
| * Pure storage removal: Replace calls to removed functionsPip Cet2024-12-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (string_bytes, pin_string, valid_lisp_object_p) (process_mark_stack, survives_gc_p, syms_of_alloc): * src/androidterm.c (android_term_init): Replace call to 'build_pure_c_string'. * src/buffer.c (init_buffer_once, syms_of_buffer): * src/bytecode.c (exec_byte_code): * src/callint.c (syms_of_callint): * src/callproc.c (syms_of_callproc): * src/category.c (Fdefine_category): * src/coding.c (syms_of_coding): * src/comp.c (Fcomp__compile_ctxt_to_file0) (maybe_defer_native_compilation, syms_of_comp): * src/data.c (Fsetcar, Fsetcdr, Fdefalias, Faset, syms_of_data): * src/dbusbind.c (syms_of_dbusbind): * src/doc.c (Fsnarf_documentation): * src/emacs-module.c (syms_of_module): * src/eval.c (Finternal__define_uninitialized_variable) (Fdefconst_1, define_error, syms_of_eval): * src/fileio.c (syms_of_fileio): * src/fns.c (Ffillarray, Fclear_string, check_mutable_hash_table): * src/fontset.c (syms_of_fontset): * src/frame.c (make_initial_frame): * src/haikufns.c (syms_of_haikufns): * src/intervals.c (create_root_interval): * src/keyboard.c (syms_of_keyboard): * src/keymap.c (Fmake_sparse_keymap, Fset_keymap_parent) (store_in_keymap, syms_of_keymap): * src/lisp.h: * src/lread.c (Fload, read0, intern_c_string_1, define_symbol) (Fintern, defsubr, syms_of_lread): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (syms_of_pgtkfns): * src/pgtkterm.c (syms_of_pgtkterm): * src/process.c (syms_of_process): * src/search.c (syms_of_search): * src/sqlite.c (syms_of_sqlite): * src/syntax.c (syms_of_syntax): * src/treesit.c (syms_of_treesit): * src/w32fns.c (syms_of_w32fns): * src/xdisp.c (syms_of_xdisp): * src/xfaces.c (syms_of_xfaces): * src/xfns.c (syms_of_xfns): * src/xftfont.c (syms_of_xftfont): * src/xterm.c (syms_of_xterm): Remove calls to 'PURE_P', 'CHECK_IMPURE', 'Fpurecopy', and replace calls to 'build_pure_c_string', 'pure_list', 'pure_listn', etc., by impure equivalents.
* | Update copyright year to 2025Paul Eggert2025-01-011-1/+1
|/ | | | Run "TZ=UTC0 admin/update-copyright".
* Standardize possessive apostrophe usage in manuals, docs, and commentsStefan Kangas2024-07-251-1/+1
| | | | | See the note in admin/notes/documentation. Ref: https://lists.gnu.org/r/emacs-devel/2012-02/msg00649.html
* ; * src/sqlite.c (Fsqlite_load_extension): Add "vec0" to allowed extensions.Eli Zaretskii2024-07-201-0/+1
|
* ; Fix last change in sqlite.cEli Zaretskii2024-06-061-5/+5
| | | | | | * etc/NEWS: * doc/lispref/text.texi (Database): * src/sqlite.c (Fsqlite_execute_batch): Fix last change (Bug#70145).
* Add 'sqlite-execute-batch' commandJavier Olaechea2024-06-061-0/+12
| | | | | | | | | | | | | This command is similar to 'sqlite-execute' except that it executes multiple statements in exchange for not accepting any arguments. (Bug#70145) * src/sqlite.c (Fsqlite_execute_batch): New function. * test/src/sqlite-tests.el (sqlite-multiple-statements): Add smoke test for 'sqlite-execute-batch'. * etc/NEWS: Mention new command 'sqlite-execute-batch'. * doc/lispref/text.texi (Database): Document the new command.
* Followup changes to `cl-type-of`scratch/object-typeStefan Monnier2024-03-181-11/+6
| | | | | | | | | | | | | | These changes came up while working on `cl-type-of` but are not directly related to the new `cl-type-of`. The BASE_PURESIZE bump was needed at some point on one of my machine, not sure why. * src/puresize.h (BASE_PURESIZE): Bump up. * src/sqlite.c (bind_value): Don't use `Ftype_of`. * lisp/emacs-lisp/seq.el (seq-remove-at-position): Simplify. * lisp/emacs-lisp/cl-preloaded.el (finalizer): New (previously missing) type. * doc/lispref/objects.texi (Type Predicates): Minor tweaks.
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* Add 2 SQLite extensions to allow-list.Eli Zaretskii2023-11-181-0/+2
| | | | | | * src/sqlite.c (Fsqlite_load_extension): Add 2 Free Software extensions to the allow-list. For the details, see https://lists.gnu.org/archive/html/emacs-devel/2023-11/msg00234.html.
* ; Support SQLite3 extensions on macOSEli Zaretskii2023-05-231-4/+6
| | | | | * src/sqlite.c (Fsqlite_load_extension): Support *.dylib extensions. (Bug#63653)
* Disable loading SQLite3 extensions when SQLite3 version is too oldEli Zaretskii2023-05-231-5/+16
| | | | | | | | * src/sqlite.c (HAVE_LOAD_EXTENSION): Define to 1 only if enabling/disabling extension loading is supported as well. (load_dll_functions, Fsqlite_load_extension): Condition on HAVE_LOAD_EXTENSION, not on HAVE_SQLITE3_LOAD_EXTENSION. (Bug#63653)
* Fix loading SQLite extensionsEli Zaretskii2023-05-201-9/+44
| | | | | | | | | | * src/sqlite.c (sqlite3_db_config) [WINDOWSNT]: Load from the DLL. (Fsqlite_load_extension): Use 'sqlite3_db_config' to enable and disable loading of extensions. Add a few free extensions to the allow-list. Fix testing for the ".dll" extension. (Bug#63590) * test/src/sqlite-tests.el (sqlite-load-extension): Fix the test to require successful load if the extension does exist.
* Minor improvements in sqlite.cEli Zaretskii2023-02-021-3/+7
| | | | | | | | * src/sqlite.c (Fsqlite_next): Doc fix. Return nil if SQLITE_DONE was once seen for this statement. (Bug#61151) (row_to_value): Cons the value in reverse, to avoid the Fnreverse call. Patch by Helmut Eller <eller.helmut@gmail.com>. (Bug#61165)
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* ; * src/sqlite.c (Fsqlite_version): Doc fix.Eli Zaretskii2022-11-251-1/+2
|
* Add sqlite library version string retrieval function (bug#58766)Mattias Engdegård2022-11-251-0/+14
| | | | | | | | | | * src/sqlite.c (sqlite3_libversion, load_dll_functions): Make sqlite3_libversion available. (Fsqlite_version): New. (syms_of_sqlite): Define sqlite-version. * doc/lispref/text.texi (Database): Document. * test/src/sqlite-tests.el (sqlite-returning): `RETURNING` was added in sqlite 3.35; skip the test for older versions.
* Fix warnings in sqlite.c in the MS-Windows buildEli Zaretskii2022-11-051-11/+21
| | | | | | | * src/sqlite.c (sqlite3_errstr) [WINDOWSNT]: Define and load from the DLL only if the SQLite3 version is at least 3.7.15. (sqlite_prepare_errdata) [SQLITE_VERSION_NUMBER >= 3007015]: Use the original code if sqlite3_errstr is available.
* Make sqlite.c build with SQlite in Fedora 9Po Lu2022-11-051-4/+16
| | | | | * src/sqlite.c (sqlite_prepare_errdata): Use sqlite3_errmsg instead of sqlite3_errstr.
* ; * src/sqlite.c (Fsqlite_select): Doc fix. (Bug#58885)Eli Zaretskii2022-10-301-8/+9
|
* Include more information in error data for sqlite errorsJonas Bernoulli2022-10-281-24/+33
| | | | | | | | | | | | | | | | | Introduce a new 'sqlite-error' and use it for all errors signaled in 'src/sqlite.c', except those that already used 'sqlite-locked-error'. Include the values of 'sqlite3_errcode', 'sqlite3_extended_errcode', 'sqlite3_errstr' and 'sqlite3_errmsg' in the error data. * src/sqlite.c (load_dll_functions): Load 'sqlite3_extended_errcode'. (sqlite-load-extension): Use 'xsignal1' as required by argument type. (syms_of_sqlite): Introduce a new error type 'sqlite-error'. (check_sqlite, sqlite-open, bind_values, sqlite-execute) (sqlite-select, sqlite-load-extension, sqlite-next): Use it. (sqlite_prepare_errdata): New function. (sqlite_prepare_errmsg): Remove function. (sqlite-execute, sqlite-select): Use new function. (sqlite-locked-error): Derive from 'sqlite-error'.
* Improve error message from sqlite-executeLars Ingebrigtsen2022-10-111-12/+20
| | | | | | | * src/sqlite.c (sqlite_prepare_errmsg): New function. (Fsqlite_execute): Use it to get the same error format for both execute and select. (Fsqlite_select): Factored out from here.
* Support "insert into ... returning ..." in sqlite-executeLars Ingebrigtsen2022-10-101-56/+64
| | | | | | * doc/lispref/text.texi (Database): Mention it. * src/sqlite.c (Fsqlite_execute): Support syntax like "insert into ... returning ..." (bug#58390).
* Fix some indentation in Fsqlite_executeLars Ingebrigtsen2022-10-101-8/+9
| | | | * src/sqlite.c (Fsqlite_execute): Fix indentation.
* Make Fsqlite_select error data betterLars Ingebrigtsen2022-10-091-7/+11
| | | | | * src/sqlite.c (Fsqlite_select): Add more the more specific error text to the error data (bug#58363).
* Clean up Fsqlite_select slightlyLars Ingebrigtsen2022-10-091-1/+1
| | | | * src/sqlite.c (Fsqlite_select): Clean up code slightly.
* Make sqlite-select signal errors when there's an errorLars Ingebrigtsen2022-10-081-1/+5
| | | | | | * src/sqlite.c (load_dll_functions): Update. (Fsqlite_select): Signal an error when there's an error preparing the statement.
* Fix build with old sqlite librariesPo Lu2022-07-101-2/+4
| | | | | * src/sqlite.c (Fsqlite_open): Don't use SQLITE_OPEN_FULLMUTEX if not defined.
* Allow inserting and selecting binary blobs from sqliteLars Ingebrigtsen2022-04-281-9/+40
| | | | | | * doc/lispref/text.texi (Database): Document how to insert binary data. * src/sqlite.c (bind_values): Bind BLOB columns correctly (bug#54591).
* Port sqlite.c to OS X 10.6.8 with Xcode 3.2.6Paul Eggert2022-04-171-22/+20
| | | | | | | Problem reported by Keith David Bershatsky in: https://lists.gnu.org/r/emacs-devel/2022-04/msg00923.html * src/sqlite.c (Fsqlite_open): Don’t assume SQLITE_OPEN_MEMORY is defined.
* ; * src/sqlite.c: Fix up header comment.Po Lu2022-04-021-3/+3
|
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
|
* Only allow SQLite extensions from an allowlistLars Ingebrigtsen2021-12-141-5/+31
| | | | | * src/sqlite.c (Fsqlite_load_extension): Only allow extensions from an allowlist.
* * src/sqlite.c (Fsqlite_open, Fsqlite_load_extension): Use ENCODE_FILE.Eli Zaretskii2021-12-131-2/+2
|
* Add a new `sqlite-pragma' commandLars Ingebrigtsen2021-12-131-0/+12
| | | | | | | * doc/lispref/text.texi (Database): Document it. * src/sqlite.c (Fsqlite_pragma): Add a separate command for pragmas. These can be done via sqlite-execute, but it's less confusing to have them in a separate command.
* Introduce a new sqlite-locked-errorLars Ingebrigtsen2021-12-131-2/+11
| | | | | | * src/sqlite.c (Fsqlite_execute): Use it. (syms_of_sqlite): Introduce a new error for locked databases so that we can catch that condition on higher levels.
* * src/sqlite.c (row_to_value): Call 'make_unibyte_string'.Eli Zaretskii2021-12-111-4/+4
|
* Minor cleanups in sqlite.cEli Zaretskii2021-12-111-12/+16
| | | | | | | | * src/sqlite.c (Fsqlite_open): Signal an error if 'init_sqlite_functions' fails. Encode FILE using UTF-8. (Fsqlite_close, Fsqlite_execute, Fsqlite_select) (Fsqlite_load_extension): Doc fixes. (Fsqlite_load_extension): Encode MODULE using UTF-8.
* Minor cleanups of sqlite3 code on MS-WindowsEli Zaretskii2021-12-111-32/+16
| | | | | | | | | | * src/sqlite.c (sqlite_loaded_p): Function deleted: not used anymore. (init_sqlite_functions) [WINDOWSNT]: Use a static 'bool' variable to indicate if sqlite3 DLL was successfully loaded. (Fsqlite_available_p) [WINDOWSNT]: Just call 'init_sqlite_functions' if Vlibrary_cache doesn't mention 'sqlite3'.
* Fix a typo in sqlite.cEli Zaretskii2021-12-111-1/+1
| | | | | * src/sqlite.c (Fsqlite_select): Fix a typo in arguments to make_sqlite.
* Fix Fsqlite_finalize book-keepingLars Ingebrigtsen2021-12-111-1/+2
| | | | * src/sqlite.c (Fsqlite_finalize): Mark the object as dead.
* Check whether the sqlite supports sqlite3_load_extensionLars Ingebrigtsen2021-12-111-4/+13
| | | | | | | * configure.ac: Check for sqlite3_load_extension, which is apparently missing in some versions. * src/sqlite.c: Add guards. (Fsqlite_load_extension): Ifdef out on systems that doesn't have it.
* Fix some sqlite doc string typosLars Ingebrigtsen2021-12-111-2/+2
| | | | | * src/sqlite.c (Fsqlite_load_extension, Fsqlite_more_p): Fix typos in doc strings.
* Add sqlite3 support to EmacsLars Ingebrigtsen2021-12-111-0/+708
* configure.ac: Add check for the sqlite library. * doc/lispref/text.texi (Database): Document it. * lisp/sqlite.el: New file. * lisp/term/w32-win.el (dynamic-library-alist): Add a mapping. * src/Makefile.in (SQLITE3_LIBS): Add the libraries. * src/alloc.c (union emacs_align_type): Add a Lisp_Sqlite struct. * src/data.c (Ftype_of): Add sqlite. * src/emacs.c (main): Load the syms. * src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add PVEC_SQLITE. (GCALIGNED_STRUCT): New struct to keep data for sqlite database objects and statement objects. (SQLITEP, SQLITE, CHECK_SQLITE, XSQLITE): New macros for accessing the objects. * src/pdumper.c (dump_vectorlike): Update hash. (dump_vectorlike): Don't dump it. * src/print.c (print_vectorlike): Add a printer for the sqlite object. * src/sqlite.c: New file. * test/src/sqlite-tests.el: Add tests.