From d67615ab657d24de8dc43e72aa9ddb57ab2a0644 Mon Sep 17 00:00:00 2001 From: Josh <46653655+BitlyTwiser@users.noreply.github.com> Date: Wed, 18 Jan 2023 12:52:21 -0800 Subject: [PATCH] Development (#16) Spelling corrections --- README.md | 2 +- pkg/dialects/raw.go | 10 +++++----- pkg/sqlbuilder/sqlbuilder.go | 2 +- tinyorm.go | 2 +- tinyorm_test.go | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 747a081..5c0427a 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/pkg/dialects/raw.go b/pkg/dialects/raw.go index 9becd6e..dccbf01 100644 --- a/pkg/dialects/raw.go +++ b/pkg/dialects/raw.go @@ -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) @@ -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) } } @@ -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 diff --git a/pkg/sqlbuilder/sqlbuilder.go b/pkg/sqlbuilder/sqlbuilder.go index 02ce5e9..a745b95 100644 --- a/pkg/sqlbuilder/sqlbuilder.go +++ b/pkg/sqlbuilder/sqlbuilder.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" ) -// Standard data manupulation operations +// Standard data manipulation operations const ( SELECT = "select" CREATE = "create" diff --git a/tinyorm.go b/tinyorm.go index 0911254..058b53f 100644 --- a/tinyorm.go +++ b/tinyorm.go @@ -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 { diff --git a/tinyorm_test.go b/tinyorm_test.go index 44ced85..a10370a 100644 --- a/tinyorm_test.go +++ b/tinyorm_test.go @@ -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 @@ -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 { @@ -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 {