Recent

Author Topic: What is the Best "Stand Alone" Database for lazarus  (Read 19538 times)

kapibara

  • Hero Member
  • *****
  • Posts: 656
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #15 on: July 07, 2016, 12:35:48 pm »
@Thaddy Many apps using sqlite seem to put sqlite.dll in their program directory, probably to be sure the right version is always available. Isn't there a risk that your program stops working if you rely on a systemic sqlite.dll?
Lazarus trunk / fpc 3.2.2 / Kubuntu 24.04 - 64 bit

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1226
    • Burdjia
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #16 on: July 07, 2016, 06:02:30 pm »
Windows isn't Linux.

On Linux (may be because its part of the POSIX definition, so may be UNIX too) there's a convention that allows to install various versions of the same library by adding the version id to the library name; and using links you can define different levels of compatibility (i.e liballeg.so.4, liballeg.so.4.4 and liballeg.so.4.4.2 are actually the same library, and your application may use one or another depending of its tolerance to changes, so my Allegro.pas library uses liballeg.so.4.4 by default).

Windows doesn't has that convention so many developers decided to put the DLL files in the same directory than the application.  Fortunatelly, several developers have adopted the Linux way and added the version number to the DLL name.  For example SQLite library includes such number, but only the major number (sqlite3.dll).  Allegro includes two numbers (alleg44.dll/ allegro-5.2.dll).
« Last Edit: July 07, 2016, 06:06:00 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Thaddy

  • Hero Member
  • *****
  • Posts: 18961
  • Glad to be alive.
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #17 on: July 13, 2016, 01:50:49 pm »
@Thaddy Many apps using sqlite seem to put sqlite.dll in their program directory, probably to be sure the right version is always available. Isn't there a risk that your program stops working if you rely on a systemic sqlite.dll?
Windows programmers that work outside of Microsoft(as a company, inside)  itself tend to be not as carefull about reading specifications! as is required.
E.g. When windows 7 was introduced and enforced it broke a good many of applications.... And rightly so. Not MS fault, they documented that for years and years and years....
 Stupid developers. (including tooling companies that developed the tools.)

The correct answer is and always has been in the case of Windows: put your shared library somewhere under the windows directory, preferably in system32 or a sub.
And put writable data under users, not under ... well, too lazy to explain stupidity again....
« Last Edit: July 13, 2016, 01:56:16 pm by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

Graeme

  • Hero Member
  • *****
  • Posts: 1518
    • Graeme on the web
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #18 on: July 13, 2016, 05:14:31 pm »
Define "Stand Alone" (MySQL can be regarded standalone as it doesn't have 3rd party dependency...
That choice would definitely fail the "best" criteria. Here are my reasons.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

Graeme

  • Hero Member
  • *****
  • Posts: 1518
    • Graeme on the web
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #19 on: July 13, 2016, 05:17:44 pm »
Whatever you decide, avoid MS SQL with Lazarus (FPC).
Strange, I had no problems with a FPC based application talking to a MS SQL Server database. Either way, MS SQL Server would definitely not fit the original poster's criteria of "stand alone" (as in embedded).
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #20 on: July 13, 2016, 07:01:20 pm »
On windows I almost always put any DLLs I need in the application directory.  Windows first looks in the exe location for dlls, then the system folders.
I started doing this because the copies that where in the system folders for things like open SSL where always out of date and in a corp environment it was a pain to get them updated.  Obviously if a user is installing your app with a setup program they might not have the rights to install DLLS in program files along with the exe.
 

SQLite is a really good choice for an embedded database and you can statically link the C obj files I think( I know it could be done on Delphi for sure)
SQLite also has a WAL mode that can give pretty good concurrency.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

tatamata

  • Hero Member
  • *****
  • Posts: 804
    • ZMSQL - SQL enhanced in-memory database
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #21 on: July 20, 2016, 03:54:38 pm »
You could also try ZMSQL.
ZMSQL has no external dependencies and is pure Pascal database (https://sourceforge.net/projects/lazarus-ccr/files/zmsql/).
It is included in CodeTyphon Lazarus distribution by default (see http://www.pilotlogic.com/sitejoom/index.php).

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #22 on: July 20, 2016, 07:00:57 pm »
Looking for a Database that run inside the program and does not depend on a server or client software running.

Where the user, or my install program, does not have to have to install any other software, Mysql, Firebird, etc.

Light weight, few users or one user.

This is what I define as "Stand Alone".

I am coming back to Pascal after many years of being away from programming, so I am trying to get caught up, and find out what is in Lazarus?

Unless you are absolutely certain that you'll never have more than one user at a time, I would suggest biting the bullet & using Firebird Embedded. That way if in the future you need to move to multiple users, all you'll need to do is install the server version of Firebird & your app will continue to run normally. User needs evolve, plan for multiple users especially where databases are concerned.

JD
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

Thaddy

  • Hero Member
  • *****
  • Posts: 18961
  • Glad to be alive.
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #23 on: July 20, 2016, 08:18:03 pm »
@Thaddy Many apps using sqlite seem to put sqlite.dll in their program directory, probably to be sure the right version is always available. Isn't there a risk that your program stops working if you rely on a systemic sqlite.dll?
Well. That's not where  shared libraries belong and a dll is a shared library as per design and specification and not a moronic way to let your executable look smaller.......

That's developer stupidity.

Hence I often choose to link  Sqlite statically! Solved. ;)
(Some wtf and shouting involved when writing this)  >:D 

It is over 40 degrees C in my garden. So it is provocative by default for lack of ice cubes.
« Last Edit: July 20, 2016, 08:25:54 pm by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

kapibara

  • Hero Member
  • *****
  • Posts: 656
Re: What is the Best "Stand Alone" Database for lazarus
« Reply #24 on: July 21, 2016, 03:41:00 am »
As long as you take responsibility for the right lib is available, do what you find best. Beside that, the DLL is just like people, its is what it does.  ::)
Lazarus trunk / fpc 3.2.2 / Kubuntu 24.04 - 64 bit

 

TinyPortal © 2005-2018