Module: RBase
- Defined in:
- lib/rbase/table.rb,
lib/rbase/record.rb,
lib/rbase/schema.rb,
lib/rbase/builder.rb,
lib/rbase/columns.rb,
lib/rbase/memo_file.rb,
lib/rbase/schema_dumper.rb
Defined Under Namespace
Modules: Columns, MemoFile Classes: InvalidValueError, Record, Schema, SchemaDumper, StandardError, Table, UnknownColumnError
Constant Summary collapse
- LANGUAGE_US_DOS =
0x01- LANGUAGE_INTL_DOS =
0x02- LANGUAGE_ANSI_WINDOWS =
0x03- LANGUAGE_RUSSIAN_DOS =
0x66- LANGUAGE_RUSSIAN_WINDOWS =
0xc9
Class Method Summary collapse
-
.create_table(name, options = {}) {|schema| ... } ⇒ Object
Create new XBase table file.
Class Method Details
.create_table(name, options = {}) {|schema| ... } ⇒ Object
Create new XBase table file. Table file name will be equal to name with “.dbf” suffix.
For list of available options see Table::create documentation.
Example
RBase.create_table 'people' do |t|
t.column :name, :string, :size => 30
t.column :birthdate, :date
t.column :active, :boolean
t.column :tax, :integer, :size => 10, :decimal => 2
end
For documentation on column parameters see RBase::Schema.column documentation.
25 26 27 28 29 30 31 32 |
# File 'lib/rbase/builder.rb', line 25 def self.create_table(name, = {}) [:language] ||= LANGUAGE_RUSSIAN_WINDOWS schema = Schema.new yield schema if block_given? Table.create name, schema, end |