Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

jSQLTable class

Pamblam edited this pageDec 11, 2016 ·2 revisions

This class represents a table in the database. The database is located injSQL.tables and is an object whose keys are table names and values are their respectivejSQLTable classes.

These tables are altered and queried byjSQLQuery objects, but may be interacted with directly if desired.


jSQLTable.name

The name of the table. (string)


jSQLTable.columns

An array of the table's column names.


jSQLTable.data

A 2D array of the table's data.


jSQLTable.colmap

An object whos keys are column names and values are their respective array index.


jSQLTable.renameColumn(oldname, newname)

Renames a column in the table.

Parameters
  • oldname: The name of the column to be changed. (string)
  • newname: The new name of the column. (string)
Example
jSQL.tables.Users.renameColumn('Name', 'FullName');jSQL.persist();

jSQLTable.addColumn(name, defaultVal)

Adds a column to a table.

Parameters
  • 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.
Example
jSQL.tables.Users.addColumn('FavoriteColor', 'Green');jSQL.persist();

jSQLTable.loadData(data)

Adds multiple rows to a table.

Parameters
  • data: A 2D array of data to be added to the table.
Example
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();

jSQLTable.insertRow(data)

Adds a row to a table.

Parameters
  • data: An array of data to be added to the table.
Example
var data = ["Sooper Delux Model", 5];jSQL.tables.Products.insertRow(data);jSQL.persist();

Persistence Management

Storage APIs

Querying the Database

jSQLTable class

jSQLQuery interface

jSQLWhereClause class

jSQL Helper Methods

jSQL Syntax

Fun with DataTypes

Error Handling

Examples

License

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp