 		case .drop(let table):
 			return "DROP TABLE \(table.sql(dialect: dialect));"
 
-		case .insert(into: let into, columns: let cols, values: let tuples):
-			let colSQL = cols.map { $0.sql(dialect: dialect) }.joined(separator: ", ")
-			let tupleSQL = tuples.map { tuple in
+		case .insert(let insert):
+			let colSQL = insert.columns.map { $0.sql(dialect: dialect) }.joined(separator: ", ")
+			let tupleSQL = insert.values.map { tuple in
 				let ts = tuple.map { $0.sql(dialect: dialect) }.joined(separator: ",")
 				return "(\(ts))"
 				}.joined(separator: ", ")
 
-			return "INSERT INTO \(into.sql(dialect: dialect)) (\(colSQL)) VALUES \(tupleSQL);"
+			let orReplaceSQL = insert.orReplace ? " OR REPLACE" : ""
+			return "INSERT\(orReplaceSQL) INTO \(insert.into.sql(dialect: dialect)) (\(colSQL)) VALUES \(tupleSQL);"
 
 		case .update:
 			return "UPDATE;"

		add_named_rule("ex", rule: ^"ex-equality")

		// Types
		add_named_rule("type-text", rule: Parser.matchLiteral("TEXT") => { self.stack.append(.type(SQLType.text)) })
		add_named_rule("type-int", rule: Parser.matchLiteral("INT") => { self.stack.append(.type(SQLType.int)) })
		add_named_rule("type", rule: ^"type-text" | ^"type-int")

		// Column definition

		)

		add_named_rule("insert-dml-statement", rule: (
				Parser.matchLiteralInsensitive("INSERT") => {
					self.stack.append(.statement(.insert(SQLInsert(orReplace: false, into: SQLTable(name: ""), columns: [], values: []))))
				}
				~~ (Parser.matchLiteralInsensitive("OR REPLACE")/~ => {
					guard case .statement(let statement) = self.stack.popLast()! else { fatalError() }
					guard case .insert(var insert) = statement else { fatalError() }
					insert.orReplace = true
					self.stack.append(.statement(.insert(insert)))
				})
				~~ Parser.matchLiteralInsensitive("INTO")
				~~ (^"id-table" => { self.stack.append(.tableIdentifier(SQLTable(name: self.text))) })
				~~ ((Parser.matchLiteral("(") => { self.stack.append(.columnList([])) }) ~~ ^"column-list" ~~ Parser.matchLiteral(")"))
				~~ Parser.matchLiteralInsensitive("VALUES") ~~ ((Parser.matchLiteral("(") => { self.stack.append(.tuple([])) }) ~~ ^"tuple" ~~ Parser.matchLiteral(")"))
