[Gambas-user] sqlite database inside an executable
Randall Morgan
rmorgan62 at ...626...
Wed May 30 01:19:59 CEST 2012
As I understand Sqlite, the database is file based, and the file path can
be passed to the open/connect method. So what is to keep you from putting
the db file in the data directory of the application? I'll admit I have not
used Sqlite in four or five years. I mostly use MySQL and MS SQL. Which are
server base. But I know that I have seen python apps include the Sqlite db
file in their package and simply kept it in the application's folder.
On Tue, May 29, 2012 at 4:05 PM, Bruce <bbruen at ...2308...> wrote:
> On Tue, 2012-05-29 at 12:17 -0700, Randall Morgan wrote:
> > Can you explain in a little more detail what you want to do?
> >
> >
> >
> > On Mon, May 28, 2012 at 10:43 PM, Bruce <bbruen at ...2308...> wrote:
> >
> > > Is there any way to access (read-only of course) an sqlite database
> > > inside the gambas executable?
> > >
> > > Strange idea I know, but I've got this "really good idea".
> > >
> > > Bruce
> OK.
> I have a little project that lets us create and edit help sets, that is
> html pages and resources that make up the set of help required for our
> apps. It has a help viewer library that uses the same approach as the
> gambas IDE help i.e. a treeview and a webframe that can be used by the
> apps in the hands of the end user. The main difference is that the help
> set resides on the user machine not on the internet. The help set is
> kept in an sqlite database file, one per app. All this works nicely
> until we get to the point of distributing the apps to our clients.
>
> At the moment the help database has to be installed separately to the
> application install (we use autotools packaging and it doesn't provide
> the "Extra Files" capability of the other packagers).
>
> The "really good idea" was that if the database was inside the compiled
> executable and the helpviewer could access it (in read only mode, as
> that is all that is required) then a) the distribution problem is solved
> and b) there is no need to manage some other shared directory, like
> "/var/local/share/phhelp/" and all the associated problems of separate
> distribution like "not found", multiple versions etc etc.
>
> The only other answers I have thought up are
> a) extract the database out of the executable into a user tmp space
> every time the app is opened. This seems a bit wasteful and there may
> be problems where more than one copy of the app is opened.
> b) have some sort of application initialisation code that would extract
> the database to a shared directory the first time the app is used. I
> have some code that did this for a large gb2 project that checked for
> the existence of a postgresql database and if it could not find it it
> created it. This was very messy and needed lots of elevated privileges
> and never worked quite successfully without manual intervention. Even
> though in this case the needs are a lot simpler, the sheer thought of
> having to recreate that gb2 initialisation thing and go through the
> privilege elevation problems for n different distros is not attractive.
>
> So I had this little "really good idea"...
>
> Bruce
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?
More information about the User
mailing list