What is the Best "Stand Alone" Database for lazarus lazarus / 16-Databases ---------------------------------------------------------------------- WTDdallas · 2016-07-05 20:45 What is the Best "Stand Alone" Database for lazarus? ---------------------------------------------------------------------- Leledumbo · 2016-07-05 21:24 Define "Best". Define "Stand Alone" (MySQL can be regarded standalone as it doesn't have 3rd party dependency, so is PostgreSQL, SQL Server, Oracle, Firebird, SQLite and many more). ---------------------------------------------------------------------- JD · 2016-07-06 00:01 I'll take a wild guess & say WTDallas probably means "embedded", no install database. ---------------------------------------------------------------------- WTDdallas · 2016-07-06 02:28 Quote from: JD on July 06, 2016, 02:01:47 amI'll take a wild guess & say WTDallas probably means "embedded", no install database.  Yes Embedded. No SQL Server or such. ---------------------------------------------------------------------- markus_ja · 2016-07-06 05:40 I prefere firebird. Not sure if it is the best, but its free and it is available as embedded and as server. So you can easily switch, when you need server capabilities in the future. http://firebirdsql.org/ ---------------------------------------------------------------------- Thaddy · 2016-07-06 05:45 Frankly there are so many options right out-of-the-box that is really depends on your requirements. There are applications where TBufDataSet simply suffices and is extremely lightweight but has no SQL query capabilities. It does have search, locate and sort, though... Then you have Sqlite, which is pretty much the standard solution for single user or client-side databases and already present on most systems and it supports SQL. Then you have slightly heavier solutions like FireBird which offers things that are not available in SQLite such as advanced locking etc. Then there are the heavyweights like MySql and the super heavyweights like Oracle. There are many more options in the standard distribution, like fpindexer... [edit] So you are spoiled for choice compared to other languages. As Leledumbo asked the same as me: what are your requirements? That is what makes the choice. And then there are solutions like tiOPF and mOrMot that abstract away the underlying database technology (mOrMot does sqlite, mainly) ---------------------------------------------------------------------- Leledumbo · 2016-07-06 07:54 Right, you still haven't defined "Best", so I still can't say which one, though the choice has been narrowed down to: Firebird, SQLite and MySQL. ---------------------------------------------------------------------- WTDdallas · 2016-07-06 11:34 Quote from: Thaddy on July 06, 2016, 07:45:33 amFrankly there are so many options right out-of-the-box that is really depends on your requirements. 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? ---------------------------------------------------------------------- Thaddy · 2016-07-06 11:38 Well, then. Statically link the libs? e.g. sqlite. Problem solved. ---------------------------------------------------------------------- WTDdallas · 2016-07-06 12:09 Quote from: Thaddy on July 06, 2016, 01:38:08 pmWell, then. Statically link the libs? e.g. sqlite. Problem solved. SQlite was not included in the default install? Easy to install. Does it require another program running? client/server running? ---------------------------------------------------------------------- Leledumbo · 2016-07-06 13:13 Quote from: WTDdallas on July 06, 2016, 02:09:44 pmQuote from: Thaddy on July 06, 2016, 01:38:08 pmWell, then. Statically link the libs? e.g. sqlite. Problem solved. SQlite was not included in the default install? Easy to install. Does it require another program running? client/server running? SQLite bindings are. SQLite library is not, install that according to your platform. You better read what SQLite is first before asking further, their documentation is more than excellent to explain how they work. ---------------------------------------------------------------------- Thaddy · 2016-07-06 13:58 Quote from: Leledumbo on July 06, 2016, 03:13:15 pmQuote from: WTDdallas on July 06, 2016, 02:09:44 pmQuote from: Thaddy on July 06, 2016, 01:38:08 pmWell, then. Statically link the libs? e.g. sqlite. Problem solved. SQlite was not included in the default install? Easy to install. Does it require another program running? client/server running? SQLite bindings are. SQLite library is not, install that according to your platform. You better read what SQLite is first before asking further, their documentation is more than excellent to explain how they work. On Debian and the likes it is installed by default, i think. On Windows it is definitely installed when you install e.g. Firefox or Thunderbird or many other industry standards. ---------------------------------------------------------------------- Zath · 2016-07-06 23:31 Whatever you decide, avoid MS SQL with Lazarus (FPC). Lazarus / FPC is the most user unfriendly option if you want to talk to MSSQL databases. You need 3rd party libraries with conflicting info on their required locations and .... I gave up. ---------------------------------------------------------------------- talorigomat · 2016-07-07 06:26 With Firebird embedded and sqlite all you would need to do is include the dll files in the same directory where your application is installed. ---------------------------------------------------------------------- Thaddy · 2016-07-07 08:13 Quote from: talorigomat on July 07, 2016, 08:26:03 amWith Firebird embedded and sqlite all you would need to do is include the dll files in the same directory where your application is installed.   Well, not quite. That is Windows only advice. Furthermore the dll's may already exist where they belong, e.g. \windows\system32 or /usr/lib or /usr/local/lib. If everybody starts putting commonly used dll's or so's  in the appication's directory you are polluting the system and missing the point of shared libraries / dll's. The paths mentioned may include versioned subdirectories ofcourse like /usr/local/lib/fpc/3.1.1/units/arm-linux or something ---------------------------------------------------------------------- fpcoder · 2016-07-07 10:35 @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? ---------------------------------------------------------------------- Ñuño_Martínez · 2016-07-07 16:02 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). ---------------------------------------------------------------------- Thaddy · 2016-07-13 11:50 Quote from: kapibara 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? 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.... ---------------------------------------------------------------------- Graeme · 2016-07-13 15:14 Quote from: Leledumbo on July 05, 2016, 11:24:30 pmDefine "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. ---------------------------------------------------------------------- Graeme · 2016-07-13 15:17 Quote from: Zath on July 07, 2016, 01:31:45 amWhatever 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). ---------------------------------------------------------------------- snorkel · 2016-07-13 17:01 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. ---------------------------------------------------------------------- tatamata · 2016-07-20 13:54 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 · 2016-07-20 17:00 Quote from: WTDdallas on July 06, 2016, 01:34:47 pmLooking 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 ---------------------------------------------------------------------- Thaddy · 2016-07-20 18:18 Quote from: kapibara 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? 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)    It is over 40 degrees C in my garden. So it is provocative by default for lack of ice cubes. ---------------------------------------------------------------------- fpcoder · 2016-07-21 01:41 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.