khairul169 / gdsqlite-native

SQLite module for Godot 3.x
MIT License
219 stars 41 forks source link

Editing Database via SqlLite Studio breaks file, but at the same time doesn't? #32

Closed ddragon15 closed 5 years ago

ddragon15 commented 5 years ago

I'm sure this is not a problem on your side, I just noticed loading the file up in sqllitestudio (3.2.1) didn't let me querry it anymore. On the other hand editing, the item.db in the examples works fine with adding lines or editing values. So i guess the problem lies in the design of my database..

I post this still as an issue as I really have no clue where else to asked that question. At the time i tried almost everything: lowercase names, uppercase names, removing datetime as this could be something the addon doesn't support, only have tables with full values etc.

my code is this one:

func _ready():
    # Create gdsqlite instance
    var db = SQLite.new();
    # Open item database
    db.open_db("res://database.db")
#   db.open_db("res://items.db")

    # Get item list from db
    var player = db.fetch_array("SELECT * FROM player ORDER BY id ASC");
#   var player = db.fetch_array("SELECT * FROM potion ORDER BY id ASC");

    for m in player:
        print(m['id']);

    print(db.close())

as you can see i commented it out so that i can use it with the example database. I even addet a new table to items.db and it still works fine with it, but database.db doesn't. SQLLiteStudio marks both as (SQLLite3) behind the database name.

Edit: