As I haven't found any nice database programs for cc yet I decided to write one myself.
I've not yet finished coding it yet (one function isn't working correct) but I think it'll be released quite soon.
Functions:
- getVersion()
- createDatabase(database)
- dropDatabase(database)
- selectDb(database)
- closeDb(database)
- createTable(table, fields)
- getTablePath(table)
- dropTable(table)
- getFields(table)
- getField(table, field)
- getLine(table, index)
- insert(table, value)
- select(table, field, like)
Returns the version of the API.
Expects a string. A new database called $database will be created.
Expects a string. The database $database will be deleted.
Expects a string. "opens a connection to the database $database" (not really correct but it's difficult to explain)
Expects a string. "closes the connection to the database $database" (again, not really correct)
Expects a string and a table. Will create a table in the database selected with selectDb() with the fields in $fields.
Expects a string. Will delete the table in the database selected with selectDb().
Expects a string. Will return a table with all the fields in the table $table in the database selected in selectDb().
Expects a string and a string. Will return a table with the content of the field $field in table $table in the database selected in selectDb().
Expects a string and a number. Will return a table with the content of the $index-th line of the table $table in the database selected in selectDb().
Expects a string and a table. Will insert the content of $value into the table $table in the database selected in selectDb().
Expects a string, table and a table. Will return a two dimensional table containing the fields in witch $field == $like
As it's hard to explain here'S an example:
selectDb("luza")
createTable("testtable",{"field1","field2","field3"}
insert("testtable",{"test","cc","luza"})
insert("testtable",{"test","cc","peter"})
findings = select("testtable",{"field1","field2"},{"test","cc"})
print(findings[1][3]) --Output: luza
print(findings[2][3]) --Output: peter
To Do:
- release it ;)/>/>
- add an "update" function