Up to date

This page is up to date for Blazium 0.4.90 (4.3). If you still find outdated information, please open an issue.

SQLiteAccess๏ƒ

Inherits: RefCounted < Object

Wrapper class for SQLite databases.

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 *_with_args, as these protect against SQL injection.

Methods๏ƒ

bool

backup(path: String)

bool

close()

SQLiteQuery

create_query(statement: String, arguments: Array = [])

int

get_last_error_code() const

String

get_last_error_message() const

bool

open(database: String)

bool

open_buffered(path: String, buffers: PackedByteArray, size: int)

bool

open_in_memory()


Method Descriptions๏ƒ

bool backup(path: String) ๐Ÿ”—

Creates a backup of the database at the given path.


bool close() ๐Ÿ”—

Closes the database handle.


SQLiteQuery create_query(statement: String, arguments: Array = []) ๐Ÿ”—

Creates a new query object.


int get_last_error_code() const ๐Ÿ”—

Gets the last error code.


String get_last_error_message() const ๐Ÿ”—

Gets the last error message.


bool open(database: String) ๐Ÿ”—

Opens the database file at the given path. Returns true if the database was successfully opened, false otherwise.

If the path starts with "res://", it will use open_buffered implicitly.


bool open_buffered(path: String, buffers: PackedByteArray, size: int) ๐Ÿ”—

Opens a temporary database with the data in buffer. Used for opening databases stored in res:// or compressed databases. Returns true if the database was opened successfully.

Can be written to, but the changes are NOT saved!


bool open_in_memory() ๐Ÿ”—

Opens an in-memory database.