Recent

Author Topic: MightyQuery / janSQL  (Read 20541 times)

tatamata

  • Hero Member
  • *****
  • Posts: 736
    • ZMSQL - SQL enhanced in-memory database
MightyQuery / janSQL
« on: May 07, 2009, 01:50:27 pm »
I have been started a project called "MightyQuery" that is intended to be a MS Access alternative, written in Lazarus/FPC.
The idea was to create a simple MS Access-like software that would be able to query business data on the fly. Instead of using widespread open-source database engines that require either installing server either DLLs, I hoped to be able to do it in pure Lazarus/FPC, by using JanSQL component.
JanSQL is a pure pascal SQL database engine working with csv flat files. It is written by Jan Verhoeven (www.jansfreeware.com) for Delphi and ported to Lazarus by Bee.
You can download the ported JanSQL from:
http://matalab.freehostia.com/laz-janSQL.zip

The idea was to use TDbf (for storing information about "databases", tables and saved queries), JanSQL (for querying), MemDataset (for data presentation and navigation) and CsvDataset (for direct editing of CSV files). Additionaly, external data would be imported by SqlDb into CSV tables on the fly, so that the program could mimicry querying of heterogeneous data sources. By the way, I think that this feature of heterogeneous querying is the biggest advantage of MS Access. In Access you can easily query tables from different sources (native mdb tables, Excel tables, CSV tables, tables from different ODBC connected tables). Possibly, information about changes would be sent back to external databases (synchronization). In future, scripting functionality (Pascalscript?), dynamic creation of reports and forms, visual query builder would be added.

Unfortunately, I'm stucked by a bug in JanSQL itself. The original Delphi JanSQL works correctly, but the ported JanSQL retrieves only one row when querying more than one table. I was looking at the code, but could not find the reason for this odd behavior.
Therefore, I'm stucked now with this bug(?) in laz-jansql...

I find jansql to be very interesting component for ad-hoc querying. A lot of business data is stored in flat files or can be easily exported to CSV files. Jansql has great potential for a fat-free database engine. And what is most important, jansql is the only open-source SQL engine written in Pascal, so for the sake of Pascal language itself, it would be worthy to preserve it, possibly to improve it.
I would appreciate any help, especially if someone wish to investigate why laz-jansql incorrectly retrieves only one row in queries containing more than one table.

Regards,

Zlatko Matić (matalab@gmail.com)
« Last Edit: October 05, 2009, 01:55:56 pm by tatamata »

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: MightyQuery / janSQL
« Reply #1 on: May 07, 2009, 05:26:23 pm »
I hadn't been able to find the source of the bug either. Sorry for that. :( Maybe you should contact the author of janSQL and ask for his help.

-Bee-

A long time pascal lover.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1891
Re: MightyQuery / janSQL
« Reply #2 on: September 16, 2009, 01:51:46 am »
I hadn't been able to find the source of the bug either. Sorry for that. :( Maybe you should contact the author of janSQL and ask for his help.

This version should work
http://www.theo.ch/lazarus/janSQLLaz.zip
 :)

tatamata

  • Hero Member
  • *****
  • Posts: 736
    • ZMSQL - SQL enhanced in-memory database
Re: MightyQuery / janSQL
« Reply #3 on: September 16, 2009, 12:04:19 pm »
Theo, great job!
It works properly on Windows, I will check it on Linux later on....

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: MightyQuery / janSQL
« Reply #4 on: September 28, 2009, 10:08:49 am »
This version should work http://www.theo.ch/lazarus/janSQLLaz.zip  :)

Can you give some further explanation to what you had done into the original code? TIA.
-Bee-

A long time pascal lover.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1891
Re: MightyQuery / janSQL
« Reply #5 on: October 27, 2009, 09:34:23 pm »
Can you give some further explanation to what you had done into the original code? TIA.

Sorry for responding late.
It was a nasty little bug in the original code, an uninitialized local boolean variable which happened to default to false with delphi and true with freepascal.
« Last Edit: October 27, 2009, 09:40:09 pm by theo »

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: MightyQuery / janSQL
« Reply #6 on: December 16, 2009, 07:50:00 am »
It was a nasty little bug in the original code, an uninitialized local boolean variable which happened to default to false with delphi and true with freepascal.

Would you please point out which line of code that causes the bug? I've been quite a while no longer use this component. I even lost my own conversion source code, so I have to get it from Jan's website again. I might need to use this component again in a small utility application. I'll test your fixes on Linux and Mac.

Also, would you please update the Contributed Units section of this component? Also provide your fixed source code. Because the link I provided there is broken. :(

Thanks.
« Last Edit: December 16, 2009, 07:52:57 am by bee »
-Bee-

A long time pascal lover.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1891
Re: MightyQuery / janSQL
« Reply #7 on: December 16, 2009, 10:26:48 am »
Would you please point out which line of code that causes the bug? I've been quite a while no longer use this component.
There is a comment in JanSQL.pas in the above download. Search for:
//fixed for FPC theo

Also, would you please update the Contributed Units section of this component? Also provide your fixed source code. Because the link I provided there is broken. :(

Please do whatever you think is necessary. The code is yours ;-)

Thanks.

tatamata

  • Hero Member
  • *****
  • Posts: 736
    • ZMSQL - SQL enhanced in-memory database
Re: MightyQuery / janSQL
« Reply #8 on: June 13, 2010, 02:53:25 am »
By the way, MightyQuery can be downloaded as freeware from:
http://matalab.freehostia.com/MightyQuery_1_0_2_Setup.exe

MightyQuery is a FREEWARE  single user SQL database management software working with data stored as comma separated values (.csv, .txt) in plain, flat, textual files. It is serverless, self-contained, simple and effective SQL DBMS for querying CSV files.

MightyQuery does not require a server installation or any external libraries. Though there are other database solutions that can process single textual file, MightyQuery is distinguished from them by its SQL engine, by which you can query and modify CSV tables with power that is normally reserved for huge enterprize-level SQL engines.

davesimplewear

  • Sr. Member
  • ****
  • Posts: 307
    • Davids Freeware
Re: MightyQuery / janSQL
« Reply #9 on: June 13, 2010, 06:02:57 am »
Have you released a version for Linux? :D

Regards
Dave
All things considered insanity seems the best option

eny

  • Hero Member
  • *****
  • Posts: 1617
Re: MightyQuery / janSQL
« Reply #10 on: June 13, 2010, 12:05:30 pm »
Delivering a library to be used with Lazarus in a .exe is never a good idea!
Better to put it in a zipfile with appropriate installation instructions.
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

tatamata

  • Hero Member
  • *****
  • Posts: 736
    • ZMSQL - SQL enhanced in-memory database
Re: MightyQuery / janSQL
« Reply #11 on: June 13, 2010, 01:23:05 pm »
The .exe works without any library, including JanSQL, which is compiled directly into the .exe. The source code of JanSQL is provided since it is MPL licensed...

tatamata

  • Hero Member
  • *****
  • Posts: 736
    • ZMSQL - SQL enhanced in-memory database
Re: MightyQuery / janSQL
« Reply #12 on: June 13, 2010, 01:25:06 pm »
Have you released a version for Linux? :D

Regards
Dave
No, not yet...when official Lazarus 0.9.30 is released, then I will release the version for Linux...
« Last Edit: June 14, 2010, 02:23:44 am by tatamata »

tatamata

  • Hero Member
  • *****
  • Posts: 736
    • ZMSQL - SQL enhanced in-memory database
Re: MightyQuery / janSQL
« Reply #13 on: June 24, 2011, 11:08:32 pm »
You can download source code and binaries of the MightyQuery database management software from:

http://www.4shared.com/folder/XL3EZwUR/MightyQuery.html

MightyQuery is a single user SQL database management software working with data stored as comma separated values (.csv, .txt) in plain, flat, textual files. It is serverless, self-contained, simple  SQL DBMS for querying CSV files. In contrast to most database systems, MightyQuery does not require neither server installation, neither external libraries. And is multiplatform (due to Lazarus).

It relies on JanSQL database engine , which original code was written by Jan Verhoeven (http://jansfreeware.com) in Delphi and released under MPL 1.1. license.
As far as I am aware, this might be the only existing free/open-source SQL database engine written in Pascal, thus worthy of preservation and improving.

To enable processing of external data, Mighty Query contains importing utility (due to Zeosdbo), supporting wide range of  SQL database servers, such as: PostgreSQL, Interbase, Firebird, MSSQL, Sybase, SQLite, Oracle, ado, ASA.

MightyQuery uses TDbf for storing metadata about projects (databases), tables, queries, external sources of data. Retrieved data from JanSQL is transfered to TBufDataset for viewing, filtering and searching.

I'm looking for interested contributors for further development.

If someone is interested, we could port this project to SoureForge...


miquelmatas

  • Jr. Member
  • **
  • Posts: 98
  • Beginner forever.
Re: MightyQuery / janSQL
« Reply #14 on: June 26, 2011, 02:25:35 pm »
It could be nice to have this project at SouceForge.

Cheers,
Miquel.

--
Cheers.
Miquel.

 

TinyPortal © 2005-2018