Module: Doterd::DSL

Defined in:
lib/doterd.rb

Overview

Default erd dsl

Examples:

# creats tables
table(:t1) {
  col_1 Integer, "some comments"
  col_2 String,  "some comments"
  col_3 "String, Not Null", "some comments"
}

table(:t2) {
  id
  t1_id
}

# create table relations
_1_1 :t1, :t2

Defined Under Namespace

Classes: Table

Instance Method Summary collapse

Instance Method Details

#config {|Doterd.config| ... } ⇒ Object

Yields:



188
189
190
# File 'lib/doterd.rb', line 188

def config(&block)
  yield Doterd.config
end

#table(name, &block) ⇒ Object



192
193
194
# File 'lib/doterd.rb', line 192

def table(name, &block)
  Table.new(name, &block)
end