FS#70072 - [sqlite] compile with SQLITE_STMT
Attached to Project:
Arch Linux
Opened by Sam Saffron (sam.saffron) - Friday, 19 March 2021, 00:31 GMT
Last edited by Andreas Radke (AndyRTR) - Saturday, 20 March 2021, 10:40 GMT
Opened by Sam Saffron (sam.saffron) - Friday, 19 March 2021, 00:31 GMT
Last edited by Andreas Radke (AndyRTR) - Saturday, 20 March 2021, 10:40 GMT
|
Details
I would like access to the SQLITE_STMT virtual view.
Per: https://www.sqlite.org/stmt.html We need to compile with SQLITE_ENABLE_STMTVTAB to get access to it. I don't know if it makes sense or not just to add it to the default flags, if it does not make sense to add to default flags can we make it somehow optional? Looks like debian/gentoo compile with this so Arch is kind of different. Clearly I can work around this, but I am concerned about maintaining a long term term replacement in AUR just for this little feature. |
This task depends upon
Closed by Andreas Radke (AndyRTR)
Saturday, 20 March 2021, 10:40 GMT
Reason for closing: Implemented
Saturday, 20 March 2021, 10:40 GMT
Reason for closing: Implemented
The /usr/bin/sqlite3 tool successfully runs the example stmt queries for me. Why do you think this is missing?
```
FROM archlinux
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm ruby sqlite
RUN pacman -S --noconfirm base-devel
RUN gem install sqlite3
RUN sqlite3 test.db "SELECT * FROM SQLITE_STMT"
RUN ruby -e "require 'sqlite3'; db = SQLite3::Database.new 'test.db'; db.execute 'select * from SQLITE_STMT'"
```
Once I apply this the issue goes away:
```
--- a/sqlite/trunk/PKGBUILD
+++ b/sqlite/trunk/PKGBUILD
@@ -40,6 +40,7 @@ build() {
-DSQLITE_ENABLE_DBSTAT_VTAB=1 \
-DSQLITE_ENABLE_FTS3_TOKENIZER=1 \
-DSQLITE_SECURE_DELETE \
+ -DSQLITE_ENABLE_STMTVTAB \
-DSQLITE_MAX_VARIABLE_NUMBER=250000 \
-DSQLITE_MAX_EXPR_DEPTH=10000"
```
I guess the default amalgamation is the problem for rubygems
```
FROM debian
RUN apt-get update
RUN apt-get install -y ruby build-essential
RUN apt-get install -y sqlite libsqlite3-dev
RUN apt-get install -y ruby-dev
RUN gem install sqlite3-ruby
RUN sqlite3 test.db "SELECT * FROM SQLITE_STMT"
RUN ruby -e "require 'sqlite3'; db = SQLite3::Database.new 'test.db'; db.execute 'select * from SQLITE_STMT'"
```
ruby-sqlite3 links to core/sqlite
$ pkg-list-linked-libraries ruby-sqlite3 libsql
==> checking linked libraries for ruby-sqlite3-1.4.2-2-x86_64.pkg.tar.xz ...
usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/sqlite3-1.4.2/sqlite3/sqlite3_native.so
NEEDED libsqlite3.so.0
$ sudo pacman -S ruby-sqlite3 && ruby -e "require 'sqlite3'; db = SQLite3::Database.new 'test.db'; db.execute 'select * from SQLITE_STMT'"
/usr/lib/ruby/gems/2.7.0/gems/sqlite3-1.4.2/lib/sqlite3/database.rb:147:in `initialize': no such table: SQLITE_STMT (SQLite3::SQLException)
So, the implication is that libsqlite3 does not enable SQLITE_STMT, only the CLI tool does... that's interesting.