Closed finanalyst closed 4 months ago
@dontlaugh may be this branch could be made into something like the docs-dev branch? Then you could make commits to it to access the sqlite database
@patrickbkr @dontlaugh the sqlite file created when this plugin is run during a build of the website is a valid database file. I tested it by installing sqlite3
, opening it with no database, then running .read sqlite-db-definition.sql
. A select * from routines
generates all the data. limit the output as there are hundreds of rows.
@dontlaugh may be this branch could be made into something like the docs-dev branch? Then you could make commits to it to access the sqlite database
No. I don't want to have another custom deployment branch.
@dontlaugh Attached is a zip of the sqlite file generated from a test collection of RakuDoc documents. I'm not sure what you mean by 'on the fly'. The PR here is a plugin that uses data collected during a build of the HTML site and formats it into a sql file. A similar dataset that can be reformatted is the data used for the search plugin. Is this what you mean by 'on the fly'?
Two things:
%processed
parameter provided to the compilation stage plugin. However, this is again 'on the fly' (if I understood you properly).What I mean is that I would prefer it if this PR contained one standalone SQL file with the following contents:
CREATE TABLE IF NOT EXISTS routines (
Category TEXT,
Name TEXT,
Type TEXT,
URL TEXT
);
-- future schema changes below...
This lets us test updates to database structure without invoking a build. I understand that this would yield an empty database. That's actually good, because schema changes will often necessitate changes to INSERT statements.
Could such a schema.sql could live next to the other plugin code?
@dontlaugh I am trying to understand this request. Are you saying that there should be two files, a schema
file like the one above, and a data
one with the INSERT ...
lines? The build process would only generate the data file.
So we could have
I'll add commits to the branch to do this.
configs/03-plugin-options.raku
config file, so changing the value of thedb-filename
field of thesqlite-db
sub-hash changes the output file name.