Skip to content

Commit

Permalink
Development (#16)
Browse files Browse the repository at this point in the history
Spelling corrections
  • Loading branch information
BitlyTwiser authored Jan 18, 2023
1 parent 1f2f382 commit d67615a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To initiall perform the database connection, the following line can be used:
database := "development"
db, err := tinyorm.Connect(database)
if err != nil {
t.Fatalf("error occured connecting to database %s. %v", database, err.Error())
t.Fatalf("error occurred connecting to database %s. %v", database, err.Error())
}
```
The database string is any value that is found within the database.yml file.
Expand Down
10 changes: 5 additions & 5 deletions pkg/dialects/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ func (rq *RawQuery) Exec() error {
result, err := rq.stmt.Exec(rq.args...)

if err != nil {
return logger.Log.LogError("error occured executing raw query.", err)
return logger.Log.LogError("error occurred executing raw query.", err)
}

rows, err := result.RowsAffected()
if err != nil {
return logger.Log.LogError("error occured calculating affected rows from raw query.", err)
return logger.Log.LogError("error occurred calculating affected rows from raw query.", err)
}
logger.Log.LogEvent("warn", "executed raw query", "rows affected", rows)

Expand All @@ -45,12 +45,12 @@ func (rq *RawQuery) All(model any) error {
if len(rq.args) > 0 {
rows, err = rq.stmt.Query(rq.args...)
if err != nil {
return logger.Log.LogError("error occured executing raw query", err)
return logger.Log.LogError("error occurred executing raw query", err)
}
} else {
rows, err = rq.stmt.Query()
if err != nil {
return logger.Log.LogError("error occured executing raw query", err)
return logger.Log.LogError("error occurred executing raw query", err)
}

}
Expand Down Expand Up @@ -102,7 +102,7 @@ func (rq *RawQuery) All(model any) error {
return logger.Log.LogError("no rows found for raw query call", err)
}

return logger.Log.LogError("error occured scanning raw query results", err)
return logger.Log.LogError("error occurred scanning raw query results", err)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/sqlbuilder/sqlbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/google/uuid"
)

// Standard data manupulation operations
// Standard data manipulation operations
const (
SELECT = "select"
CREATE = "create"
Expand Down
2 changes: 1 addition & 1 deletion tinyorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Connect(connection string) (dialects.DialectHandler, error) {
err := connections.InitDatabaseConnection(connection)

if err != nil {
return nil, logger.Log.LogError("error initalizing database connection", err)
return nil, logger.Log.LogError("error initializing database connection", err)
}

if handle, found := connections.Connections[connection]; found {
Expand Down
8 changes: 4 additions & 4 deletions tinyorm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var (
func TestCreate(t *testing.T) {
db, err := tinyorm.Connect(DATABASE)
if err != nil {
t.Fatalf("error occured connecting to database %s. %v", DATABASE, err.Error())
t.Fatalf("error occurred connecting to database %s. %v", DATABASE, err.Error())
}
createTests := map[string]struct {
action string
Expand Down Expand Up @@ -82,7 +82,7 @@ func TestORMFunctionality(t *testing.T) {
db, err := tinyorm.Connect(DATABASE)

if err != nil {
t.Fatalf("error occured connecting to database %s. %v", DATABASE, err.Error())
t.Fatalf("error occurred connecting to database %s. %v", DATABASE, err.Error())
}

tests := map[string]struct {
Expand Down Expand Up @@ -184,11 +184,11 @@ func TestORMFunctionality(t *testing.T) {

}

// Similiar case as the create tests with the Delete tests. Run these after all other tests have executed
// Similar case as the create tests with the Delete tests. Run these after all other tests have executed
func TestDeleteData(t *testing.T) {
db, err := tinyorm.Connect(DATABASE)
if err != nil {
t.Fatalf("error occured connecting to database %s. %v", DATABASE, err.Error())
t.Fatalf("error occurred connecting to database %s. %v", DATABASE, err.Error())
}

deleteTests := map[string]struct {
Expand Down

0 comments on commit d67615a

Please sign in to comment.