jekyll-sqlite
Advanced tools
| --- | ||
| title: Contribution Guide | ||
| --- | ||
| # Contributing to jekyll-sqlite | ||
| **This document is a work-in-progress.** | ||
| This doc is a short introduction on how to modify and maintain the sqlite3-ruby gem. | ||
| ## Making a Release | ||
| 0. Update `version.rb` | ||
| 0. Update CHANGELOG.md | ||
| 1. Run `bundle exec rake rubocop` to lint | ||
| 2. Commit + push | ||
| 3. If build passes, tag and push the tag. | ||
| Gem publication on rubygems automatically happens via GitHub Actions. | ||
| ## Running Tests | ||
| `bundle exec rake test` | ||
| ## Test Infrastructure | ||
| The tests are maintained in `test` directory as a separate jekyll website. | ||
| The site is built inside `Rakefile`, and it uses JSON output files as templates. | ||
| These JSON output files can then be used for testing the plugin. | ||
| ## Rubocop | ||
| Linting is mandatory to pass the CI. | ||
| ## Docs | ||
| Docs are maintained in docs/ directory as a separate Jekyll site that uses | ||
| just-the-docs theme. A few markdown files are symlinked inside docs so that | ||
| they get published to the website as well. | ||
| ## Demo | ||
| The demo is maintained separately on another repo, but the expectation is that | ||
| all important features are used in the demo. If you contribute such a change | ||
| that adds a new feature, please update the demo as well. |
+14
| --- | ||
| title: Help | ||
| --- | ||
| Need help? You can file a new issue on GitHub at | ||
| <https://github.com/captn3m0/jekyll-sqlite/issues/new>. | ||
| This project is intended to be a safe, welcoming space for collaboration, and | ||
| contributors are expected to adhere to the [code of conduct][coc]. | ||
| Note that only maintained versions of [Jekyll](https://endoflife.date/jekyll) | ||
| and [Ruby](https://endoflife.date/ruby) are supported. | ||
| [coc]: https://github.com/captn3m0/jekyll-sqlite/blob/main/CODE_OF_CONDUCT.md |
+8
| The MIT License (MIT) | ||
| Copyright (c) Nemo | ||
| 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: | ||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
| 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. |
+4
-1
@@ -13,2 +13,5 @@ --- | ||
| ## [0.2.1] - 2026-01-03 | ||
| - Only passes named parameters in SQLite query. Requires sqlite3-ruby 2.9.0 | ||
| ## [0.2.0] - 2025-08-23 | ||
@@ -37,2 +40,2 @@ - Multiple-levels of nesting is now supported | ||
| - Initial release | ||
| - Initial release |
+3
-2
| --- | ||
| title: Demo | ||
| permalink: /demo.html | ||
| --- | ||
@@ -28,3 +27,5 @@ | ||
| 5. The datapage plugin config generates a page for every product and customer. | ||
| 6. A multi-level nested query is used to generate a list of employees. See [Nested Query]({% link usage/nested.md %}) in docs. | ||
| 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. | ||
| The database is a trimmed-version of the northwind database from https://github.com/jpwhite3/northwind-SQLite3. | ||
| The database is a trimmed-version of the northwind database from <https://github.com/jpwhite3/northwind-SQLite3>. |
+1
-1
@@ -24,4 +24,4 @@ --- | ||
| [](https://github.com/captn3m0/jekyll-sqlite/actions/workflows/main.yml) [](https://badge.fury.io/rb/jekyll-sqlite) | ||
| [](https://github.com/captn3m0/jekyll-sqlite/actions/workflows/main.yml) [](https://rubygems.org/gems/jekyll-sqlite) | ||
| [df]: https://jekyllrb.com/docs/datafiles/ "Data Files at Jekyll Docs site" |
@@ -44,3 +44,3 @@ --- | ||
| The following example comes from the [Demo](../demo/). | ||
| The following example comes from the [Demo]({% link demo.md %}). | ||
@@ -47,0 +47,0 @@ The following datapage configuration in `_config.yml`: |
@@ -8,3 +8,3 @@ --- | ||
| The following configuration is used in the [demo](../demo/): | ||
| The following configuration is used in the [Demo]({% link demo.md %}): | ||
@@ -11,0 +11,0 @@ ```yaml |
+2
-2
@@ -9,7 +9,7 @@ # frozen_string_literal: true | ||
| # These are development dependencies | ||
| gem "erb", "~> 6.0" | ||
| gem "jekyll", "~> 4.4", ">= 4.4.1" | ||
| gem "logger", "~> 1.7" | ||
| gem "rake", "~> 13.3" | ||
| gem "rubocop", "~> 1.80" | ||
| gem "rubocop-rake", "~> 0.7" | ||
| gem "logger", "~> 1.7" |
@@ -30,4 +30,4 @@ # frozen_string_literal: true | ||
| spec.require_paths = ["lib"] | ||
| spec.add_dependency "sqlite3", "~> 2.7.3" | ||
| spec.add_dependency "sqlite3", "~> 2.9.0" | ||
| spec.metadata["rubygems_mfa_required"] = "true" | ||
| end |
@@ -52,6 +52,8 @@ # frozen_string_literal: true | ||
| def _prepare_query(stmt, params) | ||
| params.each do |key, value| | ||
| stmt.bind_param key, value | ||
| rescue StandardError => e | ||
| raise e unless e.message.include? "no such bind parameter" | ||
| stmt.named_params.each do |key| | ||
| val = params[key] | ||
| unless [Integer, String, Float, SQLite3::Blob, nil].include? val.class | ||
| Jekyll.logger.error "#{key} type is #{val.class} in query: #{stmt.get_sql}" | ||
| end | ||
| stmt.bind_param key, params[key] | ||
| end | ||
@@ -58,0 +60,0 @@ end |
@@ -5,4 +5,4 @@ # frozen_string_literal: true | ||
| module Sqlite | ||
| VERSION = "0.2.0" | ||
| VERSION = "0.2.1" | ||
| end | ||
| end |