diff --git a/src/zutil/db/SQLQuery.java b/src/zutil/db/SQLQuery.java index 29361e2..70b63ff 100644 --- a/src/zutil/db/SQLQuery.java +++ b/src/zutil/db/SQLQuery.java @@ -30,16 +30,16 @@ public class SQLQuery { // Main Types /** * -SELECT - [ALL | DISTINCT | DISTINCTROW ] - [FROM table_references - [WHERE where_condition] - [GROUP BY {col_name | expr | position} - [ASC | DESC], ... [WITH ROLLUP]] - [HAVING where_condition] - [ORDER BY {col_name | expr | position} - [ASC | DESC], ...] - [LIMIT {[offset,] row_count | row_count OFFSET offset}] + * SELECT + * [ALL | DISTINCT | DISTINCTROW ] + * [FROM table_references + * [WHERE where_condition] + * [GROUP BY {col_name | expr | position} + * [ASC | DESC], ... [WITH ROLLUP]] + * [HAVING where_condition] + * [ORDER BY {col_name | expr | position} + * [ASC | DESC], ...] + * [LIMIT {[offset,] row_count | row_count OFFSET offset}] * */ public static class SQLSelect extends SQLQueryItem{ @@ -74,6 +74,15 @@ SELECT } } + /* + * + * UPDATE [LOW_PRIORITY] [IGNORE] table_reference + * SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ... + * [WHERE where_condition] + * [ORDER BY ...] + * [LIMIT row_count] + * + */ public static class SQLUpdate extends SQLQueryItem{ protected SQLUpdate(){ setRoot(this); @@ -84,6 +93,33 @@ SELECT } } + /* + * + * INSERT [INTO] tbl_name + * SET col_name={expr | DEFAULT}, ... + * + * INSERT [INTO] tbl_name [(col_name,...)] + * {VALUES | VALUE} ({expr | DEFAULT},...),(...),... + * + */ + public static class SQLInsert extends SQLQueryItem{ + protected SQLInsert(){ + setRoot(this); + } + + protected void build(StringBuilder query) { + + } + } + + /* + * + * DELETE FROM tbl_name + * [WHERE where_condition] + * [ORDER BY ...] + * [LIMIT row_count] + * + */ public static class SQLDelete extends SQLQueryItem{ protected SQLDelete(){ setRoot(this); @@ -353,6 +389,10 @@ SELECT return new SQLUpdate(); } + public static SQLInsert INSERT(){ + return new SQLInsert(); + } + public static SQLDelete DELETE(){ return new SQLDelete(); }