[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql ad3483c97c 5/9: emacsql-sqlite-list-tables: New fu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql ad3483c97c 5/9: emacsql-sqlite-list-tables: New function |
Date: |
Wed, 22 Feb 2023 14:59:07 -0500 (EST) |
branch: elpa/emacsql
commit ad3483c97c8197e1adc06ca5011185397b291ce0
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
emacsql-sqlite-list-tables: New function
---
emacsql-sqlite-common.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/emacsql-sqlite-common.el b/emacsql-sqlite-common.el
index 15a879bebe..216dbcc47a 100644
--- a/emacsql-sqlite-common.el
+++ b/emacsql-sqlite-common.el
@@ -83,6 +83,22 @@ Also see http://www.sqlite.org/lang_keywords.html.";)
Elements have the form (ERRCODE SYMBOLIC-NAME EMACSQL-ERROR
ERRSTR). Also see https://www.sqlite.org/rescode.html.";)
+;;; Utilities
+
+(defun emacsql-sqlite-list-tables (connection)
+ "Return a list of the names of all tables in CONNECTION.
+Tables whose names begin with \"sqlite_\", are not included
+in the returned value."
+ (emacsql connection
+ [:select name
+ ;; The new name is `sqlite-schema', but this name
+ ;; is supported by old and new SQLite versions.
+ ;; See https://www.sqlite.org/schematab.html.
+ :from sqlite-master
+ :where (and (= type 'table)
+ (not-like name "sqlite_%"))
+ :order-by [(asc name)]]))
+
(provide 'emacsql-sqlite-common)
;;; emacsql-sqlite-common.el ends here
- [nongnu] elpa/emacsql updated (f0249f655f -> 497971121a), ELPA Syncer, 2023/02/22
- [nongnu] elpa/emacsql 7a725e1910 2/9: Add new library emacsql-sqlite-common, ELPA Syncer, 2023/02/22
- [nongnu] elpa/emacsql 8d111e4dcd 6/9: emacsql-sqlite-dump-database: New function, ELPA Syncer, 2023/02/22
- [nongnu] elpa/emacsql b4d7efac4d 7/9: emacsql-sqlite-restore-database: New function, ELPA Syncer, 2023/02/22
- [nongnu] elpa/emacsql 0bcf526c48 1/9: Fix how class documentation is provided, ELPA Syncer, 2023/02/22
- [nongnu] elpa/emacsql d61f674b64 4/9: emacsql--sqlite-base: Use nil as :initform of file slot, ELPA Syncer, 2023/02/22
- [nongnu] elpa/emacsql ad3483c97c 5/9: emacsql-sqlite-list-tables: New function,
ELPA Syncer <=
- [nongnu] elpa/emacsql 497971121a 9/9: emacsql-sqlite-dump-database: Override output file unless versioned, ELPA Syncer, 2023/02/22
- [nongnu] elpa/emacsql b33073257e 3/9: Use common base class for all SQLite connection classes, ELPA Syncer, 2023/02/22
- [nongnu] elpa/emacsql 70e95655df 8/9: emacsql-sqlite-default-connection: New function, ELPA Syncer, 2023/02/22