MBS SQLite Extension (for IOS)

I have been looking at the MBS SQLite Extension. It has some functions that might be very useful for me. Like distance, string differences, etc.

As far as I can see, this extensions library is not included in the Complete Plugins license.
But, I would like to know if this extension works with iOS.
(And maybe in the future for Android, once I convert some of my iOS apps to Android)

Also, i wonder if this extension works with InMemory databases. That way, some of these functions could be used without actually using a database, but purely return values with a SQL statement…
Something like this: (with coordinates from the MBS example)

// Coordinates for New York
Var lat1 As Double = 40.712778
Var long1 As Double = -74.005833

// Coordinates for Berlin
Var lat2 As Double = 52.518611
Var long2 As Double = 13.408333

// Call the GeoDistanceMBS function
Var rs As RowSet
rs = db.SelectSQL("Select GeoDistanceMBS(?, ?, ?, ?)", lat1, long1, lat2, long2)

// The first column holds the distance in kilometers (I think)
Var distanceKM As Double
distanceKM = rs.ColumnAt(0).DoubleValue

Does anybody have experience with this extension?

From what I can see in the MBS website, it is targeted to Desktop (Mac, Windows and Linux).

So no Mobile.

@Christian_Schmitz
Are there plans to extend this extension for mobile targets?
(Preferably iOS)

Well, possible probably.

What functions would you want to use within the SQLite SQL queries?

For next plugin release we will have SQLite functions in Xojo with our SQLiteFunctionMBS class. So you could define them in Xojo.

1 Like

That SQLiteFunctionMBS class sounds awesome!

The functions in the SQLite Extensions I’m interested in are:

  • GeoDistanceMBS
  • RemoveAccentsMBS
  • JaroWinklerDistanceMBS
    (or LevenshteinDistanceMBS, I’ll have to see what works best for me)
  • UUIDHexMBS
    (since SQLite has no build-in UUID, which I use for record IDs)
  • MD5MBS
    (just to create quick simple hashes on data automatically, using triggers)

Some of the features, like JaroWinklerDistanceMBS, I would just use to for it’s functionality, by calling db.SelectSQL
Not to use it on tables, necessarily.

It would make sense to have extensions compatible with mobile targets, I think.
But that SQLiteFunctionMBS class could be very helpful, I think.

JaroWinklerDistanceMBS, LevenshteinDistanceMBS and RemoveAccentsMBS are already in the plugins, so no need to go through SQL there.

And UUID can be generated and put into a field on insert.

I guess I have not looked good enough. I should have used the Google Search field on your website. :face_with_peeking_eye:

You mean, generated in the app, and inserted in the database with a INSERT INTO myTable… statement?
That is actually what I do now.

But, I want to generate UUIDs within triggers. I use that in a Log Table, where I keep track of inserted, updated or deleted records. Each row in that table would have an UUID as record ID. But SQLite needs to be able to generate reliable UUIDs. Hence, the need of the UUID function in your extensions library. :nerd_face: