pg_sql_lexer v0.1.5

I needed a way to 'minify' SQL statements in another crystal project. This turned out to be quite tricky so I figured the easiest way was to create a simple lexer and use the tokens to generate a minified representation. This lexer is also written in Crystal (obviously) 😀.

pg_sql_lexer

I needed a way to 'minify' SQL statements in another Crystal project. This turned out to be quite tricky so I figured the easiest way was to create a simple lexer and use the tokens to generate a minified representation. This lexer is also written in Crystal (obviously) 😀.

Build Status

Installation

  • Add the dependency to your shard.yml:
dependencies:
  pg_sql_lexer:
    github: horrendo/pg_sql_lexer
  • Run shards install

Usage

require "pg_sql_lexer"
:
raw_sql = {slurp from a file maybe}
minified = PgSqlLexer::Formatter.new(PgSqlLexer::Lexer.new(raw_sql).tokens).format_minified
:

You can access the documentation here

Contributing

  1. Fork it (https://github.com/horrendo/pg_sql_lexer/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

pg_sql_lexer

Owner
Statistic
  • 1
  • 0
  • 0
  • 1
  • 1
  • over 2 years ago
  • September 18, 2020
License

MIT License

Links
Synced at

Sun, 19 May 2024 01:20:20 GMT

Languages