* * *

Author Topic: Go on with Lazarus for database app or not?  (Read 1612 times)

JJTTBB

  • Newbie
  • Posts: 3
Go on with Lazarus for database app or not?
« on: February 24, 2018, 10:07:07 am »
Hello to everyone, this is my first post and I am really happy to see that Pascal still exists... I was using Turbo Pascal just for hobby back in 90's and I loved it!
Of course these days everything is different and Databases are a good way to keep your data about customers, projects etc... and there are many database management software out there.

There is also Filemaker, Radbuilder (Longtion Software) etc... the Database RAD applications that are similar to Lazarus or Visual Studio for databases.
However, most of them are expensive and the others have limited capabilities.

I was wondering if Lazarus is good for Database apps... I see that there are the necessary components, for handling databases, SQL queries and reports but I would like to hear from people with some experience in database handling with Lazarus.

- Should I try and remember (or better start from the begining) with Pascal or try with a Database RAD like the once I mentioned?

- If I avoid databases at least for the begining... Is file/record handling and reporting easy to handle with good results?

Thank you in advance for your answer


Thaddy

  • Hero Member
  • *****
  • Posts: 6130
Re: Go on with Lazarus for database app or not?
« Reply #1 on: February 24, 2018, 11:08:28 am »
Lazarus is excellent for database applications (even better than Delphi) and supports many, many back-ends: custom, MySql, Sqlite, Paradox, dBase, CSV, SDF, Json, XML, MariaDb, Oracle, PostGress, MsSQL even ODBC .... and many more.
I consider both Delphi and Lazarus much better than your other examples. Because of more natively supported standards and ease of use. And it supports more platforms, often with the same code Linux, Windows, Mac, Android, BSD's
« Last Edit: February 24, 2018, 11:12:25 am by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969

JJTTBB

  • Newbie
  • Posts: 3
Re: Go on with Lazarus for database app or not?
« Reply #2 on: February 24, 2018, 11:23:44 am »
Thank you!
So, I guess I have to start reading!


Handoko

  • Hero Member
  • *****
  • Posts: 2305
  • My goal: build my own game engine using Lazarus
Re: Go on with Lazarus for database app or not?
« Reply #3 on: February 24, 2018, 12:58:39 pm »
Lazarus supports wide range of databases, just pick the one suits your need:
http://wiki.freepascal.org/Databases

If I avoid databases at least for the begining... Is file/record handling and reporting easy to handle with good results?

Nothing wrong using file's record handling, I use it and I even wrote my own module for it to ease my programming. But for medium to large projects, performance is important and/or multiusers programs, you need to consider 'better' options.

For small and single user program, dBase should be enough. It is easy to learn and deploy:
http://wiki.freepascal.org/Lazarus_Tdbf_Tutorial

valdir.marcos

  • Sr. Member
  • ****
  • Posts: 379
Re: Go on with Lazarus for database app or not?
« Reply #4 on: February 24, 2018, 05:37:35 pm »
@JJTTBB

As Thaddy and Handoko have well explained, you're in the right place.

I do consulting helping teams to migrate systems in [Delphi, Visual Basic, Java, Clipper, etc] + [Oracle, MS-SqL Server, Sybase, PostDrive, MariaDb, MySQL, SQLite, Paradox, dBase, etc] into Lazarus or PHP using Firebird as back end.
https://www.firebirdsql.org/en/documentation/
https://www.firebirdsql.org/en/server-packages/
https://www.firebirdsql.org/en/support/

Start by searching information about these various database management systems.
Take a special look at Relational DataBase Management System (RDBMS):
https://en.wikipedia.org/wiki/Relational_database_management_system
https://www.tutorialspoint.com/sql/sql-rdbms-concepts.htm
https://www.tutorialspoint.com/sql/index.htm
http://database.guide/what-is-an-rdbms/

Then, see how to integrate Lazarus with several databases at:
http://wiki.freepascal.org/Databases
http://wiki.freepascal.org/SqlDBHowto
http://wiki.freepascal.org/Working_With_TSQLQuery
http://wiki.freepascal.org/Lazarus_Database_Overview
http://wiki.freepascal.org/SQLdb_Tutorial0
http://wiki.freepascal.org/SQLdb_Tutorial1
http://wiki.freepascal.org/SQLdb_Tutorial2
http://wiki.freepascal.org/SQLdb_Tutorial3
http://wiki.freepascal.org/SQLdb_Tutorial4
http://wiki.freepascal.org/SQLdb_Programming_Reference

Make your own tests to see which one suits you best.
Whatever your choice, the people here at the forum are very participative and always try to help.

tudi_x

  • Sr. Member
  • ****
  • Posts: 452
Re: Go on with Lazarus for database app or not?
« Reply #5 on: February 24, 2018, 06:15:02 pm »
easier than file handling would be cockroach DB.
you can use the PostgreSQL driver to connect to it.
only one binary to deploy. the easiest to deploy RDBMS.

https://www.cockroachlabs.com/product/cockroachdb/

JJTTBB

  • Newbie
  • Posts: 3
Re: Go on with Lazarus for database app or not?
« Reply #6 on: February 24, 2018, 09:55:30 pm »
Thank you all for your well explained answers...

edwinyzh

  • New member
  • *
  • Posts: 30
Re: Go on with Lazarus for database app or not?
« Reply #7 on: April 23, 2018, 12:09:23 pm »
I'd suggest the mORMot framework (https://github.com/synopse/mORMot) if you are just starting out, you'll have a high performance ORM for simple writing/reading of the database records, while you can use any complex SQL to more complex things.

It's not just an ORM though, there are over 30 samples (https://github.com/synopse/mORMot/tree/master/SQLite3/Samples) to help you get started, the project has been being actively developed for many years and the author it has a very active forum.

I've been using it successfully in several projects and it's highly recommended.

Trenatos

  • Sr. Member
  • ****
  • Posts: 330
  • Software developer - Open source contributor
Re: Go on with Lazarus for database app or not?
« Reply #8 on: April 23, 2018, 03:30:33 pm »
Every time I try to use databases with Lazarus/FPC, I run into lots and lots of issues.

From drivers to cross platform compatibility.

It still boggles my mind that there are no bundled or auto-download drivers for the built-in database libraries.

That said, when you do get it working it works nicely.

Leledumbo

  • Hero Member
  • *****
  • Posts: 7906
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Go on with Lazarus for database app or not?
« Reply #9 on: April 24, 2018, 04:09:15 pm »
I guess almost everyone that uses Lazarus for business uses it for database centric apps, especially those coming from Delphi. So yeah, it's good for what its sister is good for. There are multiple approaches today, however. One that fits RAD paradigm (which Lazarus supports very well), one that may fit traditional MVC (which is half supported and may not be so obvious if you're not used to the term) and more including those which haven't been invented or announced to public yet. mORMot approach is more traditional MVC and other than its ORM the framework is geared more toward web applications and quite a bit more complex. Learning curve is high, but once you get it, building a database centric web app will be a no brainer.

snorkel

  • Hero Member
  • *****
  • Posts: 765
Re: Go on with Lazarus for database app or not?
« Reply #10 on: May 11, 2018, 06:00:10 pm »
It's the best for Database development :-)
combine it with PostgreSQL for enterprise class and SQLite for embedded.

You would be surprised on how robust SQLite is if you use it in journal mode and use the shared memory interface (don't use it from a network share)
you can even network enable it by using Zeoslib components and streaming the query component and it's params to a server and execute the queries remotely.
For result sets you can use the memdataset components to save result sets to streams and pass those around the network as well.

For a small price you can also use third party db components from Devart and they have integrated the DB network protocols right into the components so you don't even need any client DLLs etc to deploy with your app.  They have postgresql and Mysql components that have this ability.
***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 1.8 and FPC 3.0.4
OS: Windows 10 64 bit

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus