mitranim / sqlp

[MOVED] Parser for rewriting foreign code embedded in SQL

Home Page:https://godoc.org/github.com/mitranim/sqlp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Moved to https://github.com/mitranim/sqlb. This repo is usable but frozen.

Overview

SQL Parse: parser and formatter for rewriting foreign code embedded in SQL queries, such as parameter placeholders: $1 or :ident, or code encased in delimiters: () [] {}. Anything the parser doesn't recognize is preserved as text.

API docs: https://pkg.go.dev/github.com/mitranim/sqlp.

Changelog

v0.3.0

Renamed method .Append in various types to .AppendTo for consistency with other libraries.

v0.2.0

Various optimizations.

  • Added Type, Region, Token for use by the tokenizer; see below.

  • Tokenization is now allocation-free and around x2 faster in benchmarks. Instead of generating Node instances, the tokenizer generates stack-allocated Token instances.

v0.1.4

Added NodeWhitespace. This is emitted for any non-zero amount of whitespace. NodeText now contains only non-whitespace. The performance impact seems negligible.

v0.1.3

Support incremental parsing via Tokenizer. Added a few utility functions related to tree traversal. Minor breaking renaming.

v0.1.2

Added missing (*Error).Unwrap.

v0.1.1

Replaced []rune with string. When parsing, we treat the input string as UTF-8, decoding on the fly.

v0.1.0

First tagged release.

License

https://unlicense.org

Misc

I'm receptive to suggestions. If this library almost satisfies you but needs changes, open an issue or chat me up. Contacts: https://mitranim.com/#contacts

About

[MOVED] Parser for rewriting foreign code embedded in SQL

https://godoc.org/github.com/mitranim/sqlp

License:The Unlicense


Languages

Language:Go 98.9%Language:Makefile 1.1%