DynSQLite Library - SQLite support library

Started by Michele, Yesterday at 12:12:02 AM

Previous topic - Next topic

Michele

Finally I release a beta version of DynSQLite in hope that its features are of any use.

DynSQLite is a C library designed for native Win32 applications, providing a comprehensive database workbench and browser engine. It enables developers and users to manage multi-database environments concurrently through a modern, fully modeless architecture.
This is a Beta release.

CORE DATABASE MANAGEMENT & INSPECTION FEATURES:
  • Multi-Database Workspaces (HCDBCONTEXT): Seamlessly open, switch, and manage multiple concurrent database connections and file contexts on the fly with real-time broadcasting mechanisms like WM_MSQL_DB_EVENT and WM_MSQL_CTX_RENEWED.
  • Schema Browsing & Virtual Listview Engines: High-performance virtual listview browsers (MsqlCreateBrowserControl, MsqlAttachBrowserMetadata) supporting real-time schema swapping, custom text filtering, pattern matching, and collation rules.
  • Comprehensive Schema Inspection: Detailed descriptor abstractions for tables, views, triggers, and columns (MsqlGetTableDescriptor, MsqlGetViewDescriptor, MsqlGetTriggerDescriptor, MsqlGetColumnDescriptor), providing granular access to field types, count metrics, and table properties.
  • Data Inspection & CRUD Operations: Advanced data browser capabilities including hex data inspection for BLOB fields, image rendering pipelines, record deletion protocols (MsqlDeleteRecord), and customized event hooks via fnMsqlCrudCallback.

SCHEMA DEFINITION & STRUCTURAL MODIFICATION:
  • Table & Object Lifecycle Management: Complete programmatic control to create, alter, and drop database objects, including dedicated prompts and helpers for table alterations (MsqlPromptAndAlterTable, MsqlAlterTable), table creation (MsqlPromptAndCreateTable), and object deletion (MsqlDropObject).
  • Triggers & Extensions: Built-in automated helper utilities such as MsqlCreateUpdateTimeTrigger for updating timestamps, along with full runtime support for loading SQLite extensions and checking extension function availability (MsqlLoadExtension, MsqlIsExtensionFunctionAvailable).

ROBUST DATA INTERCHANGE (IMPORT & EXPORT):
  • Multi-Format Export Engine: Export query results and result sets directly to CSV, JSON, SQL, and XML formats, featuring dedicated utility workflows like MsqlExportQueryResults, MsqlExportTableToCsv, MsqlExportTableToSql, MsqlExportTableToJson, MsqlExportTableToXml, and interactive prompt wrappers.
  • Flexible Data Importers: Comprehensive ingestion tools to parse and import CSV, JSON, XML, and SQL dump structures directly into target tables via functions like MsqlImportDataFile, MsqlImportCsvToTable, and MsqlPromptAndImportData.

SQL QUERY WORKBENCH & EXECUTION:
  • Interactive Query Workbench: Fully independent modeless SQL query editor interfaces (MsqlSqlQueryWorkbench) allowing complex query drafting, validation, execution, and dynamic result set visualization across multiple active database contexts.

MODERN WIN32 ARCHITECTURE & WINDOW MANAGEMENT:
  • Modeless-First Design: Completely asynchronous, long-lived popup windows that allow concurrent interaction across multiple database workbenches without blocking the host application.
  • Active Desktop Workspace Tiling & Cascading: Custom layout engines (MsqlTileManagedWindows, MsqlCascadeManagedWindows) that calculate precise coordinates against the active desktop work area (SPI_GETWORKAREA), tiling and cascading workbenches cleanly above the taskbar.
  • Thread-Safe Registry & Menu Integration: Robust critical-section thread protection for active window states, accompanied by clean public API hooks (MsqlGetManagedWindowCount, MsqlGetManagedWindowInfo) to dynamically populate host window menus with live titles and checkmarks.

The library is available for download on sourceforge.net, download the workspace here.

Actually PellesC site doesn't allow to load the files (gives an error and ask to refer to teh administrator), when, and if, it will allow to load the workspace zip I'll upload it here also.

Robert

Hi Michele:

I'm running Pelles C 14.50.0 on Windows 11 26H2

Using your .ppw loaded into Pelles IDE

I run
Clean WorkSpace
then
Build WorkSpace

MemLeakCheck.lib is built
ReflectControl.lib is built
then in the IDE output window

Project opened: D:\WorkBench\Pelles C\Michele\DynSqlite_workspace\sqlitestudio_dll.ppj
Project build started
Project build ended successfully
Project build started
Project build ended in complete failure

I ran your builds on one of my SQLite .db and was impressed with what you have accomplished.

Thank you.

Michele

#2
Thanks Robert!  :)
I fixed the workspace zip and reloaded it. There were 2 problems.
The first was the missing folder for the SQLite3.h header, in my system compiled because I have this location in the system path.
The second problem was a missing header file that I included using <> brackets, so the zipper skipped it and doesn't included in the zip.
Please let me know if you can compile it now.
I will appreciate your opinion and what would you like to be added to the library.

MrBcx

Hi Michele,

I played around a bit with DynSQLite and briefly reviewed some of your code.

You really did a fantastic job with this.

Your use of reflection is clever and elegant and your code is well formatted and easy to follow.

Most importantly, DynSQLite is an intuitive and easily useful tool.

Thank you for generously sharing this with the community.



For anyone needing a sample database to experiment with, I can recommend this one.
( Remember to unblock it after downloading. )

https://github.com/lerocha/chinook-database/blob/master/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite

Bcx Basic to C/C++ Translator
https://www.bcxbasiccoders.com

Michele

Thanks MrBCX!  :)
The sample databases I used for the testing are available here on sourceforge.net.
I will appreciate your suggestion about what enhancements can be introduced.

TimoVJL

#5
https://forum.pellesc.de/index.php?topic=11621.msg42757#msg42757

I tested it database from a that project.

A SQLite 3 databases use also extension form '.db3'

https://fileinfo.com/extension/db3
May the source be with you

Michele

Quote from: TimoVJL on <strong>Today</strong> at 03:14:51 PMhttps://forum.pellesc.de/index.php?topic=11621.msg42757#msg42757

I tested it database from a that project.

A SQLite 3 databases use also extension form '.db3'

https://fileinfo.com/extension/db3

Hello TimoVJL.
I'll add it to the file open/save dialogs.
Please let me know if there is something else to add.