Skip to content

Commit d78df13

Browse files
committed
Add missing documentation for compileoption_used()-method
1 parent 599f668 commit d78df13

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

doc_classes/SQLite.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,17 @@
185185
Restore the current database from a path, see [url=https://www.sqlite.org/backup.html]here[/url]. This feature is useful if you are using a database as your save file and you want to easily implement a loading mechanic. Be warned that the original database will be overwritten entirely when restoring.
186186
</description>
187187
</method>
188+
<method name="compileoption_used">
189+
<return type="bool" />
190+
<description>
191+
Check if the binary was compiled using the specified option, see [url=https://sqlite.org/c3ref/compileoption_get.html]here[/url].
192+
Mostly relevant for checking if the [url=https://sqlite.org/fts5.html]SQLite FTS5 Extension[/url] is enabled, in which case the following lines can be used:
193+
[codeblock]
194+
db.compileoption_used("SQLITE_ENABLE_FTS5") # Returns '1' if enabled or '0' if disabled
195+
db.compileoption_used("ENABLE_FTS5") # The "SQLITE_"-prefix may be omitted.
196+
[/codeblock]
197+
</description>
198+
</method>
188199
</methods>
189200
<members>
190201
<member name="path" type="String" default="default">

src/gdsqlite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void SQLite::_bind_methods() {
2828
ClassDB::bind_method(D_METHOD("export_to_json", "export_path"), &SQLite::export_to_json);
2929

3030
ClassDB::bind_method(D_METHOD("get_autocommit"), &SQLite::get_autocommit);
31-
ClassDB::bind_method(D_METHOD("compileoption_used"), &SQLite::compileoption_used);
31+
ClassDB::bind_method(D_METHOD("compileoption_used", "option_name"), &SQLite::compileoption_used);
3232

3333
// Properties.
3434
ClassDB::bind_method(D_METHOD("set_last_insert_rowid", "last_insert_rowid"), &SQLite::set_last_insert_rowid);

0 commit comments

Comments
 (0)