Godot SQLite
Godot SQLite is a GDNative wrapper that provides SQLite3 database support within Godot 4.x (and 3.x in a separate branch) projects. It simplifies data management by enabling direct SQLite database interactions without complex build configurations.
https://github.com/2shady4u/godot-sqlitePreview Images


Godot SQLite: Seamless SQLite Integration for Godot Engine
Godot SQLite is a GDNative plugin designed to bring the power of SQLite databases directly into your Godot Engine projects. This plugin acts as a custom wrapper, abstracting the complexities of SQLite3 and making it easily accessible via GDScript or C#. With Godot SQLite, you can efficiently manage structured data, implement persistent game states, and create data-driven game designs.
Key Features
- Easy Installation: Install via the Asset Library or manual download, no recompilation of Godot required.
- Cross-Platform Compatibility: Supports macOS, Linux, Windows, Android, iOS, and HTML5.
- GDScript API: Offers a comprehensive GDScript API for database operations, including opening/closing connections, executing queries, creating/dropping tables, and managing rows.
- Parameter Bindings: Includes support for parameter bindings to prevent SQL injection vulnerabilities.
- JSON Import/Export: Allows importing and exporting database structures and content to and from JSON files.
- Extension Loading: Supports loading SQLite extensions like the FTS5 Extension (requires recompilation).
- Backup and Restore: Provides methods to back up and restore databases, facilitating saving/loading mechanics.
How to Use Godot SQLite
Using Godot SQLite involves a few simple steps:
- Installation: Install the plugin from the Asset Library or manually copy the necessary files.
- Activation: Activate the plugin in the Project Settings.
-
Database Connection: Open a database connection using
open_db()
and specify the database path. -
Execute Queries: Use
query()
orquery_with_bindings()
to execute SQL queries. -
Manage Data: Utilize functions like
create_table()
,insert_row()
,update_rows()
, anddelete_rows()
to manage database data. -
Close Connection: Close the database connection using
close_db()
when finished.
Godot SQLite simplifies database management in Godot, making it an ideal choice for projects that require structured data storage and retrieval.