-
Notifications
You must be signed in to change notification settings - Fork 7
jSQLTable class
Pamblam edited this page Dec 11, 2016
·
2 revisions
This class represents a table in the database. The database is located in jSQL.tables
and is an object whose keys are table names and values are their respective jSQLTable
classes.
These tables are altered and queried by jSQLQuery
objects, but may be interacted with directly if desired.
The name of the table. (string)
An array of the table's column names.
A 2D array of the table's data.
An object whos keys are column names and values are their respective array index.
Renames a column in the table.
- oldname: The name of the column to be changed. (string)
- newname: The new name of the column. (string)
jSQL.tables.Users.renameColumn('Name', 'FullName');
jSQL.persist();
Adds a column to a table.
- name: The name of the column to be added. (string)
- newname: The default value for this column. All existing rows will be assigned this value.
jSQL.tables.Users.addColumn('FavoriteColor', 'Green');
jSQL.persist();
Adds multiple rows to a table.
- data: A 2D array of data to be added to the table.
var data = [
{Name: "Delux Model", "ProductID": 0},
{Name: "Supreme Model", "ProductID": 1},
{Name: "Super Model", "ProductID": 2},
{Name: "Regular Model", "ProductID": 3},
{Name: "Small Model", "ProductID": 4}
];
jSQL.tables.Products.loadData(data);
jSQL.persist();
Adds a row to a table.
- data: An array of data to be added to the table.
var data = ["Sooper Delux Model", 5];
jSQL.tables.Products.insertRow(data);
jSQL.persist();
jSQLTable.name
jSQLTable.columns
jSQLTable.data
jSQLTable.colmap
jSQLTable.renameColumn
jSQLTable.addColumn
jSQLTable.loadData
jSQLTable.insertRow
jSQLQuery.ifNotExists
jSQLQuery.ignore
jSQLQuery.execute
jSQLQuery.fetch
jSQLQuery.fetchAll
jSQLQuery.values
jSQLQuery.set
jSQLQuery.where
jSQLQuery.from
jSQLQuery.limit
jSQLQuery.orderBy
jSQLQuery.asc
jSQLQuery.desc
jSQLQuery.distinct
jSQLWhereClause.where
jSQLWhereClause.equals
jSQLWhereClause.preparedLike
jSQLWhereClause.doesNotEqual
jSQLWhereClause.lessThan
jSQLWhereClause.contains
jSQLWhereClause.endsWith
jSQLWhereClause.beginsWith
jSQLWhereClause.and
jSQLWhereClause.or
jSQLWhereClause.limit
jSQLWhereClause.orderBy
jSQLWhereClause.asc
jSQLWhereClause.desc
jSQLWhereClause.execute