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-sqlite

Preview Images

Preview
Preview

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:

  1. Installation: Install the plugin from the Asset Library or manually copy the necessary files.
  2. Activation: Activate the plugin in the Project Settings.
  3. Database Connection: Open a database connection using open_db() and specify the database path.
  4. Execute Queries: Use query() or query_with_bindings() to execute SQL queries.
  5. Manage Data: Utilize functions like create_table(), insert_row(), update_rows(), and delete_rows() to manage database data.
  6. 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.

Resource Details

library

2shady4u



4.x, 3.x