UTF8String

ok. was not aware of sqlite.fx… will play with that. Any sample code working with SQLite ?

It’s the exact same api as you are using here, except that it’s linked in instead of used as dll.
I don’t think we have an Island specific sample, but there is one for Toffee that uses these apis:
C:\Users\Public\Documents\RemObjects Samples\RemObjects Oxygene for Cocoa\UIKit\SqliteApp

  var lDatabase: ^sqlite3 := nil;
  if sqlite3_open('path' , @lDatabase) = SQLITE_OK then begin
    var lStatement: ^sqlite3_stmt;
    if sqlite3_prepare_v2(lDatabase, 'select * from Customers', -1, @lStatement, nil) = SQLITE_OK then begin
      while sqlite3_step(lStatement) = SQLITE_ROW do begin

        var lName := ^AnsiChar(sqlite3_column_text(lStatement, 1));
        writeLn(String.FromPAnsiChar(lName));
      end;

    end;
    sqlite3_close(lDatabase);
  end;

Check out https://github.com/remobjects/ElementsSQLite, which currently;y covers Cocoa and .NET. make you feel like expanding it to cover Island and submit a pull request?

I’d be happy to have a crack at it. A little confused as to where this fits in with Carlo’s suggestion (linked as opposed to loading the DLL as per Marc and what I was attempting to do.

Carlo’s is in Elements which is for Island only but ElementsSQLite is not ?

bugs://82664 got closed with status fixed.

this: https://github.com/remobjects/IslandRTL/commit/ec6d67f50f1ad0fe8d29339e3f175bcdd76bfe7b

should let you do what you want (the original request here, sqlite3_open(UTF8String(somestring))

ElementsSQLite is a wrapper around:

  • Android’s built in sqlite support
  • Globals.pas DllImport from sqlite3.dll (for .NET)

Adding sqlite3 fx support should be easy because the apis will be exactly the same.

1 Like

lol… you beat me… Awesome, thanks