How one talk to sqlite3 database from Fricas?

31 views
Skip to first unread message

Nasser M. Abbasi

unread,
Dec 23, 2023, 9:53:22 PM12/23/23
to FriCAS - computer algebra system
I googled and could not find hit on this. Is it possible to open SQLITE3 database file from Fricas and read/write to the database using SQL?

Currently all my integration problems are stored in sqlite3 database which is open source database. Both Maple and Mathematica support reading/write to it. I wrote small note sometime ago how to do this in Maple. Here is link 

Does Fricas have such API?  I use sqlite3 for all my software and store everything in database files.

Thanks
--Nasser

Qian Yun

unread,
Dec 23, 2023, 10:24:21 PM12/23/23
to fricas...@googlegroups.com
There's no direct support.

You can try the following methods:

1. construct SQL strings and pass them to external sqlite process.

2. use a Common Lisp sqlite library. This requires some programming.

3. use C FFI interface, this also requires some programming.

4. use sage to interface with SQL and FriCAS.

5. it is possible to export sqlite database to text format, then
together with grep/sed/etc to hack up a input file for FriCAS to read.


May I ask you what's the purpose of this? Maybe you don't need
full sqlite support, and there can be a shortcut to fullfill your needs.

- Qian

On 12/24/23 10:53, 'Nasser M. Abbasi' via FriCAS - computer algebra
system wrote:
> I googled and could not find hit on this. Is it possible to open SQLITE3
> <https://www.sqlite.org/index.html> database file from Fricas and
> read/write to the database using SQL?
>
> Currently all my integration problems are stored in sqlite3 database which
> is open source database. Both Maple and Mathematica support reading/write
> to it. I wrote small note sometime ago how to do this in Maple. Here is link
> <https://12000.org/my_notes/faq/sql_in_maple/index.htm>

Grégory Vanuxem

unread,
Apr 11, 2024, 11:09:34 AM4/11/24
to fricas...@googlegroups.com
Hello Nasser,

You were asking about sqlite3 database things. I wonder what you were
asking for. The routines you use. I was looking at your work, it looks
interesting. But, to be more precise, what are the functions/methods
you use? I only know a little of the usual SQL language and minor
things about Berkeley DB implementations. It's more a matter of game
than reliable things.

Regards,
- Greg

Le dim. 24 déc. 2023 à 03:53, 'Nasser M. Abbasi' via FriCAS - computer
algebra system <fricas...@googlegroups.com> a écrit :
> --
> You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/31dff7b9-5745-491e-95f3-90ed3d2fe949n%40googlegroups.com.

Kurt Pagani

unread,
Apr 11, 2024, 3:19:18 PM4/11/24
to fricas-devel

Grégory Vanuxem

unread,
Apr 12, 2024, 6:15:57 AM4/12/24
to fricas...@googlegroups.com
Hello,

Le jeu. 11 avr. 2024 à 21:19, Kurt Pagani <nil...@gmail.com> a écrit :
>
> https://github.com/nilqed/spadlib/tree/master/sqlite
>

This is definitely better than what I thought. I guess Nasser also
wants the ability to add entries but it's easy to add this I guess. I
wanted to cc-ing him but he uses temporary mail accounts apparently.
And as a note, it could also be used without using local/personal
quicklisp on Debian-like system:

└─$ apt-cache search sqlite |grep cl-
cl-sql-sqlite3 - CLSQL database backend, SQLite3
cl-sqlite - Common Lisp interface to SQLite

Best regards,
- Greg
> To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/CA%2BTGnoZDbhnyB7nSKbB-yxb9-KkO%2BJA3h-U0Lk5XjveYbCsZoA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages