Recent

Author Topic: SQlite3 and Lazarus  (Read 12265 times)

Eric_Jourde

  • Guest
SQlite3 and Lazarus
« on: October 12, 2005, 02:19:21 pm »
Hi, i just re-test the last version of Lazarus, and i found it wonderfull !!!

I works on porting a delphi application on it, during 4 hours without any crachs !! great works mans ! ;)

I have currently a working sqlite3 unit for lazarus.

Does a package is necesary for the community ?

I hope make a little front-end for sqlite3 database ! to test it and then use it the make some sqlite3 developpment !

I could publish the front-end like sample application.

Thanks again for this work !

E.Jourde

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
RE: SQlite3 and Lazarus
« Reply #1 on: October 12, 2005, 08:39:17 pm »
Can you put your program source-code on a place where we can get it?

I'm trying to access sqlite myself, but I haven't succeded yet.

There is already a package for sqlite, but packages are never too many =). Even if it is not included on Lazarus it would be nice to have one on a package repository. You can find information about it here: http://wiki.lazarus.freepascal.org/index.php/Lazarus_Database_Tutorial.

Eric_Jourde

  • Guest
sqlite3
« Reply #2 on: October 12, 2005, 09:41:13 pm »
ok i could put the source somewhere !

i write a litte wiki.

sqlite3 works very well !


eric

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 458
SQlite3 and Lazarus
« Reply #3 on: October 12, 2005, 11:05:53 pm »
There's already support for sqlite3 in the svn version (2.0.1) of fpc and also a package for Lazarus, but since there's no released version of fpc that includes it, i did not published/uploaded the package to avoid break compatibility with the people using fpc 2.0.0

If you want to try you can get in the svn repository:
base sqlite3:

http://svn.freepascal.org/svn/fpc/branches/fixes_2_0/packages/base/sqlite/sqlite3.pp

TDataset descendants
 http://svn.freepascal.org/svn/fpc/branches/fixes_2_0/fcl/db/sqlite/customsqliteds.pas
http://svn.freepascal.org/svn/fpc/branches/fixes_2_0/fcl/db/sqlite/sqliteds3.pas

Anonymous

  • Guest
SQlite3 and Lazarus
« Reply #4 on: December 03, 2005, 06:07:30 pm »
your sqlite3 package works with the lazarus snapshot? if so, please publish! :D
at the moment all works with testapiv3x but i see i need the package to obtain the visual component..

(sorry for my english and for my noob writing..  :wink: )

Anonymous

  • Guest
SQlite3 and Lazarus
« Reply #5 on: December 04, 2005, 03:56:43 am »
Yes, it works. See http://www.geocities.com/camara_luiz/sqlitepackage.zip
It requires fpc201 or above. I'm waiting for release of fpc202 to send to Lazarus developers

Anonymous

  • Guest
SQlite3 and Lazarus
« Reply #6 on: December 04, 2005, 11:08:47 am »
i am sorry for being boring...
but:
Sqlite3DataSet1.ExecSQL('CREATE TABLE TPezzi (Code varchar (50), First_Name INTEGER PRIMARY KEY)');
gives me
Sqlite3DataSet1: Field type 'VARCHAR (50)' not recognized.

i use Lazarus-0.9.11-20051129-win32.exe
with the installed package you posted above.
i dont know which version of fpc has the lazarus 20051129..

Anonymous

  • Guest
SQlite3 and Lazarus
« Reply #7 on: December 23, 2005, 06:23:03 pm »
Instead of Varchar(50) use only Varchar. For sqlite they are equivalent (sqlite ignores the length delimiter)

Luiz

Anonymous

  • Guest
SQlite3 and Lazarus
« Reply #8 on: January 09, 2006, 02:49:16 pm »
works!! :*

pfranchuk

  • New Member
  • *
  • Posts: 19
SQlite3 and Lazarus
« Reply #9 on: January 17, 2006, 03:31:22 am »
Quote from: "Anonymous"
Instead of Varchar(50) use only Varchar. For sqlite they are equivalent (sqlite ignores the length delimiter)

Luiz


Then why don't you fix the component so that it also ignores the length delimiter?  Then I could use my existing db's with new lazarus programs.

pfranchuk

  • New Member
  • *
  • Posts: 19
SQlite3 and Lazarus
« Reply #10 on: February 02, 2006, 03:07:59 am »
Quote from: "Anonymous"
Instead of Varchar(50) use only Varchar. For sqlite they are equivalent (sqlite ignores the length delimiter)

Luiz


OK, I did it myself. Just add:

if pos('CHAR',ColumnStr)>0 then ColumnStr:= 'VARCHAR';

just before the case statement assigning field types. This takes care of the CHAR as well as VARCHAR(n) declaratiions in previously created DB's

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 458
SQlite3 and Lazarus
« Reply #11 on: February 24, 2006, 12:58:24 am »
I already fixed this among many other things. I'm setting a page for sqlite/fpc and when i upload it i will do a post.

UPDATE: Here you can find latest sqlite component: http://www.geocities.com/camara_luiz/sqlite4fpc/index.html

 

TinyPortal © 2005-2018