Skip to content

chilarai/qt-duckdb

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

QT-DuckDB InMemory CRUD operations

This project demostrates how you can use the Qt framework to connect to DuckDB.

DuckDB is an embeddable SQL OLAP database management system and comes in very handy to handle Analytical queries.

Installation

This demo project will cover compilation on Mac only. However, it will not be very difficult to compile on other platforms. You just need to download the required binaries (linked libraries, eg, .dll, .so files) on the respective platforms.

You can find the required binaries here: https://duckdb.org/docs/installation/

The following steps are already done inside the project. This is only required for fresh projects. After downloading, you need to configure the following.

  1. Copy the libduckdb.dylib & duckdb.hpp files in the Qt project root.

  2. Adjust the .pro file to add the library. The following line needs to be added in the file for Mac & Windows. On Windows remember to put the duckdb.dll file inside the folder where the executable is generated and the duckdb.lib inside the project path as mentioned in .pro file

macx: LIBS += -L$$PWD/./ -lduckdb
win32: LIBS += $$PWD/duckdb.lib

The path can be adjusted in -L$$PWD/./.

For other platforms, you can easily follow the instructions on https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html

  1. Import duckdb.hpp file in the project

Project details

The CRUD related functions are described in DuckCRUD class. All the methods are Q_INVOKABLE methods and called inside QML file (main.qml)

Note:

Please feel free to modify the project if you think any meaningful feature can be added

Links

  1. https://duckdb.org/
  2. Blog: https://dev.to/chilarai/inmemory-columnar-database-duckdb-integration-with-qt-for-data-analytics-3nej

About

A simple project to showcase CRUD operations with QT and DuckDB InMemory operations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages