class FluentQuery::Driver
Represents abstract query driver. @abstract
Attributes
Public Class Methods
Initializes driver.
# File lib/fluent-query/driver.rb, line 25 def initialize(connection) if self.instance_of? FluentQuery::Driver not_implemented end @connection = connection end
Public Instance Methods
Builds given query. @abstract
# File lib/fluent-query/driver.rb, line 107 def build_query(query) not_implemented end
Checks query conditionally. It’s called after first token of the query.
@since 0.9.2
# File lib/fluent-query/driver.rb, line 285 def check_conditionally(query, sym, *args, &block) end
Closes the connection. @abstract
# File lib/fluent-query/driver.rb, line 240 def close_connection! not_implemented end
Corrects token before it’s pushed to the token. So allows to modify data assigned to the query from driver level.
@since 0.9.2
# File lib/fluent-query/driver.rb, line 296 def correct_token(name, args) return [name, args] end
Executes the query and returns count of the changed/inserted rows. @abstract
# File lib/fluent-query/driver.rb, line 260 def do(query) not_implemented end
Executes the query. @abstract
# File lib/fluent-query/driver.rb, line 250 def execute(query) not_implemented end
Indicates token is known. @abstract
# File lib/fluent-query/driver.rb, line 52 def known_token?(group, token_name) not_implemented end
Returns native connection. @abstract
# File lib/fluent-query/driver.rb, line 230 def native_connection not_implemented end
Creates system-dependent NULL. @abstract
# File lib/fluent-query/driver.rb, line 172 def null not_implemented end
Opens the connection.
It’s lazy, so it will open connection before first request through {@link native_connection
()} method.
@abstract
# File lib/fluent-query/driver.rb, line 220 def open_connection(settings) not_implemented end
Indicates, token is operator. @abstract
# File lib/fluent-query/driver.rb, line 62 def operator_token?(token_name) not_implemented end
Generates prepared query. Should be noted, if driver doesn’t support query preparing, it should be not_implemented
and unimplemented.
@abstract
# File lib/fluent-query/driver.rb, line 273 def prepare(query) not_implemented end
Indicates which query subclass to use. @abstract
# File lib/fluent-query/driver.rb, line 97 def query_class not_implemented end
Quotes system-dependent boolean value. @abstract
# File lib/fluent-query/driver.rb, line 182 def quote_boolean(boolean) not_implemented end
Quotes system-dependent date value. @abstract
# File lib/fluent-query/driver.rb, line 192 def quote_date_time(date) not_implemented end
Returns correct equality operator for given datatype.
Must handle two modes:
* "assigning" which classicaly keeps for example the '=' operator, * "comparing" which sets for example 'IS' operator for booleans.
@abstract
# File lib/fluent-query/driver.rb, line 87 def quote_equality(datatype, mode = :comparing) not_implemented end
Quotes float.
@abstract
# File lib/fluent-query/driver.rb, line 152 def quote_float(float) not_implemented end
Quotes field by field quoting. @abstract
# File lib/fluent-query/driver.rb, line 162 def quote_identifier(field) not_implemented end
Quoting integer.
@abstract
# File lib/fluent-query/driver.rb, line 142 def quote_integer(integer) not_implemented end
Returns operator string according to operator symbol. @abstract
# File lib/fluent-query/driver.rb, line 72 def quote_operator(operator) not_implemented end
Returns preparation placeholder according to given library placeholder.
@abstract
# File lib/fluent-query/driver.rb, line 119 def quote_placeholder(placeholder) not_implemented end
Quotes string.
@abstract
# File lib/fluent-query/driver.rb, line 132 def quote_string(string) not_implemented end
Quotes system-dependent subquery. @abstract
# File lib/fluent-query/driver.rb, line 202 def quote_subquery(subquery) not_implemented end
Indicates, method is relevant for the driver. @abstract
# File lib/fluent-query/driver.rb, line 41 def relevant_method?(name) not_implemented end