An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

github.com/mitranim/sqlp

Parser and formatter for rewriting foreign code embedded in SQL queries, such as parameter placeholders: `$1` or `:ident`, or code encased in delimiters: `()` `[]` `{}`. It supports the following SQL features: • ” : single quotes. • "" : double quotes. • “ : grave quotes (non-standard). • -- : line comments. • /* : block comments. • :: : Postgres-style cast operator (non-standard). In addition, it supports the following: • () : content in parens. • [] : content in brackets. • {} : content in braces. • $1 $2 ... : ordinal parameter placeholders. • :identifier : named parameter placeholders. Supporting SQL quotes and comments allows us to correctly ignore text inside special delimiters that happens to be part of a string, quoted identifier, or comment. This library supports incremental parsing token by token, via `Tokenizer`. It also lets you convert a sequence of tokens into a fully-built AST via `Parser`. Choose the approach that better suits your use case. Oversimplified example: The AST now looks like this:

Ecosystem
proxy.golang.org
Latest Release
v0.3.0
almost 3 years ago
Versions
7
Dependent Packages
1
Dependent Repos
1
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/mitranim/sqlp
spec
License Unlicense
Namespace github.com/mitranim
First Release over 5 years ago
Last Synced 22 days ago
Keywords
go parser sql
Repository
Stars 1 on GitHub
Forks 0 on GitHub
Rankings on proxy.golang.org
Dependent packages Top 5.5%
Dependent repos Top 4.8%