Heka Redshift Helper Functions (DB connection required)
1. Functions
1.1. get_create_table_sql
Arguments
- name (string) - database table name
- schema (table) - schema table
Return
- sql (string) - SQL create table statement
1.2. esc_timestamp
Arguments
- v (number) - timestamp in nano seconds since Jan 1, 1970
Return
- TIMESTAMP (string)
1.3. esc_varchar
Arguments
- con (userdata) - sql connection object
- v (string) - string to escape
- max (integer) - maximum string length (truncate if longer)
Return
- VARCHAR (string)
1.4. write_message
Apply the schema and write the formatted message to disk.
Arguments
- fh (userdata) - file handle
- schema (table) - schema table
- con (userdata) - sql connection object
Return
- none
source code: sql.lua