Skip to content

Commit 24bebee

Browse files
committed
initial commit
1 parent c95bfed commit 24bebee

File tree

12 files changed

+48
-135
lines changed

12 files changed

+48
-135
lines changed

.github/workflows/MainDistributionPipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ jobs:
2020
with:
2121
duckdb_version: main
2222
ci_tools_version: main
23-
extension_name: quack
23+
extension_name: textplot
2424

2525
duckdb-stable-build:
2626
name: Build extension binaries
2727
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.3.2
2828
with:
2929
duckdb_version: v1.3.2
3030
ci_tools_version: v1.3.2
31-
extension_name: quack
31+
extension_name: textplot
3232

3333
code-quality-check:
3434
name: Code Quality Check
3535
uses: duckdb/extension-ci-tools/.github/workflows/_extension_code_quality.yml@main
3636
with:
3737
duckdb_version: v1.3.2
3838
ci_tools_version: main
39-
extension_name: quack
39+
extension_name: textplot
4040
format_checks: 'format;tidy'

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
cmake_minimum_required(VERSION 3.5)
22

33
# Set extension name here
4-
set(TARGET_NAME quack)
4+
set(TARGET_NAME textplot)
5+
6+
set(CMAKE_CXX_STANDARD 17)
7+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
58

69
# DuckDB's extension distribution supports vcpkg. As such, dependencies can be added in ./vcpkg.json and then
710
# used in cmake with find_package. Feel free to remove or replace with other dependencies.
811
# Note that it should also be removed from vcpkg.json to prevent needlessly installing it..
9-
find_package(OpenSSL REQUIRED)
1012

1113
set(EXTENSION_NAME ${TARGET_NAME}_extension)
1214
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
1315

1416
project(${TARGET_NAME})
1517
include_directories(src/include)
1618

17-
set(EXTENSION_SOURCES src/quack_extension.cpp)
19+
set(EXTENSION_SOURCES src/textplot_extension.cpp)
1820

1921
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
2022
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})
2123

2224
# Link OpenSSL in both the static library as the loadable extension
23-
target_link_libraries(${EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto)
24-
target_link_libraries(${LOADABLE_EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto)
25+
target_link_libraries(${EXTENSION_NAME})
26+
target_link_libraries(${LOADABLE_EXTENSION_NAME})
2527

2628
install(
2729
TARGETS ${EXTENSION_NAME}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PROJ_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
22

33
# Configuration of extension
4-
EXT_NAME=quack
4+
EXT_NAME=textplot
55
EXT_CONFIG=${PROJ_DIR}extension_config.cmake
66

77
# Include the Makefile from extension-ci-tools

docs/NEXT_README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Quack
1+
# Textplot
22

33
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.
44

55
---
66

7-
This extension, Quack, allow you to ... <extension_goal>.
7+
This extension, Textplot, allow you to ... <extension_goal>.
88

99

1010
## Building
@@ -26,23 +26,23 @@ The main binaries that will be built are:
2626
```sh
2727
./build/release/duckdb
2828
./build/release/test/unittest
29-
./build/release/extension/quack/quack.duckdb_extension
29+
./build/release/extension/textplot/textplot.duckdb_extension
3030
```
3131
- `duckdb` is the binary for the duckdb shell with the extension code automatically loaded.
3232
- `unittest` is the test runner of duckdb. Again, the extension is already linked into the binary.
33-
- `quack.duckdb_extension` is the loadable binary as it would be distributed.
33+
- `textplot.duckdb_extension` is the loadable binary as it would be distributed.
3434

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

38-
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:
38+
Now we can use the features from the extension directly in DuckDB. The template contains a single scalar function `textplot()` that takes a string arguments and returns a string:
3939
```
40-
D select quack('Jane') as result;
40+
D select textplot('Jane') as result;
4141
┌───────────────┐
4242
│ result │
4343
│ varchar │
4444
├───────────────┤
45-
Quack Jane 🐥 │
45+
Textplot Jane 🐥 │
4646
└───────────────┘
4747
```
4848

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

8282
After running these steps, you can install and load your extension using the regular INSTALL/LOAD commands in DuckDB:
8383
```sql
84-
INSTALL quack
85-
LOAD quack
84+
INSTALL textplot
85+
LOAD textplot
8686
```

docs/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This repository contains a template for creating a DuckDB extension. The main goal of this template is to allow users to easily develop, test and distribute their own DuckDB extension. The main branch of the template is always based on the latest stable DuckDB allowing you to try out your extension right away.
33

44
## Getting started
5-
First step to getting started is to create your own repo from this template by clicking `Use this template`. Then clone your new repository using
5+
First step to getting started is to create your own repo from this template by clicking `Use this template`. Then clone your new repository using
66
```sh
77
git clone --recurse-submodules https://github.com/<you>/<your-new-extension-repo>.git
88
```
@@ -30,7 +30,7 @@ The main binaries that will be built are:
3030
./build/release/test/unittest
3131
./build/release/extension/<extension_name>/<extension_name>.duckdb_extension
3232
```
33-
- `duckdb` is the binary for the duckdb shell with the extension code automatically loaded.
33+
- `duckdb` is the binary for the duckdb shell with the extension code automatically loaded.
3434
- `unittest` is the test runner of duckdb. Again, the extension is already linked into the binary.
3535
- `<extension_name>.duckdb_extension` is the loadable binary as it would be distributed.
3636

@@ -44,16 +44,16 @@ GEN=ninja make
4444
```
4545

4646
## Running the extension
47-
To run the extension code, simply start the shell with `./build/release/duckdb`. This shell will have the extension pre-loaded.
47+
To run the extension code, simply start the shell with `./build/release/duckdb`. This shell will have the extension pre-loaded.
4848

49-
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:
49+
Now we can use the features from the extension directly in DuckDB. The template contains a single scalar function `textplot()` that takes a string arguments and returns a string:
5050
```
51-
D select quack('Jane') as result;
51+
D select textplot('Jane') as result;
5252
┌───────────────┐
5353
│ result │
5454
│ varchar │
5555
├───────────────┤
56-
Quack Jane 🐥 │
56+
Textplot Jane 🐥 │
5757
└───────────────┘
5858
```
5959

@@ -92,7 +92,7 @@ To distribute your extension binaries, there are a few options.
9292
The recommended way of distributing extensions is through the [community extensions repository](https://github.com/duckdb/community-extensions).
9393
This repository is designed specifically for extensions that are built using this extension template, meaning that as long as your extension can be
9494
built using the default CI in this template, submitting it to the community extensions is a very simple process. The process works similarly to popular
95-
package managers like homebrew and vcpkg, where a PR containing a descriptor file is submitted to the package manager repository. After the CI in the
95+
package managers like homebrew and vcpkg, where a PR containing a descriptor file is submitted to the package manager repository. After the CI in the
9696
community extensions repository completes, the extension can be installed and loaded in DuckDB with:
9797
```SQL
9898
INSTALL <my_extension> FROM community;
@@ -125,18 +125,18 @@ LOAD <my_extension>
125125
```
126126

127127
### Versioning of your extension
128-
Extension binaries will only work for the specific DuckDB version they were built for. The version of DuckDB that is targeted
129-
is set to the latest stable release for the main branch of the template so initially that is all you need. As new releases
128+
Extension binaries will only work for the specific DuckDB version they were built for. The version of DuckDB that is targeted
129+
is set to the latest stable release for the main branch of the template so initially that is all you need. As new releases
130130
of DuckDB are published however, the extension repository will need to be updated. The template comes with a workflow set-up
131131
that will automatically build the binaries for all DuckDB target architectures that are available in the corresponding DuckDB
132132
version. This workflow is found in `.github/workflows/MainDistributionPipeline.yml`. It is up to the extension developer to keep
133-
this up to date with DuckDB. Note also that its possible to distribute binaries for multiple DuckDB versions in this workflow
133+
this up to date with DuckDB. Note also that its possible to distribute binaries for multiple DuckDB versions in this workflow
134134
by simply duplicating the jobs.
135135

136-
## Setting up CLion
136+
## Setting up CLion
137137

138138
### Opening project
139-
Configuring CLion with the extension template requires a little work. Firstly, make sure that the DuckDB submodule is available.
139+
Configuring CLion with the extension template requires a little work. Firstly, make sure that the DuckDB submodule is available.
140140
Then make sure to open `./duckdb/CMakeLists.txt` (so not the top level `CMakeLists.txt` file from this repo) as a project in CLion.
141141
Now to fix your project path go to `tools->CMake->Change Project Root`([docs](https://www.jetbrains.com/help/clion/change-project-root-directory.html)) to set the project root to the root dir of this repo.
142142

extension_config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is included by DuckDB's build system. It specifies which extension to load
22

33
# Extension from this repo
4-
duckdb_extension_load(quack
4+
duckdb_extension_load(textplot
55
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
66
LOAD_TESTS
77
)

scripts/bootstrap-template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ def replace_placeholders(file_name: str) -> None:
172172
files_to_search.extend(Path("./src").rglob("./**/*.txt"))
173173
files_to_search.extend(Path("./src").rglob("./*.md"))
174174

175-
replace_everywhere("quack", name_extension)
176-
replace_everywhere("Quack", name_extension.capitalize())
175+
replace_everywhere("textplot", name_extension)
176+
replace_everywhere("Textplot", name_extension.capitalize())
177177
replace_everywhere("<extension_name>", name_extension)
178178

179179
remove_placeholder()
180180

181181
string_to_replace = name_extension
182-
string_to_find = "quack"
182+
string_to_find = "textplot"
183183

184184
# rename files
185185
os.rename(f"test/sql/{string_to_find}.test", f"test/sql/{string_to_replace}.test")

src/include/quack_extension.hpp

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/quack_extension.cpp

Lines changed: 0 additions & 73 deletions
This file was deleted.

test/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Testing this extension
2-
This directory contains all the tests for this extension. The `sql` directory holds tests that are written as [SQLLogicTests](https://duckdb.org/dev/sqllogictest/intro.html). DuckDB aims to have most its tests in this format as SQL statements, so for the quack extension, this should probably be the goal too.
2+
This directory contains all the tests for this extension. The `sql` directory holds tests that are written as [SQLLogicTests](https://duckdb.org/dev/sqllogictest/intro.html). DuckDB aims to have most its tests in this format as SQL statements, so for the textplot extension, this should probably be the goal too.
33

44
The root makefile contains targets to build and run all of these tests. To run the SQLLogicTests:
55
```bash
66
make test
77
```
8-
or
8+
or
99
```bash
1010
make test_debug
1111
```

0 commit comments

Comments
 (0)