SQLdeLite Open Sourced!

We have open sourced our SQLdeLite components. Rapidly accelerate your Xojo application development! One line queries with automatic prepared statements, type mappings, etc. for SQLite and cubeSQL. Get it here: https://github.com/1701software/SQLdeLite

Check out our initial forum post about our design goals here: https://forum.xojo.com/11694-testers-needed-sqldelite

MySQL is almost done along with some nice documentation. Enjoy!

In the Window1 openEvent handler you have the following:

I’m not seeing that it’s doing anything since there isn’t an ID of 5.

Am I missing something?

In that same vein the subsequent code runs but there’s no discernible output.

Hey Joseph,

A record with an ID of 5 hasn’t been added yet. If you run the app again it will add 3 new records and then ID 5 will be updated according to the query. It’s demonstrating how to easily execute commands.

Ok, thanks Phillip. Just making sure I wasn’t missing anything.

Am I wrong in thinking that this code:

Should change the value of 7 to “Awesome”

So that particular example is showing you how you can skip the properties cache and select the SQLtypes directly.

That query won’t update anything however because ID 7’s ‘Name’ field is ‘Double Test’ and the query is matching ‘Name’ on ‘DatabaseVersion’.

So change the ‘Name’ binding from ‘DatabaseVersion’ to ‘Double Test’ and the ‘Value’ property will get changed to ‘Awesome’.

You could just as easily write that query as:

setting4.execute(“update setting set name = #?#, value = #value# where id = #?# and name = #?#”, “Phillip”, 7, “Double Test”)

You only have to pass in 3 parameters because #value# uses the .Value property of ‘setting4’.

Also keep in mind you don’t have to map classes for it to be useful. You could just use the db object directly.

Window1.db.SQLdeLiteExecute(“UPDATE Users SET Name = #?#”, “Phillip Zedalis”)

What line would this update?

Window1.db.SQLdeLiteExecute("UPDATE Users SET Name = #?#", "Phillip Zedalis")

I’m not understanding how it’s being used. I copy and pasted it into the open event just to watch and it threw an error.

Just showing you an example query without the manual SQLITE_TYPE bindings for a hypothetical Users table.