feat: added functionality for insert and select
This commit is contained in:
+5
-5
@@ -151,11 +151,11 @@ func DoMetaCommands(inputBuffer *InputBuffer) MetaCommandResults {
|
||||
func (statement *Statement) PrepareStatements(inputBuffer *InputBuffer) PrepareResults {
|
||||
if strings.HasPrefix(inputBuffer.Buffer, "insert") {
|
||||
argsAssigned, err := fmt.Sscanf(inputBuffer.Buffer, "insert %d %s %s", &statement.row.id, &statement.row.username, &statement.row.email)
|
||||
if err != nil {
|
||||
fmt.Println("error parsing insert statement")
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
if argsAssigned > 3 {
|
||||
// if err != nil {
|
||||
// fmt.Println("error parsing insert statement")
|
||||
// fmt.Println(err.Error())
|
||||
// }
|
||||
if err != nil || argsAssigned > 3 {
|
||||
return PrepareSyntaxError
|
||||
}
|
||||
statement.stype = StatementInsert
|
||||
|
||||
Reference in New Issue
Block a user