Releases: mpyw/bisql
Releases · mpyw/bisql
Release list
v0.1.3
v0.1.2
v0.1.1
v0.1.0
The first release of bisql — a two-way SQL template engine for Go.
Directives are written as SQL comments, so a template is valid SQL a client can run as-is, while an application converts the same text into a parameterized statement (SQL, Args).
Highlights
- Explicit model — the renderer emits the template verbatim, evaluating only directives and stripping parser comments. No implicit clause/connector removal, no whitespace normalization; the author anchors dynamic fragments (
1 = 1/ a leading connector). - Directives — bind (
/* */), inline literal (/*^ */), conditional (/*%if/elseif/else/end*/), iteration (/*%for*/), and@includefor reusable fragments (recursive, cycle-guarded). - Bind expansion by test-literal shape — a parenthesized test expands an iterable into an IN-list; a scalar test binds a slice as one array parameter (PostgreSQL
= ANY(...)). - Dialects — MySQL, SQLite, PostgreSQL, Oracle, SQL Server (placeholder generation + literal formatting).
- Loaders —
RegistryLoader,FSLoader,LoaderFunc,StackedLoader;ParseFile/ExpandFileover anyfs.FS. - Reviewable output —
Statement.SQLWithArgs()renders a values-embedded form on demand (review only, never execute).
See the README for the directive reference and authoring rules, and pkg.go.dev for the API and runnable examples.
go get github.com/mpyw/bisql@v0.1.0