Parser
Inherits Reference / Object
Constants
LINE_RE = /^\s*--\s*name:\s*([a-z\_\?\!0-9]+)(\(.*?\)|).*?$/
NAME_HINT_RE = /^\s*--\s*name\b/
PARAM_RAW_RE = /\{\{\!(.*?)\}\}/
PARAM_RE = /\{\{(.*?)\}\}/
Constructors
new(lines : Array(String), source : String = "(unknown)")
SourceInstance methods
define_method(metadata, sql)
Sourceget_metadata(meta)
Sourcemalformed_metadata_hint?(line)
Sourcemetadata?(line)
checks if the given line contains metadata example: -- name: get_users(name, surname)
parse
Sourceparse_sql(sql, line_index : Int32 | Nil)
Sourceparse_sql(sql)
Sourceraise_parse_error(message, line_index : Int32 | Nil)
Sourceset_indent(sql)
Sourcesource_reference
Sourcevalidate_placeholders!(sql, line_index : Int32 | Nil)
Source