Skip to content

Commit b736943

Browse files
committed
crontime!
1 parent 89f2e18 commit b736943

16 files changed

+398
-539
lines changed

.github/workflows/ExtensionTemplate.yml

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

.github/workflows/MainDistributionPipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
with:
1919
duckdb_version: main
2020
ci_tools_version: main
21-
extension_name: quack
21+
extension_name: cronjob
2222

2323
duckdb-stable-build:
2424
name: Build extension binaries
2525
uses: duckdb/extension-ci-tools/.github/workflows/[email protected]
2626
with:
2727
duckdb_version: v1.1.3
2828
ci_tools_version: v1.1.3
29-
extension_name: quack
29+
extension_name: cronjob
3030

3131
duckdb-stable-deploy:
3232
name: Deploy extension binaries
@@ -35,5 +35,5 @@ jobs:
3535
secrets: inherit
3636
with:
3737
duckdb_version: v1.1.3
38-
extension_name: quack
38+
extension_name: cronjob
3939
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55
[submodule "extension-ci-tools"]
66
path = extension-ci-tools
77
url = https://github.com/duckdb/extension-ci-tools
8-
branch = main
8+
branch = main
9+
[submodule "ccronexpr"]
10+
path = ccronexpr
11+
url = https://github.com/staticlibs/ccronexpr

CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
# Set extension name here
4-
set(TARGET_NAME quack)
5-
6-
# DuckDB's extension distribution supports vcpkg. As such, dependencies can be added in ./vcpkg.json and then
7-
# used in cmake with find_package. Feel free to remove or replace with other dependencies.
8-
# Note that it should also be removed from vcpkg.json to prevent needlessly installing it..
3+
set(TARGET_NAME cronjob)
94
find_package(OpenSSL REQUIRED)
105

6+
# Add ccronexpr library
7+
add_library(ccronexpr STATIC ccronexpr/ccronexpr.c)
8+
target_include_directories(ccronexpr PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ccronexpr)
9+
1110
set(EXTENSION_NAME ${TARGET_NAME}_extension)
1211
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
13-
1412
project(${TARGET_NAME})
15-
include_directories(src/include)
1613

17-
set(EXTENSION_SOURCES src/quack_extension.cpp)
14+
# Set extension sources
15+
set(EXTENSION_SOURCES src/cronjob_extension.cpp)
16+
include_directories(src/include ccronexpr)
1817

19-
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
20-
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})
18+
# Build extension
19+
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES} ccronexpr/ccronexpr.c)
20+
build_loadable_extension(${TARGET_NAME} "" ${EXTENSION_SOURCES} ccronexpr/ccronexpr.c)
2121

22-
# Link OpenSSL in both the static library as the loadable extension
22+
# Link OpenSSL
2323
target_link_libraries(${EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto)
2424
target_link_libraries(${LOADABLE_EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto)
2525

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=cronjob
55
EXT_CONFIG=${PROJ_DIR}extension_config.cmake
66

77
# Include the Makefile from extension-ci-tools

docs/NEXT_README.md renamed to README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Quack
1+
# Cronjob
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, Cronjob, 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/cronjob/cronjob.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+
- `cronjob.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 `cronjob()` that takes a string arguments and returns a string:
3939
```
40-
D select quack('Jane') as result;
40+
D select cronjob('Jane') as result;
4141
┌───────────────┐
4242
│ result │
4343
│ varchar │
4444
├───────────────┤
45-
Quack Jane 🐥 │
45+
Cronjob 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 cronjob
85+
LOAD cronjob
8686
```

ccronexpr

Submodule ccronexpr added at 5d7e772

0 commit comments

Comments
 (0)