Table
Container for semi-structured data
Operations
- New
- Average
- Count
- Delete
- Filter
- FromCsv
- FromFilesystem
- Get
- GetAll
- GetColumnNames
- GetError
- GetIndex
- GetName
- Insert
- Query
- Size
- Sum
- ToString
- Unique
Average
Gets the column average
method : public : Average(name:String) ~ Float
Parameters
Name | Type | Description |
---|---|---|
name | String | column name |
Return
Type | Description |
---|---|
Float | column average |
Delete
Delete row1 by primary key
method : public : native : Delete(pk:Int) ~ Bool
Parameters
Name | Type | Description |
---|---|---|
pk | Int | primary key |
Return
Type | Description |
---|---|
Bool | true of successful, false otherwise |
Filter
Filters table based upon conditional criteria
method : public : native : Filter(cond:Conditional) ~ Vector<Row>
Parameters
Name | Type | Description |
---|---|---|
cond | Conditional | conditional filter |
Return
Type | Description |
---|---|
Vector<Row> | filtered rows |
FromCsv
Loads a table from a CSV file
function : FromCsv(table_name:String, path:String) ~ Table
Parameters
Name | Type | Description |
---|---|---|
table_name | String | table name |
path | String | to CSV |
Return
Type | Description |
---|---|
Table | new table |
FromFilesystem
Loads a table from a directory file system. Columns are: name, path_name, create_date, owner, is_dir and is_readonly.
function : FromFilesystem(table_name:String, path:String) ~ Table
Parameters
Name | Type | Description |
---|---|---|
table_name | String | table name |
path | String | to directory |
Return
Type | Description |
---|---|
Table | new table |
Get
Get row1 by primary key
method : public : native : Get(pk:Int) ~ Row
Parameters
Name | Type | Description |
---|---|---|
pk | Int | primary key |
Return
Type | Description |
---|---|
Row | row1 |
GetAll
Get all row1
method : public : native : GetAll() ~ Vector<Row>
Return
Type | Description |
---|---|
Vector<Row> | all row1 |
GetColumnNames
Gets all column names
method : public : GetColumnNames() ~ String[]
Return
Type | Description |
---|---|
String | column names |
GetError
Gets the last query error
method : public : GetError() ~ String
Return
Type | Description |
---|---|
String | last query error |
GetIndex
Get column index by name
method : public : native : GetIndex(name:String) ~ Int
Parameters
Name | Type | Description |
---|---|---|
name | String | column name |
Return
Type | Description |
---|---|
Int | column name |
Insert
Inserts a new row1 into the table. After the row1 has been added it's values will need to be set.
method : public : native : Insert() ~ Row
Return
Type | Description |
---|---|
Row | newly inserted row1 |
New
Constructor
New(name:String, column_names:String[])
Parameters
Name | Type | Description |
---|---|---|
name | String | table name |
column_names | String | column names |
Query
Query table using SQL-like syntax. Support for 'select', 'from', 'where', 'distinct', 'order by' and logical operators.
method : public : Query(statement:String) ~ Table
Parameters
Name | Type | Description |
---|---|---|
statement | String | query statement |
Return
Type | Description |
---|---|
Table | result table |
Sum
Gets the column sum
method : public : Sum(name:String) ~ Float
Parameters
Name | Type | Description |
---|---|---|
name | String | column name |
Return
Type | Description |
---|---|
Float | column sum |
ToString
String representation of table
method : public : ToString() ~ String
Return
Type | Description |
---|---|
String | all row1 as a string |