Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Dtenwolde/community-extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtenwolde committed Nov 5, 2024
2 parents e26b339 + 2a03453 commit 0acbb95
Show file tree
Hide file tree
Showing 29 changed files with 488 additions and 84 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build all extensions
on:
workflow_dispatch:
inputs:
duckdb_version:
type: string
duckdb_tag:
type: string
deploy:
type: string

jobs:
collect_extensions:
outputs:
COMMUNITY_EXTENSION_LIST: ${{ steps.generate_list.outputs.EXTENSION_LIST }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate extension list
id: generate_list
run: |
./scripts/get_extension_list.sh
cat extension_list
cat extension_list >> $GITHUB_OUTPUT
build_all:
needs:
- collect_extensions
strategy:
fail-fast: false
matrix:
extension_name: ${{ fromJson(needs.collect_extensions.outputs.COMMUNITY_EXTENSION_LIST) }}
uses: ./.github/workflows/build.yml
secrets: inherit
with:
extension_name: ${{ matrix.extension_name }}
duckdb_version: ${{ inputs.duckdb_version }}
duckdb_tag: ${{ inputs.duckdb_tag }}
deploy: ${{ inputs.deploy }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
downloads-last-week.json
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This repository collects third-party extensions created for [DuckDB](https://www.duckdb.org).

Visit the [DuckDB community extensions website](https://community-extensions.duckdb.org) to learn more about the available extensions.
View the [list of Community Extensions](https://duckdb.org/community_extensions/list_of_extensions).

Visit the [DuckDB Community Extensions website](https://duckdb.org/community_extensions) to learn more about the available extensions.

[Learn about the official extensions and community extensions.](https://duckdb.org/2024/07/05/community-extensions)
6 changes: 3 additions & 3 deletions extensions/bigquery/description.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extension:
name: bigquery
description: Integrates DuckDB with Google BigQuery, allowing direct querying and management of BigQuery datasets
version: 1.0.0
version: 0.1.0
language: C++
build: cmake
license: MIT
Expand All @@ -13,12 +13,12 @@ extension:

repo:
github: hafenkran/duckdb-bigquery
ref: 656055570493d26de86c4ab3a81f0c1b718835d2
ref: e5cd4a9ac32ce3380559bc63869c442c14e1fb75

docs:
hello_world: |
-- Attach to your BigQuery Project
D ATTACH 'project=my_gcp_project' as bq (TYPE bigquery, READ_ONLY);
D ATTACH 'project=my_gcp_project' AS bq (TYPE bigquery, READ_ONLY);
-- Show all tables in all datasets in the attached BigQuery project
D SHOW ALL TABLES;
Expand Down
5 changes: 0 additions & 5 deletions extensions/bigquery/docs/function_description.csv

This file was deleted.

7 changes: 7 additions & 0 deletions extensions/bigquery/docs/function_descriptions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function,description,comment,example
bigquery_attach,"Attach to a BigQuery project.","","ATTACH 'project=my_gcp_project' as bq (TYPE bigquery);"
bigquery_scan,"Scan a single table directly from BigQuery.",,"SELECT * FROM bigquery_scan('my_gcp_project.quacking_dataset.duck_tbl');"
bigquery_query,"Run a custom GoogleSQL query in BigQuery and read the results.",,"SELECT * FROM bigquery_query('bq', 'SELECT * FROM quacking_dataset.duck_tbl WHERE duck_id = 123');"
bigquery_execute,"Execute an arbitrary GoogleSQL query in BigQuery.",,"CALL bigquery_execute('bq', 'CREATE SCHEMA deluxe_dataset OPTIONS(location=""us"", default_table_expiration_days=3.75);')"
bigquery_jobs,"List jobs in a BigQuery project.","","SELECT * FROM bigquery_jobs('bq');"
bigquery_clear_cache,"Clear the internal caches to refetch the most current project information from BigQuery.","","CALL bigquery_clear_cache();"
8 changes: 4 additions & 4 deletions extensions/chsql/description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ extension:
- lmangani

repo:
github: lmangani/duckdb-extension-clickhouse-sql
ref: 89e1c2fd68c18e018f5afb7ef81b3454abb46dfc
github: quackscience/duckdb-extension-clickhouse-sql
ref: a000d4f2a5f9e1c13cddcd75ea2d3351466f1706

docs:
hello_world: |
-- Use ClickHouse SQL function macros in DuckDB SQL queries
SELECT toString('world') as hello, toInt8OrZero('world') as zero;
SELECT toString('world') AS hello, toInt8OrZero('world') AS zero;
┌─────────┬───────┐
│ hello │ zero │
Expand Down Expand Up @@ -45,4 +45,4 @@ docs:
extended_description: |
This extension implements a growing number of [ClickHouse SQL Macros](https://community-extensions.duckdb.org/extensions/chsql.html#added-functions) and functions for DuckDB.
This extension implements a growing number of [ClickHouse SQL Macros](https://duckdb.org/community_extensions/extensions/chsql#added-functions) and functions for DuckDB.
7 changes: 3 additions & 4 deletions extensions/duckpgq/description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ repo:

docs:
hello_world: |
CREATE TABLE Person as select * from 'https://gist.githubusercontent.com/Dtenwolde/2b02aebbed3c9638a06fda8ee0088a36/raw/8c4dc551f7344b12eaff2d1438c9da08649d00ec/person-sf0.003.csv';
CREATE TABLE Person_knows_person as select * from 'https://gist.githubusercontent.com/Dtenwolde/81c32c9002d4059c2c3073dbca155275/raw/8b440e810a48dcaa08c07086e493ec0e2ec6b3cb/person_knows_person-sf0.003.csv';
CREATE TABLE Person AS SELECT * FROM 'https://gist.githubusercontent.com/Dtenwolde/2b02aebbed3c9638a06fda8ee0088a36/raw/8c4dc551f7344b12eaff2d1438c9da08649d00ec/person-sf0.003.csv';
CREATE TABLE Person_knows_person AS SELECT * FROM 'https://gist.githubusercontent.com/Dtenwolde/81c32c9002d4059c2c3073dbca155275/raw/8b440e810a48dcaa08c07086e493ec0e2ec6b3cb/person_knows_person-sf0.003.csv';
CREATE PROPERTY GRAPH snb
VERTEX TABLES (
Expand All @@ -24,7 +24,7 @@ docs:
EDGE TABLES (
Person_knows_person SOURCE KEY (Person1Id) REFERENCES Person (id)
DESTINATION KEY (Person2Id) REFERENCES Person (id)
LABEL Knows
LABEL knows
);
FROM GRAPH_TABLE (snb
Expand Down Expand Up @@ -52,4 +52,3 @@ docs:
*Disclaimer*: As this extension is part of an ongoing research project by the Database Architectures group at CWI, some features may still be under development. We appreciate your understanding and patience as we continue to improve it.
6 changes: 3 additions & 3 deletions extensions/evalexpr_rhai/description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ docs:
\ employees (name text, state text, zip integer);\nINSERT INTO employees values\n\
\ ('Jane', 'FL', 33139),\n ('John', 'NJ', 08520);\n\n-- Pass the row from the\
\ employees table in as \"context.row\"\nSELECT evalexpr_rhai(\n '\n context.row.name\
\ + \" is in \" + context.row.state\n ',\n {\n row: employees\n }) as result\
\ + \" is in \" + context.row.state\n ',\n {\n row: employees\n }) AS result\
\ from employees;\n\n┌───────────────────────────────┐\n│ result \
\ \n│ union(ok json, error varchar) │\n├───────────────────────────────┤\n\
\"Jane is in FL\"\n\"John is in NJ\"\n└───────────────────────────────┘\n\
\n-- To demonstrate how Rhai can be used to implement\n-- a function in DuckDB,\
\ the next example creates\n-- a macro function that calls a Rhai function\n--\
\ to calculate the Collatz sequence length.\n\nCREATE MACRO collatz_series_length(n)\
\ as\n evalexpr_rhai('\n fn collatz_series(n) {\n let count = 0;\n\
\ AS\n evalexpr_rhai('\n fn collatz_series(n) {\n let count = 0;\n\
\ while n > 1 {\n count += 1;\n if n % 2 == 0 {\n \
\ n /= 2;\n } else {\n n = n * 3 + 1;\n \
\ }\n }\n return count\n }\n collatz_series(context.n)\n\
\ ', {'n': n});\n\n-- Use the previously defined macro.\nSELECT\n collatz_series_length(range).ok::bigint\
\ as sequence_length,\n range as starting_value\nFROM\n range(10000, 20000)\n\
\ AS sequence_length,\n range AS starting_value\nFROM\n range(10000, 20000)\n\
ORDER BY 1 DESC limit 10;\n\n┌─────────────────┬────────────────┐\n│ sequence_length\
\ │ starting_value │\n│ int64 │ int64 │\n├─────────────────┼────────────────┤\n\
│ 278 │ 17647 │\n│ 278 │ 17673 │\n│\
Expand Down
10 changes: 5 additions & 5 deletions extensions/faiss/description.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extension:
name: faiss
description: Provides a subset of the faiss API to duckdb
description: Provides a subset of the faiss API to DuckDB
version: 0.9.0
language: C++
build: cmake
Expand All @@ -21,16 +21,16 @@ docs:
hello_world: |
-- Generate semi-random input data and queries
-- Note that the dimensionality of our data will be 5
CREATE TABLE input AS SELECT i as id, apply(generate_series(1, 5), j-> CAST(hash(i*1000+j) AS FLOAT)/18446744073709551615) as data FROM generate_series(1, 1000) s(i);
CREATE TABLE queries AS SELECT i as id, apply(generate_series(1, 5), j-> CAST(hash(i*1000+j+8047329823) AS FLOAT)/18446744073709551615) as data FROM generate_series(1, 10) s(i);
CREATE TABLE input AS SELECT i AS id, apply(generate_series(1, 5), j-> CAST(hash(i*1000+j) AS FLOAT)/18446744073709551615) AS data FROM generate_series(1, 1000) s(i);
CREATE TABLE queries AS SELECT i AS id, apply(generate_series(1, 5), j-> CAST(hash(i*1000+j+8047329823) AS FLOAT)/18446744073709551615) AS data FROM generate_series(1, 10) s(i);
-- Create the index and insert data into it
CALL FAISS_CREATE('name', 5, 'IDMap,HNSW32');
CALL FAISS_ADD((SELECT id, data FROM input), 'name');
-- Get 10 results with uneven id
SELECT id, UNNEST(FAISS_SEARCH_FILTER('name', 10, data, 'id%2==0', 'rowid', 'input')) FROM queries;
SELECT id, UNNEST(FAISS_SEARCH_FILTER('name', 10, data, 'id%2==1', 'rowid', 'input')) FROM queries;
-- Get 10 results with even id
SELECT id, UNNEST(FAISS_SEARCH_FILTER('name', 10, data, 'id%2==0', 'rowid', 'input')) FROM queries;
-- Get 10 results
SELECT id, UNNEST(FAISS_SEARCH('name', 10, data)) FROM queries;
extended_description: |
The FAISS extension allows duckdb users to store vector data in faiss, and query this data, making reliable vector search more accessible.
The FAISS extension allows DuckDB users to store vector data in faiss, and query this data, making reliable vector search more accessible.
44 changes: 44 additions & 0 deletions extensions/flockmtl/description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
extension:
name: flockmtl
description: DuckDB LLM Extension
version: 0.1.0
language: SQL & C++
build: cmake
license: MIT
maintainers:
- dorbanianas
- SunnyYasser
- queryproc

repo:
github: dsg-polymtl/duckdb-flockmtl
ref: 1bd8ac0f54f8bf4c7da1c3793b88e73daa127653

docs:
hello_world: |
-- After loading, any function call will throw an error if an OPENAI_API_KEY environment variable is not set
-- Call an OpenAI model with a predefined prompt ('Tell me hello world') and default model ('gpt-4o-mini')
D SELECT llm_complete('hello-world', 'default');
┌──────────────────────────────────────────┐
│ llm_complete(hello_world, default_model) │
│ varchar │
├──────────────────────────────────────────┤
│ Hello world │
└──────────────────────────────────────────┘
-- Check the prompts and supported models
D GET PROMPTS;
D GET MODELS;
-- Create a new prompt for summarizing text
D CREATE PROMPT('summarize', 'summarize the text into 1 word: {{text}}');
-- Create a variable name for the model to do the summarizing
D CREATE MODEL('summarizer-model', 'gpt-4o', 128000);
-- Summarize text and pass it as parameter
D SELECT llm_complete('summarize', 'summarizer-model', {'text': 'We support more functions and approaches to combine relational analytics and semantic analysis. Check our repo for documentation and examples.'});
extended_description: |
This extension is experimental and potentially unstable. Do not use it in production.
8 changes: 4 additions & 4 deletions extensions/fuzzycomplete/description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ docs:
CREATE TABLE automobile_vehicles(serial_number text);
SELECT suggestion from sql_auto_complete(''SELECT * from veh'');
SELECT suggestion FROM sql_auto_complete(''SELECT * FROM veh'');
┌─────────────────────┐
Expand All @@ -64,7 +64,7 @@ docs:
└─────────────────────┘
select suggestion from sql_auto_complete(''SELECT * from auto'');
SELECT suggestion FROM sql_auto_complete(''SELECT * FROM auto'');
┌──────────────────────────────────────┐
Expand All @@ -89,7 +89,7 @@ docs:
└──────────────────────────────────────┘
SELECT suggestion from sql_auto_complete(''SELECT * from bar'');
SELECT suggestion FROM sql_auto_complete(''SELECT * FROM bar'');
┌──────────────────────────────────────┐
Expand All @@ -108,7 +108,7 @@ docs:
-- Demonstrate completion across databases/catalogs and schemas.
SELECT suggestion from sql_auto_complete(''SELECT * from table'');
SELECT suggestion FROM sql_auto_complete(''SELECT * FROM table'');
┌───────────────────────────────────────────────┐
Expand Down
57 changes: 57 additions & 0 deletions extensions/gsheets/description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
extension:
name: gsheets
description: Read and write Google Sheets using SQL
version: 0.0.2
language: C++
build: cmake
license: MIT
excluded_platforms: "windows_amd64_rtools;wasm_mvp;wasm_eh;wasm_threads"
maintainers:
- archiewood

repo:
github: evidence-dev/duckdb_gsheets
ref: 01bdf2872b78af1b9234792766392840fc4a91b7

docs:
hello_world: |
-- Authenticate with Google Account in the browser (easiest)
CREATE SECRET (TYPE gsheet);
-- OR create a secret with your Google API access token (boring, see extension docs)
CREATE SECRET (
TYPE gsheet,
PROVIDER access_token,
TOKEN '<your_token>'
);
-- Read a spreadsheet by full URL
FROM read_gsheet('https://docs.google.com/spreadsheets/d/11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8/edit');
-- Read a spreadsheet by full URL, implicitly
FROM 'https://docs.google.com/spreadsheets/d/11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8/edit';
-- Read a spreadsheet by spreadsheet id
FROM read_gsheet('11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8');
-- Read a spreadsheet with no header row
SELECT * FROM read_gsheet('11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8', headers=false);
-- Read a sheet other than the first sheet using the sheet name
SELECT * FROM read_gsheet('11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8', sheet='Sheet2');
-- Read a sheet other than the first sheet using the sheet id in the URL
SELECT * FROM read_gsheet('https://docs.google.com/spreadsheets/d/11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8/edit?gid=644613997#gid=644613997');
-- Write a spreadsheet from a table by spreadsheet id
COPY <table_name> TO '11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8' (FORMAT gsheet);
-- Write a spreadsheet from a table by full URL
COPY <table_name> TO 'https://docs.google.com/spreadsheets/d/11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8/edit?usp=sharing' (FORMAT gsheet);
-- Write a spreadsheet to a specific sheet using the sheet id in the URL
COPY <table_name> TO 'https://docs.google.com/spreadsheets/d/11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8/edit?gid=1295634987#gid=1295634987' (FORMAT gsheet);
extended_description: |
The DuckDB GSheets Extension allows reading and writing of data in Google Sheets from DuckDB.
For detailed setup and usage instructions, visit the docs at [duckdb-gsheets.com](https://duckdb-gsheets.com).
3 changes: 3 additions & 0 deletions extensions/gsheets/docs/function_description.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function,description,comment,example
read_gsheet,"Read a single sheet directly from a Google Sheet via the sheet URL, or spreadsheet ID.",,"SELECT * FROM read_gsheet('https://docs.google.com/spreadsheets/d/11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8/edit?gid=644613997#gid=644613997');"
"COPY TO","Write data from a table to a Google Sheet via the sheet URL, or spreadsheet ID.",,"COPY <table_name> TO 'https://docs.google.com/spreadsheets/d/11QdEasMWbETbFVxry-SsD8jVcdYIT1zBQszcF84MdE8/edit?gid=1295634987#gid=1295634987' (FORMAT gsheet);"
Loading

0 comments on commit 0acbb95

Please sign in to comment.