• Stars
    star
    196
  • Rank 198,553 (Top 4 %)
  • Language
    C
  • License
    MIT License
  • Created about 3 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DuckDB extension to read and write to SQLite databases

DuckDB sqlitescanner extension

The sqlitescanner extension allows DuckDB to directly read data from a SQLite database file. The data can be queried directly from the underlying SQLite tables, or read into DuckDB tables.

Usage

To make a SQLite file accessible to DuckDB, use the ATTACH command, for example with the bundled sakila.db file:

CALL sqlite_attach('sakila.db');

The tables in the file are registered as views in DuckDB, you can list them with

PRAGMA show_tables;

Then you can query those views normally using SQL, e.g. using the example queries from sakila-examples.sql

SELECT cat.name category_name, 
       Sum(Ifnull(pay.amount, 0)) revenue 
FROM   category cat 
       LEFT JOIN film_category flm_cat 
              ON cat.category_id = flm_cat.category_id 
       LEFT JOIN film fil 
              ON flm_cat.film_id = fil.film_id 
       LEFT JOIN inventory inv 
              ON fil.film_id = inv.film_id 
       LEFT JOIN rental ren 
              ON inv.inventory_id = ren.inventory_id 
       LEFT JOIN payment pay 
              ON ren.rental_id = pay.rental_id 
GROUP  BY cat.name 
ORDER  BY revenue DESC 
LIMIT  5; 

Or run them all in both SQLite and DuckDB

./duckdb/build/release/duckdb < sakila-examples.sql
sqlite3 sakila.db < sakila-examples.sql

Building & Loading the Extension

To build, type

make

To run, run the bundled duckdb shell:

 ./build/release/duckdb -unsigned

Then, load the SQLite extension like so:

LOAD 'build/release/extension/sqlite_scanner/sqlite_scanner.duckdb_extension';

More Repositories

1

duckdb

DuckDB is an analytical in-process SQL database management system
C++
23,715
star
2

pg_duckdb

DuckDB-powered Postgres for high performance apps & analytics.
C++
1,410
star
3

duckdb-wasm

WebAssembly version of DuckDB
C++
1,185
star
4

dbt-duckdb

dbt (http://getdbt.com) adapter for DuckDB (http://duckdb.org)
Python
896
star
5

duckdb-rs

Ergonomic bindings to duckdb for Rust
Rust
474
star
6

duckdb_spatial

C
448
star
7

postgres_scanner

C++
209
star
8

duckdb-web

DuckDB website and documentation
JavaScript
167
star
9

duckdb_iceberg

C++
121
star
10

duckdb-r

The duckdb R package
R
112
star
11

extension-template

Template for DuckDB extensions to help you develop, test and deploy a custom extension
Python
112
star
12

duckdb_delta

DuckDB extension for Delta Lake
C++
101
star
13

community-extensions

Shell
97
star
14

duckdb-swift

C++
68
star
15

duckdb_vss

C++
68
star
16

duckdb_mysql

C++
45
star
17

duckdb_azure

Azure extension for DuckDB
C++
43
star
18

duckdb-node

C++
42
star
19

uc_catalog

Proof-of-concept extension combining the delta extension with Unity Catalog
C++
39
star
20

duckdb_aws

C++
37
star
21

arrow

Extension for DuckDB for functions that require the Apache Arrow dependency
C++
33
star
22

duckdb-java

DuckDB JDBC Driver
C++
28
star
23

substrait

C++
23
star
24

duckdb-node-neo

Second iteration on a DuckDB Node.js client
TypeScript
18
star
25

duckdb_httpfs_wasm_experiment

HTTPFS extension for DuckDB. Adds support for an HTTPFileSytem and S3FileSystem.
C++
13
star
26

duckdb-pyodide

HTML
11
star
27

extension-ci-tools

Repository containing reusable workflows / actions for building DuckDB extensions
Makefile
9
star
28

duckdb-odbc

ODBC Driver for DuckDB
C++
5
star
29

duckdb-data

5
star
30

duckdb-wasm-wip

duckdb-wasm test deployment
CSS
4
star
31

duckdb-wasm-ci-env

GitHub Action for DuckDB WASM CI
Dockerfile
3
star
32

duckdb_excel

Excel extension for DuckDB
C++
3
star
33

duckdb_httpfs

C++
2
star
34

duckdb_sqlsmith

DuckDB SQLsmith extension repository
C++
2
star
35

duckdb-fuzzer

Repository that contains automatic reports of issues found through fuzzing DuckDB
1
star
36

duckdb.r-universe.dev

R-universe for the duckdb GitHub organization
1
star
37

duckdb-workflow-trigger

Adding a level of indirection to rule all workflows
1
star
38

duckdb-wasm-extensions-ci

C
1
star
39

extension-template-sql

C++
1
star