godot/modules/sqlite/doc_classes/SQLite.xml
2021-01-11 10:04:49 +00:00

113 lines
3.9 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<class name="SQLite" inherits="Reference" version="4.0">
<brief_description>
Wrapper class for SQLite databases.
</brief_description>
<description>
A wrapper class that lets you perform SQL statements on an SQLite database file.
For queries that involve arbitrary user input, you should use methods that end in [code]*_with_args[/code], as these protect against SQL injection.
</description>
<tutorials>
</tutorials>
<methods>
<method name="close">
<return type="void">
</return>
<description>
Closes the database handle.
</description>
</method>
<method name="fetch_array">
<return type="Array">
</return>
<argument index="0" name="statement" type="String">
</argument>
<description>
Returns the result of [code]statement[/code] as an [Array] of rows.
Each row is a [Dictionary], and each column can be accessed with either its name or its column position.
</description>
</method>
<method name="fetch_array_with_args">
<return type="Array">
</return>
<argument index="0" name="statement" type="String">
</argument>
<argument index="1" name="args" type="Array">
</argument>
<description>
Returns the result of [code]statement[/code] as an [Array] of rows, substituting each [code]?[/code] with [code]args[/code].
Each row is a [Dictionary], and each column can be accessed with either its name or its column position.
</description>
</method>
<method name="fetch_assoc">
<return type="Array">
</return>
<argument index="0" name="statement" type="String">
</argument>
<description>
Returns the result of [code]statement[/code] as an [Array] of rows.
Each row is a [Dictionary], and the keys are the names of the columns.
</description>
</method>
<method name="fetch_assoc_with_args">
<return type="Array">
</return>
<argument index="0" name="statement" type="String">
</argument>
<argument index="1" name="args" type="Array">
</argument>
<description>
Returns the result of [code]statement[/code] as an [Array] of rows, substituting each [code]?[/code] with [code]args[/code].
Each row is a [Dictionary], and the keys are the names of the columns.
</description>
</method>
<method name="open">
<return type="bool">
</return>
<argument index="0" name="path" type="String">
</argument>
<description>
Opens the database file at the given path. Returns [code]true[/code] if the database was successfully opened, [code]false[/code] otherwise.
If the path starts with "res://", it will use [method open_buffered] implicitly.
</description>
</method>
<method name="open_buffered">
<return type="bool">
</return>
<argument index="0" name="path" type="String">
</argument>
<argument index="1" name="buffers" type="PackedByteArray">
</argument>
<argument index="2" name="size" type="int">
</argument>
<description>
Opens a temporary database with the data in [code]buffer[/code]. Used for opening databases stored in res:// or compressed databases. Returns [code]true[/code] if the database was opened successfully.
Can be written to, but the changes are NOT saved!
</description>
</method>
<method name="query">
<return type="bool">
</return>
<argument index="0" name="statement" type="String">
</argument>
<description>
Queries the database with the given SQL statement. Returns [code]true[/code] if no errors occurred.
</description>
</method>
<method name="query_with_args">
<return type="bool">
</return>
<argument index="0" name="statement" type="String">
</argument>
<argument index="1" name="args" type="Array">
</argument>
<description>
Queries the database with the given SQL statement, replacing any [code]?[/code] with arguments supplied by [code]args[/code]. Returns [code]true[/code] if no errors occurred.
</description>
</method>
</methods>
<constants>
</constants>
</class>