Add support for DELETE statements.

This commit is contained in:
zer0sub 2019-04-20 19:49:29 +02:00
parent 70d6f84375
commit bc6a2bbcac
14 changed files with 492 additions and 543 deletions

View file

@ -155,10 +155,9 @@ func (t *Table) ForceIndex(index string) *Table {
// Generates the sql string for the current tableName expression. Note: the
// generated string may not be a valid/executable sql statement.
func (t *Table) SerializeSql(out *bytes.Buffer) error {
if !validIdentifierName(t.schemaName) {
return errors.New("Invalid database name specified")
if t == nil {
return errors.Newf("nil tableName. Generated sql: %s", out.String())
}
_, _ = out.WriteString(t.schemaName)
_, _ = out.WriteString(".")
_, _ = out.WriteString(t.TableName())