在学习新语言时陷入技术困境的经典案例。这里没什么可看的......
我正在尝试在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.html和https://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';}]