You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository is based on https://github.com/duckdb/extension-template, check it out if you want to build and ship your own DuckDB extension.
3
+
This extension allows you to consume Kafka messages through a DuckDB Table function that connects to a Kafka broker and streams messages as a table.
4
4
5
-
---
5
+
> The extension is a WIP and not functional! Join if you're willing to contribute!
6
6
7
-
This extension, Kafquack, allow you to ... <extension_goal>.
7
+
## Examples
8
8
9
-
10
-
## Building
11
-
### Managing dependencies
12
-
DuckDB extensions uses VCPKG for dependency management. Enabling VCPKG is very simple: follow the [installation instructions](https://vcpkg.io/en/getting-started) or just run the following:
Note: VCPKG is only required for extensions that want to rely on it for dependency management. If you want to develop an extension without dependencies, or want to do your own dependency management, just skip this step. Note that the example extension uses VCPKG to build with a dependency for instructive purposes, so when skipping this step the build may not work without removing the dependency.
-`duckdb` is the binary for the duckdb shell with the extension code automatically loaded.
32
-
-`unittest` is the test runner of duckdb. Again, the extension is already linked into the binary.
33
-
-`kafquack.duckdb_extension` is the loadable binary as it would be distributed.
34
-
35
-
## Running the extension
36
-
To run the extension code, simply start the shell with `./build/release/duckdb`.
37
-
38
-
Now we can use the features from the extension directly in DuckDB. The template contains a single scalar function `kafquack()` that takes a string arguments and returns a string:
39
-
```
40
-
D select kafquack('Jane') as result;
41
-
┌───────────────┐
42
-
│ result │
43
-
│ varchar │
44
-
├───────────────┤
45
-
│ Kafquack Jane 🐥 │
46
-
└───────────────┘
47
-
```
48
-
49
-
## Running the tests
50
-
Different tests can be created for DuckDB extensions. The primary way of testing DuckDB extensions should be the SQL tests in `./test/sql`. These SQL tests can be run using:
51
-
```sh
52
-
make test
53
-
```
54
-
55
-
### Installing the deployed binaries
56
-
To install your extension binaries from S3, you will need to do two things. Firstly, DuckDB should be launched with the
57
-
`allow_unsigned_extensions` option set to true. How to set this will depend on the client you're using. Some examples:
58
-
59
-
CLI:
60
-
```shell
61
-
duckdb -unsigned
62
-
```
63
-
64
-
Python:
65
-
```python
66
-
con = duckdb.connect(':memory:', config={'allow_unsigned_extensions' : 'true'})
67
-
```
68
-
69
-
NodeJS:
70
-
```js
71
-
db =newduckdb.Database(':memory:', {"allow_unsigned_extensions":"true"});
72
-
```
73
-
74
-
Secondly, you will need to set the repository endpoint in DuckDB to the HTTP url of your bucket + version of the extension
75
-
you want to install. To do this run the following SQL query in DuckDB:
9
+
#### Basic usage:
76
10
```sql
77
-
SET custom_extension_repository='bucket.s3.eu-west-1.amazonaws.com/<your_extension_name>/latest';
0 commit comments