DynSQLite Library - SQLite support library

Started by Michele, November 09, 2026, 12:12:02 AM

Previous topic - Next topic

Michele

Hello all, I'm proud to announce the version V00.73.18.00 of DynSQLite.
Apart a lot of bugs that I found and removed, I have added many more features:
  • On opening the code checks for the consistency of input files. It is required because SQLite is very lazy on opening files, doesn't check them and return an handle also for wrong files.
  • The browser now shows the referenced data of foreign keys columns when mouse hover over it.
  • The record editor has been enriched:
    • Now the blobs that contain text are displayed as such and can be edited as text (should make happy John Z).
    • The editing of foreign keys permit to select which column of the referenced data to show for better understandability.
    • Now for blob columns is possible to view pictures or dump an hex display of contents.
    • The blobs can be saved to files from editor.
    • The blobs can be changed specifying a file to replace contents, but the update is effective only when the user selects Save. If the editor is cancelled the new file is dropped and the blob remains unchanged.
Implemented in many modules the WIN32_LEAN_AND_MEAN symbol.

The new package is available for download here.
I will appreciate feedbacks and bug reports.

Michele

Quote from: TimoVJL on November 17, 2026, 06:02:27 PMAs ucrt don't have function asprintf , it should suplied with optional code or just not use it.

An asprintf is a posix function.

https://github.com/eiszapfen2000/asprintf

The page isn't available, probably MS problems or blasts of american cyberstorm.
Anyway I'm implementing this:
#if defined(_MSC_VER) || defined(_WIN32)

/* Check if asprintf isn't already defined by another library or header */
#ifndef HAVE_ASPRINTF
#define HAVE_ASPRINTF

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

/* Inline or static helper to avoid linker collisions if included in multiple translation units */
inline int asprintf(char **strp, const char *fmt, ...)
{
    if (!strp || !fmt)
        return -1;

    va_list args;
    va_start(args, fmt);
    int len = _vscprintf(fmt, args);
    if (len < 0)
    {
        va_end(args);
        *strp = NULL;
        return -1;
    }

    char *buf = (char *)malloc((size_t)len + 1);
    if (!buf)
    {
        va_end(args);
        *strp = NULL;
        return -1;
    }

    int written = vsnprintf(buf, (size_t)len + 1, fmt, args);
    va_end(args);

    if (written < 0)
    {
        free(buf);
        *strp = NULL;
        return -1;
    }

    *strp = buf;
    return written;
}

#endif /* HAVE_ASPRINTF */

#endif /* _MSC_VER || _WIN32 */

Vortex

Code it... That's all...

Michele

Last version of DynSQLite V.00.73.18.10 available for download here.
This version has new features that allows to open a browser window of foreign key referenced tables using the context menu right clicking on the a foreign key field of a column.
From this version is also available an MSVC solution to compile the library under MSVC compiler.

Michele

#49
New version DynSQLite-V.00.73.18.20.
  • In this version fixed a problem when trying to open a database file already open elsewhere, the problem was due to use of fopen_s that doesn't allows sharing of files in db sanity check function. Replaced with fopen.
  • Renamed header file 'sql.h' to 'sql_defs.h' to avoid clashing with standard sql,h header.
  • Fixed 'asprintf.c', the file holds the functions asprintf() and vasprintf() that aren't available in MS ucrt.
    Has been added the 2 function definitions in 'MsCompatibility.h', and added a dummy function to make happy polib.
  • Fixed MSVC project files and intermediary directories.
  • For compilation with other compilers than PellesC and MSVC, the distribution contains a CMake project file CMakeLists.txt and 2 batch files, CMake_build_static.cmd and CMake_build_dll.cmd, to build static and dll version using Clang compiler.
    CMakeLists.txt can be changed to use a different compiler as gcc.
DynSQLite-V.00.73.18.20 is available for download here.