jekyll-sqlite 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85c5327f559510f9baa0eef20116398123e50254da7d75924c8d08e8883c7505
4
- data.tar.gz: 29329e963af9d41a2059fc91f2a56088f8a5e038ae890985028bec086c5a253d
3
+ metadata.gz: b968c4b7df9bfd1fbe127a29743b8a9ddc823b7db6438975621b63e7307e26f7
4
+ data.tar.gz: 8906f3acfec3fedf578755563953d2c5563f49cac45a4bb24b77d32ba2899d97
5
5
  SHA512:
6
- metadata.gz: f96eb487a5177930b82a19ef0ca5916f51bb4f6f89bfac8317d00dbb7be6ecf6700660765a13d5b5f34b4a6a3244658ced390d4b284ec0ccbf0d97cb6229af7d
7
- data.tar.gz: e74fb0ee889375285a718879f72cfea1a2c69899846ea62fd44d325b0154c65b8d8070ead3c33f48d458fcffe985864e7ec2dc665ed1a5639e9c156075ff62c9
6
+ metadata.gz: a9d02570d9db93418a10958a727917b2c37f56a5d4995185e9dfed857c7fabc2315c51229b59b9ec9c193de4dd5184bea067bbb16cfcb245096f167ec70af476
7
+ data.tar.gz: 53599208a2c848d8ca4cce454184d2da3d434f20f952d7b882a5b68c852934746885d586ed98544e2db9428ff9d018fb597ae17dc1420384d69f449b811fddd4
data/CHANGELOG.md CHANGED
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.2.1] - 2026-01-03
14
+ - Only passes named parameters in SQLite query. Requires sqlite3-ruby 2.9.0
15
+
13
16
  ## [0.2.0] - 2025-08-23
14
17
  - Multiple-levels of nesting is now supported
15
18
  - Slight performance improvement by keeping database open for entire plugin run
@@ -33,4 +36,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
36
 
34
37
  ## [0.1.0] - 2023-05-08
35
38
 
36
- - Initial release
39
+ - Initial release
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,46 @@
1
+ ---
2
+ title: Contribution Guide
3
+ ---
4
+
5
+ # Contributing to jekyll-sqlite
6
+
7
+ **This document is a work-in-progress.**
8
+
9
+ This doc is a short introduction on how to modify and maintain the sqlite3-ruby gem.
10
+
11
+ ## Making a Release
12
+
13
+ 0. Update `version.rb`
14
+ 0. Update CHANGELOG.md
15
+ 1. Run `bundle exec rake rubocop` to lint
16
+ 2. Commit + push
17
+ 3. If build passes, tag and push the tag.
18
+
19
+ Gem publication on rubygems automatically happens via GitHub Actions.
20
+
21
+ ## Running Tests
22
+
23
+ `bundle exec rake test`
24
+
25
+ ## Test Infrastructure
26
+
27
+ The tests are maintained in `test` directory as a separate jekyll website.
28
+ The site is built inside `Rakefile`, and it uses JSON output files as templates.
29
+
30
+ These JSON output files can then be used for testing the plugin.
31
+
32
+ ## Rubocop
33
+
34
+ Linting is mandatory to pass the CI.
35
+
36
+ ## Docs
37
+
38
+ Docs are maintained in docs/ directory as a separate Jekyll site that uses
39
+ just-the-docs theme. A few markdown files are symlinked inside docs so that
40
+ they get published to the website as well.
41
+
42
+ ## Demo
43
+
44
+ The demo is maintained separately on another repo, but the expectation is that
45
+ all important features are used in the demo. If you contribute such a change
46
+ that adds a new feature, please update the demo as well.
data/Gemfile CHANGED
@@ -6,9 +6,9 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  # These are development dependencies
9
+ gem "erb", "~> 6.0"
9
10
  gem "jekyll", "~> 4.4", ">= 4.4.1"
11
+ gem "logger", "~> 1.7"
10
12
  gem "rake", "~> 13.3"
11
13
  gem "rubocop", "~> 1.80"
12
14
  gem "rubocop-rake", "~> 0.7"
13
-
14
- gem "logger", "~> 1.7"
data/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) Nemo
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ ../CONTRIBUTING.md
data/docs/demo.md CHANGED
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  title: Demo
3
- permalink: /demo.html
4
3
  ---
5
4
 
6
5
  🏁 A fully-functional demo website that uses this plugin is available at
@@ -25,5 +24,7 @@ plugin to generate individual pages for each data item.
25
24
  in `config.yml`, but the query parameters are set in [`_data`](https://github.com/captn3m0/northwind/tree/main/_data)
26
25
  directory as YML files.
27
26
  5. The datapage plugin config generates a page for every product and customer.
27
+ 6. A multi-level nested query is used to generate a list of employees. See [Nested Query]({% link usage/nested.md %}) in docs.
28
+ 7. A permalink is set for all the customers by creating a permalink attribute in the select query: `SELECT ... as permalink`. Since we are setting a top-level attribute in the final page, it cannot be set alongside `page_data_prefix` in the datapage_gen configuration. See [this commit](https://github.com/captn3m0/northwind/commit/3d70d6a81be34af5f1ebbcfa5da09a170f2ee9ff) for the implementation. I'd suggest only using this when the `dir + name/name_expr` configuration in the `datapage` plugin fall short.
28
29
 
29
- The database is a trimmed-version of the northwind database from https://github.com/jpwhite3/northwind-SQLite3.
30
+ The database is a trimmed-version of the northwind database from <https://github.com/jpwhite3/northwind-SQLite3>.
data/docs/help.md ADDED
@@ -0,0 +1,14 @@
1
+ ---
2
+ title: Help
3
+ ---
4
+
5
+ Need help? You can file a new issue on GitHub at
6
+ <https://github.com/captn3m0/jekyll-sqlite/issues/new>.
7
+
8
+ This project is intended to be a safe, welcoming space for collaboration, and
9
+ contributors are expected to adhere to the [code of conduct][coc].
10
+
11
+ Note that only maintained versions of [Jekyll](https://endoflife.date/jekyll)
12
+ and [Ruby](https://endoflife.date/ruby) are supported.
13
+
14
+ [coc]: https://github.com/captn3m0/jekyll-sqlite/blob/main/CODE_OF_CONDUCT.md
data/docs/index.md CHANGED
@@ -21,6 +21,6 @@ for reshaping datasets - supporting joins, filters, and aggregations. So this
21
21
  allows you to use SQL for reshaping your data, and then use liquid
22
22
  for what it was meant for - presentation and templating.
23
23
 
24
- [![Continuous Integration](https://github.com/captn3m0/jekyll-sqlite/actions/workflows/main.yml/badge.svg)](https://github.com/captn3m0/jekyll-sqlite/actions/workflows/main.yml) [![Gem Version](https://badge.fury.io/rb/jekyll-sqlite.svg)](https://badge.fury.io/rb/jekyll-sqlite)
24
+ [![Continuous Integration](https://github.com/captn3m0/jekyll-sqlite/actions/workflows/main.yml/badge.svg)](https://github.com/captn3m0/jekyll-sqlite/actions/workflows/main.yml) [![Gem Version](https://badge.fury.io/rb/jekyll-sqlite.svg)](https://rubygems.org/gems/jekyll-sqlite)
25
25
 
26
26
  [df]: https://jekyllrb.com/docs/datafiles/ "Data Files at Jekyll Docs site"
@@ -41,7 +41,7 @@ Note that the `datapage_gen` plugin will run _after_ the `jekyll-sqlite` plugin,
41
41
 
42
42
  ## Demo Example
43
43
 
44
- The following example comes from the [Demo](../demo/).
44
+ The following example comes from the [Demo]({% link demo.md %}).
45
45
 
46
46
  The following datapage configuration in `_config.yml`:
47
47
 
data/docs/usage/nested.md CHANGED
@@ -5,7 +5,7 @@ nav_order: 4
5
5
  ---
6
6
  Starting from `0.2.0`, queries can be nested infinitely.
7
7
 
8
- The following configuration is used in the [demo](../demo/):
8
+ The following configuration is used in the [Demo]({% link demo.md %}):
9
9
 
10
10
  ```yaml
11
11
  sqlite:
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.bindir = "exe"
28
28
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
- spec.add_dependency "sqlite3", "~> 2.7.3"
30
+ spec.add_dependency "sqlite3", "~> 2.9.0"
31
31
  spec.metadata["rubygems_mfa_required"] = "true"
32
32
  end
@@ -49,10 +49,12 @@ module JekyllSQlite
49
49
  # Since we don't know if the query needs them
50
50
  # we ignore all errors about "no such bind parameter"
51
51
  def _prepare_query(stmt, params)
52
- params.each do |key, value|
53
- stmt.bind_param key, value
54
- rescue StandardError => e
55
- raise e unless e.message.include? "no such bind parameter"
52
+ stmt.named_params.each do |key|
53
+ val = params[key]
54
+ unless [Integer, String, Float, SQLite3::Blob, nil].include? val.class
55
+ Jekyll.logger.error "#{key} type is #{val.class} in query: #{stmt.get_sql}"
56
+ end
57
+ stmt.bind_param key, params[key]
56
58
  end
57
59
  end
58
60
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Sqlite
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-sqlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nemo
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 2.7.3
18
+ version: 2.9.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 2.7.3
25
+ version: 2.9.0
26
26
  email:
27
27
  - jekyll-sqlite@captnemo.in
28
28
  executables: []
@@ -32,15 +32,19 @@ files:
32
32
  - ".rubocop.yml"
33
33
  - CHANGELOG.md
34
34
  - CODE_OF_CONDUCT.md
35
+ - CONTRIBUTING.md
35
36
  - Gemfile
37
+ - LICENSE
36
38
  - README.md
37
39
  - Rakefile
38
40
  - docs/.gitignore
39
41
  - docs/404.html
40
42
  - docs/CHANGELOG.md
43
+ - docs/CONTRIBUTING.md
41
44
  - docs/Gemfile
42
45
  - docs/_config.yml
43
46
  - docs/demo.md
47
+ - docs/help.md
44
48
  - docs/img/northwind-1.jpg
45
49
  - docs/img/northwind-2.jpg
46
50
  - docs/index.md