Skip to content

Commit

Permalink
bootstrap template
Browse files Browse the repository at this point in the history
  • Loading branch information
samansmink committed Mar 22, 2024
1 parent 6953a73 commit 21190dc
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 446 deletions.
177 changes: 0 additions & 177 deletions .github/workflows/ExtensionTemplate.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: duckdb/extension-ci-tools/.github/workflows/[email protected]
with:
duckdb_version: v0.10.1
extension_name: quack
extension_name: url_parser

duckdb-stable-deploy:
name: Deploy extension binaries
Expand All @@ -26,5 +26,5 @@ jobs:
secrets: inherit
with:
duckdb_version: v0.10.1
extension_name: quack
extension_name: url_parser
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8.12)

# Set extension name here
set(TARGET_NAME quack)
set(TARGET_NAME url_parser)

# DuckDB's extension distribution supports vcpkg. As such, dependencies can be added in ./vcpkg.json and then
# used in cmake with find_package. Feel free to remove or replace with other dependencies.
Expand All @@ -14,7 +14,7 @@ set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
project(${TARGET_NAME})
include_directories(src/include)

set(EXTENSION_SOURCES src/quack_extension.cpp)
set(EXTENSION_SOURCES src/url_parser_extension.cpp)

build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJ_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

# Configuration of extension
EXT_NAME=quack
EXT_NAME=url_parser
EXT_CONFIG=${PROJ_DIR}extension_config.cmake

# Include the Makefile from extension-ci-tools
Expand Down
18 changes: 9 additions & 9 deletions docs/NEXT_README.md → README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Quack
# Url_parser

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.

---

This extension, Quack, allow you to ... <extension_goal>.
This extension, Url_parser, allow you to ... <extension_goal>.


## Building
Expand All @@ -26,23 +26,23 @@ The main binaries that will be built are:
```sh
./build/release/duckdb
./build/release/test/unittest
./build/release/extension/quack/quack.duckdb_extension
./build/release/extension/url_parser/url_parser.duckdb_extension
```
- `duckdb` is the binary for the duckdb shell with the extension code automatically loaded.
- `unittest` is the test runner of duckdb. Again, the extension is already linked into the binary.
- `quack.duckdb_extension` is the loadable binary as it would be distributed.
- `url_parser.duckdb_extension` is the loadable binary as it would be distributed.

## Running the extension
To run the extension code, simply start the shell with `./build/release/duckdb`.

Now we can use the features from the extension directly in DuckDB. The template contains a single scalar function `quack()` that takes a string arguments and returns a string:
Now we can use the features from the extension directly in DuckDB. The template contains a single scalar function `url_parser()` that takes a string arguments and returns a string:
```
D select quack('Jane') as result;
D select url_parser('Jane') as result;
┌───────────────┐
│ result │
│ varchar │
├───────────────┤
Quack Jane 🐥 │
Url_parser Jane 🐥 │
└───────────────┘
```

Expand Down Expand Up @@ -81,6 +81,6 @@ DuckDB. To specify a specific version, you can pass the version instead.

After running these steps, you can install and load your extension using the regular INSTALL/LOAD commands in DuckDB:
```sql
INSTALL quack
LOAD quack
INSTALL url_parser
LOAD url_parser
```
Loading

0 comments on commit 21190dc

Please sign in to comment.