aboutsummaryrefslogtreecommitdiffstats
path: root/src/sqlite.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2026-01-01; Add 2026 to copyright years.Sean Whitton1-1/+1
2025-04-14Support file:// URIs and readonly DB in 'sqlite-open'Eli Zaretskii1-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)
2025-01-02Update copyright year to 2025Stefan Kangas1-1/+1
Run "TZ=UTC0 admin/update-copyright".
2025-01-01Update copyright year to 2025Paul Eggert1-1/+1
Run "TZ=UTC0 admin/update-copyright".
2024-12-12Pure storage removal: Replace calls to removed functionsPip Cet1-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.
2024-07-25Standardize possessive apostrophe usage in manuals, docs, and commentsStefan Kangas1-1/+1
See the note in admin/notes/documentation. Ref: https://lists.gnu.org/r/emacs-devel/2012-02/msg00649.html
2024-07-20; * src/sqlite.c (Fsqlite_load_extension): Add "vec0" to allowed extensions.Eli Zaretskii1-0/+1
2024-06-06; Fix last change in sqlite.cEli Zaretskii1-5/+5
* etc/NEWS: * doc/lispref/text.texi (Database): * src/sqlite.c (Fsqlite_execute_batch): Fix last change (Bug#70145).
2024-06-06Add 'sqlite-execute-batch' commandJavier Olaechea1-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.
2024-03-18Followup changes to `cl-type-of`scratch/object-typeStefan Monnier1-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.
2024-01-02; Add 2024 to copyright yearsPo Lu1-1/+1
2023-11-18Add 2 SQLite extensions to allow-list.Eli Zaretskii1-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.
2023-05-23; Support SQLite3 extensions on macOSEli Zaretskii1-4/+6
* src/sqlite.c (Fsqlite_load_extension): Support *.dylib extensions. (Bug#63653)
2023-05-23Disable loading SQLite3 extensions when SQLite3 version is too oldEli Zaretskii1-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)
2023-05-20Fix loading SQLite extensionsEli Zaretskii1-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.
2023-02-02Minor improvements in sqlite.cEli Zaretskii1-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)
2023-01-01; Add 2023 to copyright years.Eli Zaretskii1-1/+1
2022-11-25; * src/sqlite.c (Fsqlite_version): Doc fix.Eli Zaretskii1-1/+2
2022-11-25Add sqlite library version string retrieval function (bug#58766)Mattias Engdegård1-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.
2022-11-05Fix warnings in sqlite.c in the MS-Windows buildEli Zaretskii1-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.
2022-11-05Make sqlite.c build with SQlite in Fedora 9Po Lu1-4/+16
* src/sqlite.c (sqlite_prepare_errdata): Use sqlite3_errmsg instead of sqlite3_errstr.
2022-10-30; * src/sqlite.c (Fsqlite_select): Doc fix. (Bug#58885)Eli Zaretskii1-8/+9
2022-10-28Include more information in error data for sqlite errorsJonas Bernoulli1-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'.
2022-10-11Improve error message from sqlite-executeLars Ingebrigtsen1-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.
2022-10-10Support "insert into ... returning ..." in sqlite-executeLars Ingebrigtsen1-56/+64
* doc/lispref/text.texi (Database): Mention it. * src/sqlite.c (Fsqlite_execute): Support syntax like "insert into ... returning ..." (bug#58390).
2022-10-10Fix some indentation in Fsqlite_executeLars Ingebrigtsen1-8/+9
* src/sqlite.c (Fsqlite_execute): Fix indentation.
2022-10-09Make Fsqlite_select error data betterLars Ingebrigtsen1-7/+11
* src/sqlite.c (Fsqlite_select): Add more the more specific error text to the error data (bug#58363).
2022-10-09Clean up Fsqlite_select slightlyLars Ingebrigtsen1-1/+1
* src/sqlite.c (Fsqlite_select): Clean up code slightly.
2022-10-08Make sqlite-select signal errors when there's an errorLars Ingebrigtsen1-1/+5
* src/sqlite.c (load_dll_functions): Update. (Fsqlite_select): Signal an error when there's an error preparing the statement.
2022-07-10Fix build with old sqlite librariesPo Lu1-2/+4
* src/sqlite.c (Fsqlite_open): Don't use SQLITE_OPEN_FULLMUTEX if not defined.
2022-04-28Allow inserting and selecting binary blobs from sqliteLars Ingebrigtsen1-9/+40
* doc/lispref/text.texi (Database): Document how to insert binary data. * src/sqlite.c (bind_values): Bind BLOB columns correctly (bug#54591).
2022-04-17Port sqlite.c to OS X 10.6.8 with Xcode 3.2.6Paul Eggert1-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.
2022-04-02; * src/sqlite.c: Fix up header comment.Po Lu1-3/+3
2022-01-01; Add 2022 to copyright years.Eli Zaretskii1-1/+1
2021-12-14Only allow SQLite extensions from an allowlistLars Ingebrigtsen1-5/+31
* src/sqlite.c (Fsqlite_load_extension): Only allow extensions from an allowlist.
2021-12-13* src/sqlite.c (Fsqlite_open, Fsqlite_load_extension): Use ENCODE_FILE.Eli Zaretskii1-2/+2
2021-12-13Add a new `sqlite-pragma' commandLars Ingebrigtsen1-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.
2021-12-13Introduce a new sqlite-locked-errorLars Ingebrigtsen1-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.
2021-12-11* src/sqlite.c (row_to_value): Call 'make_unibyte_string'.Eli Zaretskii1-4/+4
2021-12-11Minor cleanups in sqlite.cEli Zaretskii1-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.
2021-12-11Minor cleanups of sqlite3 code on MS-WindowsEli Zaretskii1-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'.
2021-12-11Fix a typo in sqlite.cEli Zaretskii1-1/+1
* src/sqlite.c (Fsqlite_select): Fix a typo in arguments to make_sqlite.
2021-12-11Fix Fsqlite_finalize book-keepingLars Ingebrigtsen1-1/+2
* src/sqlite.c (Fsqlite_finalize): Mark the object as dead.
2021-12-11Check whether the sqlite supports sqlite3_load_extensionLars Ingebrigtsen1-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.
2021-12-11Fix some sqlite doc string typosLars Ingebrigtsen1-2/+2
* src/sqlite.c (Fsqlite_load_extension, Fsqlite_more_p): Fix typos in doc strings.
2021-12-11Add sqlite3 support to EmacsLars Ingebrigtsen1-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.