Module: Momomoto

Defined in:
lib/momomoto/base.rb,
lib/momomoto/row.rb,
lib/momomoto/order.rb,
lib/momomoto/table.rb,
lib/momomoto/database.rb,
lib/momomoto/procedure.rb,
lib/momomoto/datatype/base.rb,
lib/momomoto/datatype/date.rb,
lib/momomoto/datatype/inet.rb,
lib/momomoto/datatype/real.rb,
lib/momomoto/datatype/text.rb,
lib/momomoto/datatype/array.rb,
lib/momomoto/datatype/bytea.rb,
lib/momomoto/datatype/bigint.rb,
lib/momomoto/datatype/boolean.rb,
lib/momomoto/datatype/integer.rb,
lib/momomoto/datatype/numeric.rb,
lib/momomoto/datatype/interval.rb,
lib/momomoto/datatype/smallint.rb,
lib/momomoto/datatype/character.rb,
lib/momomoto/datatype/array/base.rb,
lib/momomoto/datatype/array/text.rb,
lib/momomoto/datatype/array/integer.rb,
lib/momomoto/datatype/character_varying.rb,
lib/momomoto/information_schema/columns.rb,
lib/momomoto/datatype/time_with_time_zone.rb,
lib/momomoto/datatype/time_without_time_zone.rb,
lib/momomoto/datatype/timestamp_with_time_zone.rb,
lib/momomoto/datatype/timestamp_without_time_zone.rb,
lib/momomoto/information_schema/fetch_procedure_columns.rb,
lib/momomoto/information_schema/fetch_procedure_parameters.rb

Overview

Momomoto is a database abstraction layer

Defined Under Namespace

Modules: Datatype, Information_schema Classes: Base, ConversionError, CriticalError, Database, Error, Nothing_found, Order, Procedure, Row, Table, Too_many_records

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.debugObject

Getter and setter for debugging. If debug evaluates to true then all SQL queries to the database are printed to STDOUT.



13
14
15
# File 'lib/momomoto/base.rb', line 13

def debug
  @debug
end

.verboseObject

Getter and setter for verbose mode. If verbose evaluates to true the exception message of exceptions will include the SQL statement causing the exception.



18
19
20
# File 'lib/momomoto/base.rb', line 18

def verbose
  @verbose
end

Class Method Details

.asc(*args) ⇒ Object

Returns an instance of Order::Asc where args is either a single or array of Symbol representing columns.

Eases the use of class Order::Asc. You can use it whenever selecting rows or in #default_order.

order_lower = Momomoto.asc( :person )
  => #<Momomoto::Order::Asc:0x5184131c @fields=[:person]>
Table.select( {}, {:order => order} )
  => returns Table's rows ordered asc by column person


44
45
46
# File 'lib/momomoto/base.rb', line 44

def asc( *args )
  Momomoto::Order::Asc.new( *args )
end

.desc(*args) ⇒ Object

Returns an instance of Order::Asc where args is either a single or array of Symbol representing columns.

Eases the use of class Order::Desc. You can use it whenever selecting rows or in #default_order.

order_lower = Momomoto.lower( :person )
  => #<Momomoto::Order::Desc:0x5184131c @fields=[:person]>
Table.select( {}, {:order => order} )
  => returns Table's rows ordered desc by column person


58
59
60
# File 'lib/momomoto/base.rb', line 58

def desc( *args )
  Momomoto::Order::Desc.new( *args )
end

.lower(*args) ⇒ Object

Returns an instance of Order::Lower where args is either a single or array of Symbol representing columns.

Eases the use of class Order::Lower. You can use it whenever selecting rows or in #default_order.

order_lower = Momomoto.lower( :person )
  => #<Momomoto::Order::Lower:0x5184131c @fields=[:person]>
Table.select( {}, {:order => order} )
  => returns Table's rows ordered case-insensitively by column person


30
31
32
# File 'lib/momomoto/base.rb', line 30

def lower( *args )
  Momomoto::Order::Lower.new( *args )
end