Merging into main #1

Merged
TakshakRamteke merged 21 commits from dev into main 2026-07-25 07:59:53 +00:00
2 changed files with 7 additions and 6 deletions
Showing only changes of commit e625b29d3c - Show all commits
+2 -1
View File
@@ -33,9 +33,10 @@ func Run() {
switch statement.PrepareStatements(inputBuffer) {
case PrepareSuccess:
//todo
case PrepareSyntaxError:
fmt.Println("Syntax error, could not parse statement")
case PrepareUnrecognised:
fmt.Printf("Unrecognised keyword at the start of '%s'.\n", inputBuffer.Buffer)
continue
}
switch statement.ExecuteStatement(table) {
+5 -5
View File
@@ -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