Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Connecting C++ and SQLite with ADBC

Instructions

Prerequisites

  1. Install Pixi

  2. Install dbc

  3. Install SQLite

    • On macOS, if you have Homebrew installed, run brew install sqlite

Connect to SQLite

  1. Install the SQLite ADBC driver:

    dbc install --level user sqlite
  2. Customize the C++ program main.cpp as needed

    • Change the connection arguments in the AdbcDatabaseSetOption() calls
      • Set uri to the location of the SQLite database file you want to query, or keep it set to games.sqlite to use the database file included with this example
    • If you changed the database file, also change the SQL SELECT statement in AdbcStatementSetSqlQuery()
  3. Build and run the C++ program:

    Using Make:

    pixi run make
    ./sqlite_demo

    Or using CMake:

    pixi run cmake -B build
    pixi run cmake --build build
    ./build/sqlite_demo

Clean up

  1. Clean build artifacts:

    Using Make:

    pixi run make clean

    Using CMake:

    rm -rf build