Sha256: 9ef98187a19f6637fbcca0e0c38a2a26a9259c8df571c0770f6376df96753b28
Contents?: true
Size: 1.42 KB
Versions: 6
Compression:
Stored size: 1.42 KB
Contents
class Card module Query # interpret CQL queries, transform them into SQL, and run them. class CardQuery < AbstractQuery include Clause include Run include SpecialAttributes include RelationalAttributes include ReferenceAttributes include AttributeHelper include Interpretation include Normalization include Sorting include Conjunctions # Query Execution # By default a query returns card objects. This is accomplished by returning # a card identifier from SQL and then hooking into our caching system (see # Card::Fetch) def self.viewable_sql Card::Query::SqlStatement.new.permission_conditions("cards") end def table "cards" end def table_prefix "c" end def initialize statement, comment=nil super statement @comment = comment || default_comment interpret @statement end def default_comment return if @superquery || !Card.config.sql_comments statement.to_s end # Query Hierarchy # @root, @subqueries, and @superquery are used to track a hierarchy of # query objects. This nesting allows to find, for example, cards that # link to cards that link to cards.... def limit mods[:limit].to_i end def full? !superquery && mods[:return] != "count" end end end end
Version data entries
6 entries across 6 versions & 1 rubygems