I’ve got this app I originally started several years ago and at that time Xojo used the REALSQLDatabase which generated a file with the .rsd extension. I want to update it all the way around and I’ve simply change the extension to .sqlite. Any known adverse consequences of this brilliant move?
None. actually you can use ANY extension on an SQLIte database you wish… the DB Engine will validate it upon open.
I usually change mine to “.DB” and my apps work just fine.
NIce, thanks. The docs use the .sqlite so I thought I’d do the same. Nice to know I can use whatever I choose.
I usually define a application specific file extension, so a user can open its sqlite database into the application, just by doubleclicking it. Therefor I define a UTI by following the procedure described here:
And then I add code to the App.OpenDocument event handler.
Very interesting. I’ve been curious about whether I could have one app but different db’s with different names that could be opened by the app. Perhaps this is a solution?
As Dave wrote: as long as the file is a valid Sqlite database, you can open it with a xojo app, no matter what extension it has.
However, if you would like to associate one or several custom file extensions, then one option is to follow the procedure as Sam Rowlands has described it in the above link.
Association means, that your app will be launched when the user doubleclicks a file with the extension you have defined. You would still have to handle the item parameter in the App.OpenDocument handler.
If you associate several extensions with one app, then this would be the place to handle those different filetypes and assign specific logic to each type.