honker 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +193 -2
- data/ext/honker/extconf.rb +69 -0
- data/ext/honker/honker-core/Cargo.toml +49 -0
- data/ext/honker/honker-core/LICENSE +6 -0
- data/ext/honker/honker-core/LICENSE-APACHE +176 -0
- data/ext/honker/honker-core/LICENSE-MIT +21 -0
- data/ext/honker/honker-core/README.md +30 -0
- data/ext/honker/honker-core/src/cron.rs +473 -0
- data/ext/honker/honker-core/src/honker_ops.rs +1518 -0
- data/ext/honker/honker-core/src/kernel_watcher.rs +434 -0
- data/ext/honker/honker-core/src/lib.rs +3116 -0
- data/ext/honker/honker-core/src/shm_watcher.rs +250 -0
- data/ext/honker/honker-extension/Cargo.toml +36 -0
- data/ext/honker/honker-extension/LICENSE +6 -0
- data/ext/honker/honker-extension/LICENSE-APACHE +176 -0
- data/ext/honker/honker-extension/LICENSE-MIT +21 -0
- data/ext/honker/honker-extension/README.md +41 -0
- data/ext/honker/honker-extension/src/lib.rs +330 -0
- data/honker.gemspec +24 -1
- data/lib/honker/README.md +28 -0
- data/lib/honker/railtie.rb +11 -0
- data/lib/honker/scheduler.rb +59 -0
- data/lib/honker/version.rb +1 -1
- data/lib/honker.rb +111 -3
- metadata +39 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6d4ec2fd1faf6bbe935f087e8b6bcc28e875ee35c5c1212106d4d6fcf4e4eb70
|
|
4
|
+
data.tar.gz: fbec7fc3f448934b848f2aa4af73c257aacb2dbb6e2bfc1ce9a04944b2b5cff1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c20783f45f36b00c477c656843aa786b062990bc7b419034005a039dfce70705142716dda245168d3027e5f51e0c74091ce4bdaa9d3afb577745f999d9ee373
|
|
7
|
+
data.tar.gz: 75dd17ed09ca7ee424cf145f64a6d94abedfa960b6864001b6a7ef29cee2cd2e0338cc9a67abfe491dc36b83bbf913f6b26468ecfc07aaf54a93e18e8f8aa725
|
data/README.md
CHANGED
|
@@ -9,11 +9,202 @@ Full docs:
|
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
|
+
Add it to your `Gemfile`:
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
# Gemfile
|
|
16
|
+
gem "honker"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
then `bundle install`. Or install it directly:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
gem install honker
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Honker is a thin Ruby wrapper around a SQLite loadable extension
|
|
26
|
+
written in Rust. How that extension reaches your gem install depends on
|
|
27
|
+
your platform, with a fallback to compile the extension for other
|
|
28
|
+
platforms.
|
|
29
|
+
|
|
30
|
+
Most platforms (x86_64 and arm64 for Linux, arm64 for macOS) get a
|
|
31
|
+
platform gem with the extension already built and bundled inside it:
|
|
32
|
+
|
|
33
|
+
| Platform | Triple |
|
|
34
|
+
| ------------------- | --------------- |
|
|
35
|
+
| x86_64 Linux | `x86_64-linux` |
|
|
36
|
+
| arm64 Linux | `aarch64-linux` |
|
|
37
|
+
| Apple Silicon macOS | `arm64-darwin` |
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
gem install honker
|
|
41
|
+
# Fetching honker-0.2.0-arm64-darwin.gem
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`Honker::Database.new("app.db")` then finds the bundled extension
|
|
45
|
+
automatically.
|
|
46
|
+
|
|
47
|
+
### Where the bundled extension lives
|
|
48
|
+
|
|
49
|
+
It is shipped inside the gem under `lib/honker/`, with a filename that
|
|
50
|
+
follows the host OS's native shared-library convention:
|
|
51
|
+
|
|
52
|
+
| Host OS | Extension file | Why this name |
|
|
53
|
+
| ------- | -------------------------------- | -------------------------------------------- |
|
|
54
|
+
| Linux | `lib/honker/libhonker_ext.so` | `lib` prefix, `.so` (shared object) |
|
|
55
|
+
| macOS | `lib/honker/libhonker_ext.dylib` | `lib` prefix, `.dylib` (dynamic library) |
|
|
56
|
+
| Windows | `lib/honker/honker_ext.dll` | no `lib` prefix, `.dll` (dynamic-link lib) |
|
|
57
|
+
|
|
58
|
+
`Honker::Database.new` checks the host OS at load time and resolves to
|
|
59
|
+
the matching filename, so you usually do not need to think about it.
|
|
60
|
+
You only see the difference if you build the extension yourself or set
|
|
61
|
+
`HONKER_EXTENSION_PATH`, in which case the file you point at must match
|
|
62
|
+
the OS the Ruby process is running on.
|
|
63
|
+
|
|
64
|
+
To find the installed copy:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
gem which honker # => …/gems/honker-0.2.0-arm64-darwin/lib/honker.rb
|
|
68
|
+
ls "$(dirname "$(gem which honker)")/honker"
|
|
69
|
+
# libhonker_ext.dylib ...
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Overriding the extension path
|
|
73
|
+
|
|
74
|
+
To point at a different copy of the extension (a local dev build, a
|
|
75
|
+
sidecar mounted into a container, a system path) pass `extension_path:`
|
|
76
|
+
or set `HONKER_EXTENSION_PATH`; both override the bundled file.
|
|
77
|
+
|
|
78
|
+
```ruby
|
|
79
|
+
Honker::Database.new("app.db", extension_path: "./libhonker_ext.dylib")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
HONKER_EXTENSION_PATH=/opt/honker/libhonker_ext.so ruby app.rb
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Source gem (compiles on install, needs Rust)
|
|
87
|
+
|
|
88
|
+
Every other platform (Intel macOS, Windows, anything else) gets the
|
|
89
|
+
generic gem, which ships the Rust crate source and compiles the
|
|
90
|
+
extension during `gem install`. Install [`rustc` and `cargo`](https://rustup.rs)
|
|
91
|
+
first; otherwise the install fails with a clear message pointing at
|
|
92
|
+
rustup.
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
gem install honker
|
|
96
|
+
# Fetching honker-0.2.0.gem
|
|
97
|
+
# Building native extensions. This could take a while...
|
|
98
|
+
# honker: building the SQLite extension with cargo
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The compiled artifact lands in the same `lib/honker/` directory as the
|
|
102
|
+
prebuilt gems, so `Honker::Database.new` finds it the same way.
|
|
103
|
+
|
|
104
|
+
### Installing from git
|
|
105
|
+
|
|
106
|
+
`honker` lives in a subdirectory of a polyglot monorepo, so a `github:`
|
|
107
|
+
dependency needs Bundler's `glob:` option to point at the gemspec. A
|
|
108
|
+
git checkout has no prebuilt extension, so it always takes the
|
|
109
|
+
compile-on-install path and needs `rustc`:
|
|
110
|
+
|
|
111
|
+
```ruby
|
|
112
|
+
# Gemfile
|
|
113
|
+
gem "honker",
|
|
114
|
+
github: "russellromney/honker",
|
|
115
|
+
glob: "packages/honker-ruby/honker.gemspec"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
To pin to a branch, tag, or commit, add `branch:`, `tag:`, or `ref:`:
|
|
119
|
+
|
|
12
120
|
```ruby
|
|
121
|
+
# Gemfile
|
|
122
|
+
gem "honker",
|
|
123
|
+
github: "russellromney/honker",
|
|
124
|
+
glob: "packages/honker-ruby/honker.gemspec",
|
|
125
|
+
branch: "main"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Using Honker alongside an ORM
|
|
129
|
+
|
|
130
|
+
`honker-ruby` opens its own `SQLite3::Database` handle (via the
|
|
131
|
+
[`sqlite3`](https://rubygems.org/gems/sqlite3) gem) and loads the
|
|
132
|
+
extension into it. To share a single SQLite file (and a single
|
|
133
|
+
transaction) with Rails/ActiveRecord, Sequel, ROM, or Hanami::DB, get
|
|
134
|
+
the underlying `sqlite3` gem connection your ORM is already using and
|
|
135
|
+
load the Honker extension into that handle, so `honker_enqueue(...)`
|
|
136
|
+
and friends are callable from inside one of its transactions.
|
|
137
|
+
|
|
138
|
+
### Rails / ActiveRecord
|
|
139
|
+
|
|
140
|
+
Point ActiveRecord at the bundled extension via `database.yml`:
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
# config/database.yml
|
|
144
|
+
production:
|
|
145
|
+
adapter: sqlite3
|
|
146
|
+
database: app.sqlite3
|
|
147
|
+
extensions:
|
|
148
|
+
- <%= Honker.extension_path %>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
```ruby
|
|
152
|
+
# Gemfile
|
|
13
153
|
gem "honker"
|
|
14
154
|
```
|
|
15
155
|
|
|
16
|
-
|
|
156
|
+
That's it. `Honker::Railtie` runs `Honker.bootstrap` against
|
|
157
|
+
`ActiveRecord::Base.connection` in `config.after_initialize`, so no
|
|
158
|
+
initializer is required.
|
|
159
|
+
|
|
160
|
+
Multi-database apps still need to call `Honker.bootstrap(some_other_conn)`
|
|
161
|
+
themselves for non-primary connections.
|
|
162
|
+
|
|
163
|
+
### Sequel (and ROM / Hanami::DB)
|
|
164
|
+
|
|
165
|
+
`Honker.sequel_after_connect` returns the right `after_connect:` proc,
|
|
166
|
+
so each new connection in the pool gets the extension loaded and the
|
|
167
|
+
schema bootstrapped:
|
|
168
|
+
|
|
169
|
+
```ruby
|
|
170
|
+
require "sequel"
|
|
171
|
+
require "honker"
|
|
172
|
+
|
|
173
|
+
DB = Sequel.connect(
|
|
174
|
+
"sqlite://app.sqlite3",
|
|
175
|
+
after_connect: Honker.sequel_after_connect,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
DB.synchronize do |conn|
|
|
179
|
+
conn.execute("SELECT honker_enqueue('emails', '{}', NULL, NULL, 0, 3, NULL)")
|
|
180
|
+
end
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
To bootstrap once from a migration instead of on every connect, pass
|
|
184
|
+
`bootstrap: false`:
|
|
185
|
+
|
|
186
|
+
```ruby
|
|
187
|
+
DB = Sequel.connect(
|
|
188
|
+
"sqlite://app.sqlite3",
|
|
189
|
+
after_connect: Honker.sequel_after_connect(bootstrap: false),
|
|
190
|
+
)
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Setup helpers
|
|
194
|
+
|
|
195
|
+
Both recipes above are built from the same module-level helpers, which
|
|
196
|
+
wrap the extension-load and `honker_bootstrap()` ceremony:
|
|
197
|
+
|
|
198
|
+
```ruby
|
|
199
|
+
Honker.extension_path # => bundled path (or HONKER_EXTENSION_PATH override)
|
|
200
|
+
Honker.load_extension(conn) # enable_load_extension(true) → load → enable_load_extension(false)
|
|
201
|
+
Honker.bootstrap(conn) # SELECT honker_bootstrap()
|
|
202
|
+
Honker.setup(conn) # load_extension then bootstrap
|
|
203
|
+
Honker.sequel_after_connect # proc { |conn| Honker.setup(conn) } for Sequel/Rom/Hanami
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
See the per-ORM walkthroughs at
|
|
207
|
+
[honker.dev/guides/orm/ruby](https://honker.dev/guides/orm/ruby/).
|
|
17
208
|
|
|
18
209
|
## Watcher backends
|
|
19
210
|
|
|
@@ -28,7 +219,7 @@ the matching feature.
|
|
|
28
219
|
```ruby
|
|
29
220
|
require "honker"
|
|
30
221
|
|
|
31
|
-
db = Honker::Database.new("app.db"
|
|
222
|
+
db = Honker::Database.new("app.db")
|
|
32
223
|
q = db.queue("emails")
|
|
33
224
|
|
|
34
225
|
q.enqueue({to: "alice@example.com"})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
#
|
|
3
|
+
# Builds the Honker SQLite loadable extension when the generic (source)
|
|
4
|
+
# gem is installed. Precompiled platform gems ship the extension and do
|
|
5
|
+
# not run this. A Rust toolchain is required; see https://rustup.rs.
|
|
6
|
+
#
|
|
7
|
+
# RubyGems runs this script and then `make`. It does the cargo build
|
|
8
|
+
# itself, drops the artifact in lib/honker/, and writes a no-op Makefile.
|
|
9
|
+
|
|
10
|
+
require "rbconfig"
|
|
11
|
+
require "fileutils"
|
|
12
|
+
|
|
13
|
+
ext_dir = __dir__
|
|
14
|
+
|
|
15
|
+
manifest = [
|
|
16
|
+
File.join(ext_dir, "honker-extension", "Cargo.toml"), # vendored in the gem
|
|
17
|
+
File.expand_path("../../../../honker-extension/Cargo.toml", ext_dir), # repo checkout (github:)
|
|
18
|
+
].find { |path| File.file?(path) }
|
|
19
|
+
|
|
20
|
+
if manifest.nil?
|
|
21
|
+
abort "honker: honker-extension crate source not found; cannot build the extension"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
cargo_found = system("cargo", "--version", out: File::NULL, err: File::NULL)
|
|
25
|
+
unless cargo_found
|
|
26
|
+
abort <<~MSG
|
|
27
|
+
honker: cannot build the SQLite extension because the Rust toolchain
|
|
28
|
+
(cargo) was not found on PATH.
|
|
29
|
+
|
|
30
|
+
This is the honker source gem; it compiles the extension on install.
|
|
31
|
+
To fix this, either:
|
|
32
|
+
* install Rust from https://rustup.rs and reinstall honker, or
|
|
33
|
+
* use a precompiled platform gem (published for x86_64 Linux,
|
|
34
|
+
arm64 Linux, and Apple Silicon macOS).
|
|
35
|
+
MSG
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
ext_name =
|
|
39
|
+
case RbConfig::CONFIG.fetch("host_os")
|
|
40
|
+
when /mswin|mingw|cygwin/ then "honker_ext.dll"
|
|
41
|
+
when /darwin/ then "libhonker_ext.dylib"
|
|
42
|
+
else "libhonker_ext.so"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
target_dir = File.join(ext_dir, "target")
|
|
46
|
+
|
|
47
|
+
puts "honker: building the SQLite extension with cargo"
|
|
48
|
+
system(
|
|
49
|
+
{ "CARGO_TARGET_DIR" => target_dir },
|
|
50
|
+
"cargo", "build", "--release", "--manifest-path", manifest,
|
|
51
|
+
exception: true,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
artifact = File.join(target_dir, "release", ext_name)
|
|
55
|
+
abort "honker: cargo build did not produce #{artifact}" unless File.file?(artifact)
|
|
56
|
+
|
|
57
|
+
dest_dir = File.expand_path("../../lib/honker", ext_dir)
|
|
58
|
+
FileUtils.mkdir_p(dest_dir)
|
|
59
|
+
FileUtils.cp(artifact, File.join(dest_dir, ext_name))
|
|
60
|
+
FileUtils.rm_rf(target_dir)
|
|
61
|
+
puts "honker: extension ready at lib/honker/#{ext_name}"
|
|
62
|
+
|
|
63
|
+
# RubyGems runs `make` after this script; the build is already done, so
|
|
64
|
+
# the Makefile only needs targets that succeed as no-ops.
|
|
65
|
+
File.write(File.join(ext_dir, "Makefile"), <<~MAKEFILE)
|
|
66
|
+
all:
|
|
67
|
+
clean:
|
|
68
|
+
install:
|
|
69
|
+
MAKEFILE
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "honker-core"
|
|
3
|
+
version = "0.2.3"
|
|
4
|
+
edition = "2024"
|
|
5
|
+
description = "Shared Rust foundation for Honker bindings (SQLite loadable extension, PyO3, napi-rs, and friends). Not intended for direct use."
|
|
6
|
+
license = "MIT OR Apache-2.0"
|
|
7
|
+
repository = "https://github.com/russellromney/honker"
|
|
8
|
+
homepage = "https://honker.dev"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
keywords = ["sqlite", "queue", "pubsub", "notify", "honker"]
|
|
11
|
+
categories = ["database", "concurrency"]
|
|
12
|
+
|
|
13
|
+
[features]
|
|
14
|
+
bundled-sqlite = ["rusqlite/bundled"]
|
|
15
|
+
# Optional kernel-watch backend: use OS filesystem notifications as wake
|
|
16
|
+
# hints (still verifies via PRAGMA data_version). Experimental.
|
|
17
|
+
kernel-watcher = ["dep:libc", "dep:notify"]
|
|
18
|
+
# Optional shm fast path: read the SQLite WAL index shared-memory file
|
|
19
|
+
# directly instead of running PRAGMA data_version. Experimental.
|
|
20
|
+
shm-fast-path = ["dep:memmap2"]
|
|
21
|
+
|
|
22
|
+
[lib]
|
|
23
|
+
name = "honker_core"
|
|
24
|
+
# Plain rlib — no cdylib, no Python/Node/C ABI here. Consumed as a
|
|
25
|
+
# regular Cargo dependency by the three binding crates.
|
|
26
|
+
|
|
27
|
+
[dependencies]
|
|
28
|
+
chrono = { version = "0.4", default-features = false, features = ["clock"] }
|
|
29
|
+
parking_lot = "0.12.5"
|
|
30
|
+
rusqlite = { version = "0.39.0", features = ["functions", "hooks"] }
|
|
31
|
+
thiserror = "2.0.18"
|
|
32
|
+
# Optional: kernel-watch backend.
|
|
33
|
+
# macos_kqueue: on macOS, use kqueue (RecommendedWatcher = KqueueWatcher) instead of
|
|
34
|
+
# FSEvents. FSEvents has a 1 s batching latency — worse than 1 ms polling. kqueue
|
|
35
|
+
# delivers per-event notifications immediately, matching the intent of this backend.
|
|
36
|
+
notify = { version = "6", optional = true, features = ["macos_kqueue"] }
|
|
37
|
+
# Optional: shm fast path.
|
|
38
|
+
memmap2 = { version = "0.9", optional = true }
|
|
39
|
+
libc = { version = "0.2", optional = true }
|
|
40
|
+
|
|
41
|
+
# file-id only supports unix and windows. Other targets (WASI, Redox,
|
|
42
|
+
# illumos, etc.) get the `(0, 0)` fallback in stat_identity.
|
|
43
|
+
[target.'cfg(any(unix, windows))'.dependencies]
|
|
44
|
+
file-id = "0.2.3"
|
|
45
|
+
|
|
46
|
+
[dev-dependencies]
|
|
47
|
+
# chrono-tz only in tests — lets us exercise DST edge cases with a
|
|
48
|
+
# fixed timezone (US/Eastern) regardless of where tests run.
|
|
49
|
+
chrono-tz = "0.10"
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Russell Romney
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# honker-core
|
|
2
|
+
|
|
3
|
+
Shared Rust foundation for [Honker](https://honker.dev) bindings. Not intended for direct use — consumed by `honker-extension` (the SQLite loadable extension), the Python binding, `honker-node`, `honker-rs`, and future bindings.
|
|
4
|
+
|
|
5
|
+
If you want to *use* Honker:
|
|
6
|
+
|
|
7
|
+
| Language | Package | Repo |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Any SQLite client | `honker-extension` on crates.io (or prebuilt `.dylib`/`.so`) | [russellromney/honker](https://github.com/russellromney/honker) |
|
|
10
|
+
| Rust | `honker` on crates.io | [russellromney/honker-rs](https://github.com/russellromney/honker-rs) |
|
|
11
|
+
| Python | `pip install honker` | (inside the main repo) |
|
|
12
|
+
| Node | `@honker/node` on npm | [russellromney/honker-node](https://github.com/russellromney/honker-node) |
|
|
13
|
+
| Go | `go get github.com/russellromney/honker-go` | [russellromney/honker-go](https://github.com/russellromney/honker-go) |
|
|
14
|
+
| Ruby | `gem install honker` | [russellromney/honker-ruby](https://github.com/russellromney/honker-ruby) |
|
|
15
|
+
| Elixir | `{:honker, "~> 0.1"}` | [russellromney/honker-ex](https://github.com/russellromney/honker-ex) |
|
|
16
|
+
| Bun | `bun add honker-bun` | [russellromney/honker-bun](https://github.com/russellromney/honker-bun) |
|
|
17
|
+
|
|
18
|
+
## What this crate provides
|
|
19
|
+
|
|
20
|
+
- `open_conn(path, install_notify)` — open a SQLite connection with Honker's PRAGMA defaults and optional `notify()` install.
|
|
21
|
+
- `attach_notify(conn)` — register the `notify()` SQL scalar + `_honker_notifications` table.
|
|
22
|
+
- `attach_honker_functions(conn)` — register every `honker_*` SQL scalar (queues, streams, scheduler, rate limits, locks, results).
|
|
23
|
+
- `bootstrap_honker_schema(conn)` — idempotent DDL for all `_honker_*` tables.
|
|
24
|
+
- `Writer` / `Readers` — single-writer slot + bounded reader pool with blocking and non-blocking acquire.
|
|
25
|
+
- `SharedUpdateWatcher` — one PRAGMA-polling thread per database fanning out to N subscribers.
|
|
26
|
+
- `cron::next_after_unix(expr, from_unix)` — standard 5-field crontab parser + next-fire calculator with local-TZ + DST handling.
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
Apache-2.0.
|