godot-sqlite: Planned incompatible API changes for Godot 4.0

I’ve been working on the GDExtension port of this plugin on a separate branch which can be found here

This issue aims to serve as a compiled list of all planned changes that will (possibly) break backwards compatibility:

  • Implementation of #60 as duplicating the query_result yourself is a hassle in most cases and not clear for beginners. However, the extent to which this is to be implemented is still to be straightened out…

Other issues that are to be fixed and will be back-ported:

  • Better verbose control as discussed in #73 with multiple levels of verbosity for debugging and release purposes.
  • Support for multi-statements as discussed in #58, which requires the implementation of proper rollback behavior.

How to test the latest Godot 4.0 version of this plugin?

  1. Checkout the latest “gd-extension”-branch on your device.
  2. Get the binaries and place them in the bin/-folder of the demo-project. This can be done by either:
  • Going to Github Actions (as found here) and downloading the latest binaries that corresponds to your desired platform(s).
  • Compiling the plugin yourself by following the instructions as found here.
  1. Open the demo-project using the latest Godot 4 alpha executable and start the demo-project

How to port my Godot 3.x project to Godot 4.0?

Differences between the API can be easily analyzed by comparing the demo-project’s differences between versions: Godot 3.x: https://github.com/2shady4u/godot-sqlite/blob/master/demo/database.gd Godot 4.0: https://github.com/2shady4u/godot-sqlite/blob/gd-extension/demo/database.gd

In summary:

  • The SQLite plugin doesn’t have to be preloaded any longer. As a result, following lines of code:
const SQLite = preload("res://addons/godot-sqlite/bin/gdsqlite.gdns")
var db

func ready():
    db = SQLite.new()

has to be replaced by:

var db

func ready():
    db = SQLite.new()
  • The verbose_mode-property has been removed in favor of the verbosity_level-property. As a result, following lines of code:
func ready():
    db = SQLite.new()
    db.verbose_mode = True

has to be replaced by:

func ready():
    db = SQLite.new()
    db.verbosity_level = SQLite.VERBOSE

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26 (9 by maintainers)

Most upvoted comments

Hi @git2013vb

I’ve added a brand-new section to the OP. I hope it is sufficient to port your project to Godot 4.0 😄

Support for Web builds has now been added in the latest release, but it seems like it is still quite unstable (on the side of Godot).

@2shady4u tacking on here as it seems to relate, but I can open another issue if you’d prefer. I haven’t been able to find any other reference to issues reporting a lack of Web export for the new GDExtension.

Readme.md doesn’t list the Web under supported operating systems, but it does mention the web builds in the “How to Export” section.

Is this a planned feature to be implemented, a breaking compatibility change, or a bug?

* edit: Found the reference in the release notes:

Support for HTML5 isn’t supported as it hasn’t been implemented yet in GDExtension.

https://github.com/2shady4u/godot-sqlite/releases

For anyone else getting “No suitable library found for GDExtension: res://addons/godot-sqlite/gdsqlite.gdextension.” while attempting to export on Android, the fix is opening the .gdextension file in a text editor and adding the following lines:

below [libraries]:

android.arm64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_debug.arm64.so"
android.template_release.arm64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_release.arm64.so"
android.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_debug.x86_64.so"
android.template_release.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_release.x86_64.so"

below [dependencies]:

android.arm64 = {}
android.template_release.arm64 = {}
android.x86_64 = {}
android.template_release.x86_64 = {}

Well, that got me 1 step closer, thanks! Any suggestions on the next error while trying to explore to android?

 platform/android/export/export_plugin.cpp:744 - Cannot determine architecture for library "res://addons/godot-sqlite/bin/libgdsqlite.android.template_debug.arm64.so". One of the supported architectures must be used as a tag: arm32 arm64 x86_32 x86_64
  editor/export/editor_export_platform.h:173 - Export: Could not export project files.

I downloaded the demo (from here https://github.com/2shady4u/godot-sqlite/tree/gd-extension) and I tried to run it - I use Debian 11 and v4.0.beta8.official [45cac42c0] - But I have this error: image

So when I try to run the demo he cannot recognise SQLite

Ops. I noticed the demo do not have any binary 😃 I try using the one from 4.beta7… I think it will work right?

Finally it work. I checked the correct path and the correct library name (debug version for now) Do you have an ETA about when it will be in godot plugin website? I think it will be on sync with current version 😃

Thanks a lot.

You are wonderful, hard-working people - I’ve managed to get it to work without any issues. The key is to place the bin folder inside the addons/godot-sqlite folder and to download the latest artifacts from an action that ran on the gd-extentions branch. It is obvious, but not as explicit as it would have to be.

Let me know where I can donate to buy you a beer.

Alpha 7:

ERROR: Condition "!method" is true. Returning: 0
   at: get_builtin_method_hash (core/variant/variant_call.cpp:1172)
ERROR: Error getting method , hash mismatch.
   at: gdnative_variant_get_ptr_builtin_method (core/extension/gdnative_interface.cpp:475)

godot-cpp from master: https://github.com/KirillSerogodsky/godot-sqlite/actions/runs/2241829670

Hey @KirillSerogodsky !

I’ve synced the godot-cpp submodule to the correct commit for alpha 7! Everything should hopefully work again 🤞

Thank you so much! Got the demo to work 😃

One note to anyone else who might be interested. You need to open the gdsqlite.gdextension file and change the name from: libgdsqlite.windows.debug.64.dll to libgdsqlite.windows.release.64.dll under the [libraries] section.