Class: KirbyBase

Class | KirbyBase
In: | lib/kirbybase.rb
Parent: | Object

### Methods

build_header_field_string client? create_table drop_table get_table local? new rename_table server? table_exists? tables

### Included Modules

DRb::DRbUndumped KBTypeConversionsMixin

### Classes and Modules

Class KirbyBase::KBEngine
Class KirbyBase::KBTable

### Constants

VERSION | = | "2.6"

### Attributes

connect_type | [RW] |
delay_index_creation | [RW] |
engine | [R] |
ext | [RW] |
host | [RW] |
memo_blob_path | [RW] |
path | [RW] |
port | [RW] |

### Public Class methods

new(connect_type=:local, host=nil, port=nil, path='./', ext='.tbl', memo_blob_path='./', delay_index_creation=false) {|self if block_given?| ...}

Create a new database instance.

connect_type: | Symbol (:local, :client, :server) specifying role to play.
host: | String containing IP address or DNS name of server hosting database. (Only valid if connect_type is :client.)
port: | Integer specifying port database server is listening on. (Only valid if connect_type is :client.)
path: | String specifying path to location of database tables.
ext: | String specifying extension of table files.
memo_blob_path: | String specifying path to location of memo/blob files.
delay_index_creation: | Boolean specifying whether to delay index creation for each table until that table is requested by user.

### Public Instance methods

build_header_field_string(field_name_def, field_type_def)
client?()

Is this running as a client?

create_table(name=nil, *field_defs) {|t if block_given?| ...}

Create new table and return a reference to the new table.

name: | Symbol of table name.
field_defs: | List of field names (Symbols), field types (Symbols), field indexes, and field extras (Indexes, Lookups, Link_manys, Calculateds, etc.)
Block: | Optional code block allowing you to set the following:
encrypt: | true/false specifying whether table should be encrypted.
record_class: | Class or String specifying the user create class that will be associated with table records.

drop_table(tablename)

Delete a table.

tablename: | Symbol of table name.

get_table(name)

Return a reference to the requested table.

name: | Symbol of table name.

local?()

Is this running in single-user, embedded mode?

rename_table(old_tablename, new_tablename)

Rename a table.

old_tablename: | Symbol of old table name.
new_tablename: | Symbol of new table name.

server?()

Is this running as a server?

table_exists?(tablename)

Return true if table exists.

tablename: | Symbol of table name.

tables()

Return an array containing the names of all tables in this database.

[Validate]