-
Notifications
You must be signed in to change notification settings - Fork 7
jSQL Syntax
Rob Parham edited this page Oct 29, 2017
·
7 revisions
The jSQL.query
method understands a subset of mySQL. It can parse and execute basic CRUD queries as well as DROP table queries.
jSQL ignores whitespace.
jSQL handles Prepared Statements and will replace question marks with values passed to the query's execute
method.
jSQL ignores case except when dealing with table or column names or values.
jSQL permits the use of backticks (`) around table and column names, but they are not required.
SELECT
[DISTINCT|DISTINCTROW|ALL]
column_name [, column_name ...]
FROM table
[WHERE where_condition]
[ORDER BY col_name [ASC | DESC], ...]
[LIMIT row_count]
CREATE TABLE [IF NOT EXISTS] tbl_name (
column name [ NULL | NOT NULL ] [ DEFAULT *default_value* ] [ [ AUTO_INCREMENT ] PRIMARY [ KEY ] | UNIQUE [ KEY ] ] ,...
[PRIMARY KEY (column name, ...)],
[UNIQUE KEY (column name, ...)],
)
UPDATE table_name
SET col_name1={expr1} [, col_name2={expr2] ...
[WHERE where_condition]
[ORDER BY ...]
[LIMIT row_count]
INSERT [IGNORE] INTO tbl_name
[(col_name,...)]
VALUES (value,...)
DROP TABLE tbl_name
DELETE FROM tbl_name
[WHERE where_condition]
[ORDER BY ...]
[LIMIT row_count]
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