hirakiuc / fluent-plugin-pgsql_fingerprint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fluent-plugin-pgsql_fingerprint

Checks Code Climate Test Coverage

A Fluent filter plugin to convert postgres sql to sql's fingerprint.

NOTE

This fluent plugin is inspired by fluent-plugin-sql_fingerprint.

Use fluent-plugin-sql_fingerprint if you want to get sql fingerprint for mysql sql.

And this fluent plugin depends on pg_query gem to normalize postgres sql.

Requirements

Install

gem install fluent-plugin-pgsql_fingerprint

Configuration

<filter tag.dummy.*>
  type pgsql_fingerprint
</filter>

Sample

A record like this.

{
  "sql": "SELECT * FROM demo WHERE record = 'AAA';"
}

This fluent plugin filter the record, like this. (Add added_key attribute with normalized sql.)

{
  "sql": "SELECT * FROM demo WHERE record = 'AAA';"
  "fingerprint": "SELECT * FROM demo WHERE record = ?;"
}

License

See LICENSE.

About

License:MIT License


Languages

Language:Ruby 100.0%