Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

solinari6

macrumors regular
Original poster
Aug 13, 2008
101
16
So, this is kind of an extension of this thread

I had an old app that was basically a weird play on boggle, and I was using a 3rd party library to do the "does this word exist?" check. The library had an *.a file in it, that I can't use to build a Mac app. (I need the source code for that to recompile it, but the guy who wrote that 3rd party lib is no longer around) so I have to find another solution.

That lib was basically an Objective C wrapper into the wordnet database, so I've been looking for open source alternatives. I've found SQLite: SQLite.swift (a lib to open sql databases in swift)

I've tried following the docs, and any examples I can find, but I just can't get it to work. Every time I try to open the database, it just opens an empty database instead (sounds like that is the default on open() if it can't find the database, it creates it)

It MIGHT have something to do with me adding the sql database in the wrong spot in the navigator. I'm not exactly sure where I'm supposed to drag/drop that thing.

There's also this interface called Realm that looks like it might be promising, but I'm not sure.

I guess just looking for any advice on this ...If you had to open a local SQL database in swift, how would you do it? Seems like it should be a fairly easy thing to do, just need to open the database, then query the word table to see if a word exists... but I think I've been out of the programming game for a while, and I'm a bit rusty on this stuff :(
 
I don’t know why I was curious about this question but their FAQ states that the ‘database’ is simply a collection of eight ASCII format files. So, it is not hosted in a database package such as SQLite or MySQL, or any number of other database products.

Go read the first FAQ under the Database heading. Looks like you’ll have to build your own interface unless you can find an open source project.
 
I don’t know why I was curious about this question but their FAQ states that the ‘database’ is simply a collection of eight ASCII format files. So, it is not hosted in a database package such as SQLite or MySQL, or any number of other database products.

Go read the first FAQ under the Database heading. Looks like you’ll have to build your own interface unless you can find an open source project.
Actually, someone already put the whole database into actual SQL databases, which I downloaded here:
sorry, should have mentioned that in the first post! :) I've opened this database with a MacSQL client (razorSQL) so I can verify it's a valid SQL database.
 
Last edited:
yeah, those are actually the ones I've been trying to follow with no luck. ... they seem to be creating new databases, and then adding tables and things. When I try to open the existing database, it just creates an empty database instead, which is why I'm thinking that maybe I'm not adding the db to the project correctly, or maybe I need to qualify a path to it or something on the "open" call
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.