Recent

Author Topic: Database advice needed  (Read 2390 times)

Robert W.B.

  • Sr. Member
  • ****
  • Posts: 328
  • Love my Wife, My Kids and Lazarus/Freepascal.
Database advice needed
« on: March 28, 2022, 05:43:47 pm »
I have to move my sql databases to Lazarus databases and import cvs files to it.
What database in Lazarus, should I create, that is stable, shall I use?

Thanks in advance.
Sincerely
Old Bob  :-[

[Edited to make title meaningful before moving to the Databases forum]
« Last Edit: March 29, 2022, 12:20:28 am by trev »
Rob

MichaelBM

  • New Member
  • *
  • Posts: 38
Re: Urgent. Please, I need an advice...
« Reply #1 on: March 28, 2022, 06:09:31 pm »
This has been working perfectly for me:

http://firebirdsql.org/en/firebird-4-0/
Development Tool: Lazarus 2.0.6 + FPC 3.0.4
Database: Firebird 2.5.7
Operating System: Windows 10 Pro 64-bit

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: Urgent. Please, I need an advice...
« Reply #2 on: March 28, 2022, 06:21:47 pm »
This has been working perfectly for me:
Don't advise FireBird.
Take some mainstream, like MySql, MariaDB, Postgress (or Sqlite for lightweight). FPC supports all f them.
Specialize a type, not a var.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: Urgent. Please, I need an advice...
« Reply #3 on: March 28, 2022, 07:26:51 pm »
This has been working perfectly for me:
Don't advise FireBird.
Take some mainstream, like MySql, MariaDB, Postgress (or Sqlite for lightweight). FPC supports all f them.

Don't consider SQLite if you might need multiple users or even a single user working from a different system. I believe it now has that capability, but it wasn't "designed in".

I believe that MySQL/MariaDB have a somewhat fluid API. They're popular, but from the POV of Lazarus that doesn't confer much of an advantage.

Firebird and PostgreSQL have fairly compatible SQL dialects, and they both have a notification mechanism (supported by an LCL component) which can be extremely useful.

When experimenting with it around five years ago, I found the Firebird documentation to be poor: multiple manuals with version addenda.

I've been using PostgreSQL for 20+ years, so am biased.

So from my biased POV: SQLite for single-user operation, where it has supplanted e.g. Berkeley DB for configuration files and working storage. Postgres for everything else.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

af0815

  • Hero Member
  • *****
  • Posts: 1284
Re: Urgent. Please, I need an advice...
« Reply #4 on: March 28, 2022, 07:59:32 pm »
Without more information, all advices are personal POV.

What is your knowledge about DBs ?
Do you need SQL ?
One or more user/connections ?
How much data ? Forecast in the next 5  years ?
What system?
regards
Andreas

marsupilami79

  • New Member
  • *
  • Posts: 32
Re: Urgent. Please, I need an advice...
« Reply #5 on: March 29, 2022, 02:09:30 pm »
When experimenting with it around five years ago, I found the Firebird documentation to be poor: multiple manuals with version addenda.
This has been changed since. There are now language reference manuals for Firebird 3.0 anf Firebird 4.0.
Zeos developer

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Database advice needed
« Reply #6 on: March 29, 2022, 02:24:53 pm »
I have to move my sql databases to Lazarus databases
Did you consider to keep data in existing database and just use it from Lazarus?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: Database advice needed
« Reply #7 on: March 29, 2022, 02:54:21 pm »
Did you consider to keep data in existing database and just use it from Lazarus?

That is of course a valid point, unless OP is absolutely certain that what he's using is unsupported.

Also I find myself wondering whether he's assuming that the only way to move data between databases is CSV.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Robert W.B.

  • Sr. Member
  • ****
  • Posts: 328
  • Love my Wife, My Kids and Lazarus/Freepascal.
Re: Database advice needed
« Reply #8 on: March 29, 2022, 03:16:18 pm »
Thanks for all the answers.  I should clarify though, understand.  I have a database on my mobile, with all the migraine attacks in records that I have had since 2010. So a single-user database.  A small screen and older eyes, have made me realize, that it is starting to be best to move over my database records, in cvs format (sqlite db android) to my computer.  I have used DBF in Lazarus before but it is very buggy, unfortunately.  Otherwise this would have been enough for me but importing the cvs format, I have no idea if it works.
Old Bob :-[
Rob

af0815

  • Hero Member
  • *****
  • Posts: 1284
Re: Database advice needed
« Reply #9 on: March 29, 2022, 03:21:32 pm »
You can also use sqlite with Lazarus. Because you have done the job before in sqlite.

You can copy your sqlite DB to the PC and look if you are able to open it within Lazarus or sqlitestudio/sqlitebrowser
« Last Edit: March 29, 2022, 03:23:57 pm by af0815 »
regards
Andreas

incendio

  • Sr. Member
  • ****
  • Posts: 266
Re: Database advice needed
« Reply #10 on: April 12, 2022, 01:20:55 pm »
Sorry for the late reply.

I just read this post.

My suggestion is
1. For local database, don't use sqlite, use embedded firebird. Sqlite features are limited, not worth it.
Firebird is lightweight with rich features.

2. For client server, cloud server, etc, it's depend on how complex your app. I still prefer firebird against mysql or postgre because it is simpler to maintenance.
Negative point for Firebird is the lack to support paralel query that supports by postgre. But this can be compensate by using Multithreading approach.

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
Re: Database advice needed
« Reply #11 on: April 12, 2022, 04:22:57 pm »
SQLite is easiest to set up: drop the dll/so in the directory with your project. Done. Ok, it only has five data types, but as the old app is using it as well, that doesn't seem to be a problem. And it is vastly superior to DBF files.

Zvoni

  • Hero Member
  • *****
  • Posts: 2300
Re: Database advice needed
« Reply #12 on: April 12, 2022, 04:29:59 pm »
My suggestion is
1. For local database, don't use sqlite, use embedded firebird. Sqlite features are limited, not worth it.
Firebird is lightweight with rich features.

2. For client server, cloud server, etc, it's depend on how complex your app. I still prefer firebird against mysql or postgre because it is simpler to maintenance.
Negative point for Firebird is the lack to support paralel query that supports by postgre. But this can be compensate by using Multithreading approach.
Do you always shoot nuclear rockets at pigeons?

Quote
I have a database on my mobile, with all the migraine attacks in records that I have had since 2010. So a single-user database.
I wouldn't be surprised if it's even only one table
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Database advice needed
« Reply #13 on: April 12, 2022, 05:31:35 pm »
Hi!

If it is single user then use a TStringGrid.

<= 100.000 rows it is very fast.

Winni

incendio

  • Sr. Member
  • ****
  • Posts: 266
Re: Database advice needed
« Reply #14 on: April 12, 2022, 07:42:49 pm »
SQLite is easiest to set up: drop the dll/so in the directory with your project. Done. Ok, it only has five data types, but as the old app is using it as well, that doesn't seem to be a problem. And it is vastly superior to DBF files.
So does Firebird.
On client server, the setup even easier, just need to copy 1 dll only.

 

TinyPortal © 2005-2018