MightyQuery / janSQL lazarus / 16-Databases ---------------------------------------------------------------------- tatamata · 2009-05-07 11:50 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. Update on 24.02.2023: Source code (CodeTyphon v. 8.00): https://matasoft.hr/MightyQuery.7z Compiled binaries for Linux and Windows: https://matasoft.hr/MightyQuery_Binary.7z 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) ---------------------------------------------------------------------- bee · 2009-05-07 15:26 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. ---------------------------------------------------------------------- theo · 2009-09-15 23:51 Quote from: bee on May 07, 2009, 05:26:23 pmI 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 · 2009-09-16 10:04 Theo, great job! It works properly on Windows, I will check it on Linux later on.... ---------------------------------------------------------------------- bee · 2009-09-28 08:08 Quote from: theo on September 16, 2009, 01:51:46 amThis 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. ---------------------------------------------------------------------- theo · 2009-10-27 20:34 Quote from: bee on September 28, 2009, 10:08:49 amCan 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. ---------------------------------------------------------------------- bee · 2009-12-16 06:50 Quote from: theo on October 27, 2009, 09:34:23 pmIt 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. ---------------------------------------------------------------------- theo · 2009-12-16 09:26 Quote from: bee on December 16, 2009, 07:50:00 amWould 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 Quote from: bee on December 16, 2009, 07:50:00 amAlso, 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 · 2010-06-13 00:53 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 · 2010-06-13 04:02 Have you released a version for Linux? Regards Dave ---------------------------------------------------------------------- eny · 2010-06-13 10:05 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. ---------------------------------------------------------------------- tatamata · 2010-06-13 11:23 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 · 2010-06-13 11:25 Quote from: davesimplewear on June 13, 2010, 06:02:57 amHave you released a version for Linux? Regards Dave No, not yet...when official Lazarus 0.9.30 is released, then I will release the version for Linux... ---------------------------------------------------------------------- tatamata · 2011-06-24 21:08 You can download source code and binaries of the MightyQuery database management software from: http://www.4shared.com/folder/XL3EZwUR/MightyQuery.html Edit on 24.02.2023: Source code (CodeTyphon v. 8.00): https://matasoft.hr/MightyQuery.7z Compiled binaries for Linux and Windows: https://matasoft.hr/MightyQuery_Binary.7z 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 · 2011-06-26 12:25 It could be nice to have this project at SouceForge. Cheers, Miquel.