A class that helps you with building and running database backend specific sql for creating / altering / deleting tables. A class that helps you with building and running database backend specific sql for creating / altering / deleting tables. It contains helper methods that lets you run the finished query directly See [method run] and [method run_query]. You should not allocate this directly, instead get it from you active database connection, like: [codeblock] var conn : DatabaseConnection = DatabaseManager.ddb.get_connection() var tb : TableBuilder = conn.get_table_builder() [/codeblock] Adds an [code]AUTO_INCREMENT[/code] statement. Equivalent to: [codeblock] result += "AUTO_INCREMENT " [/codeblock] Closes a [code]CREATE TABLE[/code] statement. Equivalent to: [codeblock] result += ");" [/codeblock] Closes a [code]DROP TABLE[/code] statement. Equivalent to: [codeblock] result += ";" [/codeblock] Adds a [code]CREATE TABLE[/code] statement. Equivalent to: [codeblock] result += "CREATE TABLE " + name + " ( " [/codeblock] Adds a [code]DATE[/code] field statement. Equivalent to: [codeblock] result += name + " DATE " [/codeblock] Adds a [code]DEFAULT[/code] statement. Equivalent to: [codeblock] result += "DEFAULT '" + val + "'" [/codeblock] Adds a [code]DROP TABLE[/code] statement. Equivalent to: [codeblock] result += "DROP TABLE " [/codeblock] Adds a [code]DROP TABLE IF EXISTS[/code] statement. Equivalent to: [codeblock] result += "DROP TABLE IF EXISTS " [/codeblock] Adds a [code]FOREIGN KEY[/code] statement. Equivalent to: [codeblock] result += "FOREIGN KEY (" + name + ") " [/codeblock] Adds an [code]INTEGER[/code] field statement. Equivalent to: [codeblock] result += name + " INTEGER "; if (length != -1): result += "(" + str(length) + ") " [/codeblock] Go the the next row (field) in the current sql statement. Equivalent to: [codeblock] result += ", " [/codeblock] Adds a [code]NOT NULL[/code] statement. Equivalent to: [codeblock] result += "NOT NULL " [/codeblock] Adds a [code]NULL[/code] statement. Equivalent to: [codeblock] result += "NULL " [/codeblock] Adds a [code]PRIMARY KEY[/code] statement. Equivalent to: [codeblock] result += "PRIMARY KEY (" + name + ") " [/codeblock] Adds an [code]DOUBLE[/code] field statement. Equivalent to: [codeblock] result += name + " DOUBLE " [/codeblock] Adds an [code]FLOAT[/code] field statement. Equivalent to: [codeblock] result += name + " FLOAT " [/codeblock] result += "REFERENCES " + table + " (" + name + ") "; Resets the result. Run the query currently stored in the result property. Use this if your query returns values from the database (an you want to read them). Run the query currently stored in the result property. Use this if your query doesn't return values from the database (or you don't want to read them if it does). Adds a [code]SMALL INTEGER[/code] field statement. Equivalent to: [codeblock] result += name + " INTEGER(" if (length == -1): result += "6" else: result += itos(length) result += ") " [/codeblock] Adds a [code]TEXT[/code] field statement. Equivalent to: [codeblock] result += name + " TEXT " [/codeblock] Adds a [code]TINY INTEGER[/code] field statement. Equivalent to: [codeblock] result += name + " INTEGER(" if (length == -1): result += "4" else: result += itos(length) result += ") " [/codeblock] Adds a [code]VARCHAR[/code] field statement. Equivalent to: [codeblock] result += name + " VARCHAR "; if (length != -1): result += "(" + str(length) + ") " [/codeblock] The current (resulting) sql statement.