尝试在sqlite中为tcl启用enable_load_extension

时间:2018-01-27 22:22:38

标签: sqlite tcl

在学习新语言时陷入技术困境的经典案例。这里没什么可看的......

我正在尝试在tcl中enable_load_extension并将“无效命令名称”dbHandle“”作为错误消息。最后的传统SELECT name FROM sqlite_master WHERE type='table';查询完美无缺,我看不出问题所在。

也许编译选项? PRAGMA compile_options;调用回复COMPILER=msvc-1900 ENABLE_FTS3 ENABLE_RTREE THREADSAFE=1鉴于我没有看到SQLITE_OMIT_LOAD_EXTENSION  (https://www.sqlite.org/compile.html#omit_load_extension)我应该没问题?

SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION的sqlite3_db_config  看起来很有用,请参阅https://www.sqlite.org/c3ref/db_config.htmlhttps://www.sqlite.org/c3ref/c_dbconfig_enable_fkey.html,但这些似乎不是tcl界面的一部分。

package require sqlite3

sqlite3 dbhandle example.db
puts [dbhandle eval {PRAGMA compile_options;}]

# $dbHandle enable_load_extension 1 ; #can't read "dbHandle": no such variable
# dbHandle enable_load_extension 1 ;   #invalid command name "dbHandle"
# dbHandle enable_load_extension true ;   #invalid command name "dbHandle"

# next line is fine
puts [dbhandle eval {SELECT name FROM sqlite_master WHERE type='table';}]

0 个答案:

没有答案