Recent

Author Topic: Embedded Database options  (Read 20033 times)

nelson777

  • Jr. Member
  • **
  • Posts: 68
    • http://www.aocontrario.com
Embedded Database options
« on: August 17, 2007, 08:42:47 pm »
What are the options for embedded databases in Lazarus ?

Besides SQLite, I know only embedded Firebird , but it needs .NET, so it´s out of my list.

Anyone knows another one ?

Nelson

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: Embedded Database options
« Reply #1 on: August 17, 2007, 09:31:15 pm »

nelson777

  • Jr. Member
  • **
  • Posts: 68
    • http://www.aocontrario.com
RE: Embedded Database options
« Reply #2 on: August 18, 2007, 12:07:07 am »
that´s not a database, don´t u think ?

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: Embedded Database options
« Reply #3 on: August 18, 2007, 12:11:28 am »
It sure is a database in my definition.

It has tables, columns, records, indexes and can be used with TDataset.

It does not understand SQL, but you did not say that was a requirement.

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Embedded Database options
« Reply #4 on: August 18, 2007, 08:57:36 pm »
Hi!
It seems to me that FSSQL (http://www.winniccy.com/fssql/) could fit perfectly the need for an embedded database for Lazarus. But, someone needs to port the code from Delphi to Lazarus first!
Yesterday I started the wizard for converting Delphi units to Lazarus units and it couldn't recognize only several units:
DBTables, dbConsts, Dsgnlntf, Exptlntf, consts, Mask. I know that Mask is MaskEdit in Lazarus, but don't know for other units. (A comparisson table/chart between Delhi and Lazarus units/classes would be great!).
Anyway, it seems that someone with better knowledge could port it very easily to Lazarus...
This would be very nice, because an embedded SQL database engine is something really missing in Lazarus.
FSSQL coudl be compiled into .exe, no dll...well this sounds great!
Such database applications would be cross-platform, because .exe could work on Linux by wine...

Regards,

Zlatko

Zaher

  • Hero Member
  • *****
  • Posts: 679
    • parmaja.org
Embedded Database options
« Reply #5 on: August 18, 2007, 11:10:05 pm »
- embedded Firebird not need .NET !

I prefer SQLite becuase it is work in WinCE and i tested it there.

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Embedded Database options
« Reply #6 on: August 19, 2007, 02:31:20 pm »
There is one more option for embedded Firebird in Lazarus.
I discovered fb_embedded2.pas unit for Delphi that was created by mr. Fikret Hasovic, one of liders in Firebird community. This Delphi unit just has to be included in your project and the whole firebird embedded server will be included in your .exe!
Someone just need to convert it to Lazarus.
If somebody is interested, please, contact me, I can send you the source code. Or just contact the author:

Fikret Hasovic   http://fikret.fbtalk.net                      
 Senior Programmer/Analyst

 * Firebird Foundation member.
   - Join today at http://www.firebirdsql.org/ff/foundation
 * Firebird and Fyracle news
   http://www.fyracle.org
 * JEDI VCS contributor
   http://jedivcs.sourceforge.net/

Regards,

Zlatko

nelson777

  • Jr. Member
  • **
  • Posts: 68
    • http://www.aocontrario.com
Embedded Database options
« Reply #7 on: August 22, 2007, 06:02:26 pm »
I didn´t reply to this thread because I was studying a bit the different alternatives before I go on.
My problem is that I made my first Lazarus system using PostgreSQL, as it´s one of the best rdbms I came across. Yet as it was a simple system, the cost of installing PostgreSQL, and all it´s security in the user´s machine was more or less clumsy, for my intended user type. I could think in some other problems, like what if PostgreSQL was already installed ? how can I made an installer that would install postgresql, verifying this possible installation ? ok it´s possible, but much more complicated that if I just could keep a simple file in the app´s dir. And there are permissions concerns, and the database backup has to use administative privileges of the superuser account, that if it´s already installed could pose be a problem... and I can think in many other problems.

So I go looking for embedded databases preferably one that I could upgrade to full RDBMS capability if and when I need it, and I discovered that the only open-source way to do this (embedded -> full RDBMS) is Firebird.

At first I liked SQLite, due to the support to many platforms, but not having referential integrity, makes it absolutely out of my list.

Also responding Vicent, you´re right, my mistake in the post above. SQL to me is definitively a requirement. What I meant was a RDBMS, not a database. :)

Anyone knows any other *already working* options ?

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Embedded Database options
« Reply #8 on: August 22, 2007, 09:11:58 pm »
Hi, Nelson 77!
It seems that you and me have exactly the same problem and we came to the same conclusion!

Regards,

Zlatko

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Embedded Database options
« Reply #9 on: August 22, 2007, 09:47:05 pm »
Firebird seems to be the best options, it has an embedded server option too.

Zaher

  • Hero Member
  • *****
  • Posts: 679
    • parmaja.org
Embedded Database options
« Reply #10 on: August 24, 2007, 01:22:02 am »
Firebird embedded not multi user/instance, mean one instance can use the database file.
SQLite is multi user.
But i think who need the embedded not need a multi user sharing database.

Zaher

  • Hero Member
  • *****
  • Posts: 679
    • parmaja.org
Embedded Database options
« Reply #11 on: August 24, 2007, 01:28:04 am »
There is another lib for firebird
http://fblib.altervista.org/

nelson777

  • Jr. Member
  • **
  • Posts: 68
    • http://www.aocontrario.com
Embedded Database options
« Reply #12 on: August 25, 2007, 01:34:30 am »
Well, I haven´t tried it, but "No Data Aware" ? Why should I use a Non-data aware component when I have Zeos ?

nelson777

  • Jr. Member
  • **
  • Posts: 68
    • http://www.aocontrario.com
Embedded Database options
« Reply #13 on: October 30, 2007, 12:53:47 am »
When I wrote the above post, I didn´t acctually had tried to use embedded firebird with Zeos. Has someone done that ? Is there any special port I should use ?

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Embedded Database options
« Reply #14 on: October 30, 2007, 05:27:07 pm »
Code: [Select]

procedure TFormMain.FormCreate(Sender: TObject);
begin
  //Set connection.
  try
    //Connection parameters for Firebird embedded database.
    ZConnection.User:='SYSDBA';
    ZConnection.Password:='masterkey';
    ZConnection.Protocol:='firebird-2.0';
    ZConnection.Database:='MYDATABASE.GDB';
    zConnection.Port:=0;
    ZConnection.Connect;
  except
    ShowMessage('Error while trying to connect to the database.');
  end;
end;  


Don't forget following things with Firebird embedded:
1. parameter "Host" must be empty. "Port" must be 0. "User" and "Password" can be anything, since there is no security issue in Firebird embedded.
2. You must switch off (Connected:=False) any ZConnection in design time. You will have an error if you leave ZConnection active in design time. Connection must be established through code in run-time.
Though, you can develop application using "normal" Firebird and deploy it as Firebird embedded...
3. You can have only one ZConnection active in run-time.

Regards,

Zlatko

 

TinyPortal © 2005-2018