Module: Og

Defined in:
lib/og.rb,
lib/og/store.rb,
lib/og/types.rb,
lib/og/entity.rb,
lib/og/errors.rb,
lib/og/manager.rb,
lib/og/markers.rb,
lib/og/relation.rb,
lib/og/evolution.rb,
lib/og/store/sql.rb,
lib/og/collection.rb,
lib/og/store/kirby.rb,
lib/glue/taggable_old.rb,
lib/og/relation/has_one.rb,
lib/og/relation/has_many.rb,
lib/og/store/alpha/kirby.rb,
lib/og/relation/refers_to.rb,
lib/og/store/alpha/memory.rb,
lib/og/relation/belongs_to.rb,
lib/og/relation/joins_many.rb,
lib/og/store/alpha/filesys.rb,
lib/og/relation/many_to_many.rb,
lib/og/store/alpha/sqlserver.rb,
lib/og/store/sqlite.rb,
lib/og/store/mysql.rb

Overview

class Sqlserver::Result

def blank?
  0 == num_rows
end

alias_method :next, :fetch_row  

def each_row
  each do |row|
    yield(row, 0)
  end
end

def first_value
  val = fetch_row[0]
  free
  return val
end

alias_method :close, :free

end

Defined Under Namespace

Modules: EntityMixin, MemoryUtils, MysqlUtils, RelationDSL, SchemaInheritanceBase, SqlUtils, SqlserverUtils, Unmanageable Classes: BelongsTo, Blob, Collection, Entity, FilesysStore, HasMany, HasManyCollection, HasOne, JoinsMany, JoinsManyCollection, KirbyStore, Manager, ManyToMany, MemoryStore, MysqlStore, RefersTo, Relation, SqlStore, SqliteStore, SqlserverStore, Store, StoreException, Tag

Constant Summary collapse

Version =

The version.

'0.24.0'
LibPath =

Library path.

File.dirname(__FILE__)
NotNull =
{ :sql => 'NOT NULL' }.freeze
Null =
{ :sql => 'NULL' }.freeze

Class Method Summary collapse

Class Method Details

.escape(str) ⇒ Object

Helper method.



123
124
125
# File 'lib/og.rb', line 123

def escape(str)
  @@manager.store.escape(str)
end

.setup(options = {:store => :sqlite}) ⇒ Object Also known as: connect, options=, start

Helper method, useful to initialize Og. If no options are passed, sqlite is selected as the default store.



112
113
114
115
116
# File 'lib/og.rb', line 112

def setup(options = {:store => :sqlite})
  m = @@manager = Manager.new(options)
  m.manage_classes
  return m
end

.VarChar(size) ⇒ Object

Some useful type macros to help when defining properties. You can easily code your own type macros. Just return the array that should be passed to the property macro.

Example

property :name, VarChar(30)



11
12
13
# File 'lib/og/types.rb', line 11

def self.VarChar(size)
  return String, :sql => "VARCHAR(#{size})"
end