- BREAKING: rename FlavorDefault to FlavorUnknown
- BREAKING: refactor subpackage sql
- BREAKING: Cleanup sub packages and examples
- BREAKING: Refactor to move sub packages to separated repos
- Breaking: min Go version bumped to 1.18
- Breaking Change: prom/goredis - logged command changed from cammelCase to snake_case
- Change: Migrate to github.com/redis/go-redis/v9
- Feature: Automatically handle parameter parseTime for MySQL driver
- Add support for Oracle INTERVAL DAY TO SECOND and INTERVAL YEAR TO MONTH
- Add function DurationToOracleDayToSecond
- Fix: Oracle drivers
- Fix golangci-lint
- Dependencies update
Bug fixed: AwsDynamodbConnect.PutItemIfNotExistXXX
must return (nil, nil)
if item already existed.
Move AwsDynamodbConnect
, GoRedisConnect
, MongoConnect
and SqlConnect
to sub-packages.
Support simple logging and metrics:
- New struct
CmdExecInfo
: information around an executing command. - New interface
IMetricsLogger
: APIs to log command executions and retrieve metrics. - Dependency libs updated/upgraded:
- AWS DynamoDB:
github.com/aws/aws-sdk-go v1.44.44
- Redis:
github.com/go-redis/redis/v8 v8.11.5
- MongoDB:
go.mongodb.org/mongo-driver v1.9.1
- (database/sql driver) Azure Cosmos DB:
github.com/btnguyen2k/gocosmos v0.1.6
- (database/sql driver) MSSQL:
github.com/denisenkom/go-mssqldb v0.12.2
- (database/sql driver) MySQL:
github.com/go-sql-driver/mysql v1.6.0
- (database/sql driver) Oracle:
github.com/godror/godror v0.33.3
- (database/sql driver) PostgreSQL:
github.com/jackc/pgx/v4 v4.16.1
- (database/sql driver) SQLite3:
github.com/mattn/go-sqlite3 v1.14.14
- AWS DynamoDB:
- 'Prom' for AWS DyamoDB:
- New struct
AwsQueryOpt
: to supply additional options toAwsDynamodbConnect.QueryItems
andAwsDynamodbConnect.QueryItemsWithCallback
. AwsDynamodbConnect.QueryItems
andAwsDynamodbConnect.QueryItemsWithCallback
now supportScanIndexBackward
.
- New struct
- 'Prom' for AWS DyamoDB: new helper functions:
AwsDynamodbWaitForGsiStatus
: periodically check if table's GSI status reaches a desired value, or timeout.AwsDynamodbWaitForTableStatus
: periodically check if table's status reaches a desired value, or timeout.
- 'Prom' for the official Go driver for MongoDB:
- New exported variables:
MongoPoolOptsLongDistance
,MongoPoolOptsGeneral
and MongoPoolOptsFailFast`. - Default pool options are now
MongoPoolOptsGeneral
.
- New exported variables:
- 'Prom' for database/sql: bug fixes & enhancements with date/time types.
- 'Prom' for database/sql: bug fixes, enhancements and unit test rewritten.
- 'Prom' for database/sql:
- Quick fix for Oracle's
NUMBER
data type.
- Quick fix for Oracle's
- 'Prom' for database/sql:
- Add
FlavorCosmosDb
&& Azure Cosmos DB support.
- Add
- More unit tests.
- Update dependencies.
- Other fixes & enhancements.
- 'Prom' for go-redis:
- Add
RedisPoolOpts
struct. GoRedisConnect.GetClient
,GoRedisConnect.GetFailoverClient
andGoRedisConnect.GetClusterClient
adhere to Redis connection pool settings.
- Add
- 'Prom' for the official Go driver for MongoDB:
- Add
MongoPoolOpts
struct. - New getter/setter &
MongoConnect.Init
functions. MongoConnect.NewContext
now returns singlecontext.Context
result.- New functions
MongoConnect.NewContextIfNil
andMongoConnect.NewContextWithCancel
.
- Add
- 'Prom' for database/sql:
- New getter/setter &
SqlConnect.Init
functions - New db flavor for SQLite
SqlConnect.NewContext
now returns singlecontext.Context
result- New functions
SqlConnect.NewContextIfNil
andSqlConnect.NewContextWithCancel
- New getter/setter &
- More unit tests.
- Update dependencies.
- Other fixes & enhancements.
- 'Prom' for AWS DyamoDB:
AwsDynamodbConnect.PutItemIfNotExist
returns(nil, nil)
if the item being put already existed.
- 'Prom' for the official Go driver for MongoDB:
- Clean up deprecated functions.
- 'Prom' for database/sql:
- Clean up deprecated functions.
- Migrate Oracle driver to
github.com/godror/godror
due to naming (trademark) issues. - Migrate PostgreSQL driver to
github.com/jackc/pgx/v4/stdlib
.
- More unit tests.
- Update dependencies.
- Other fixes & enhancements.
- 'Prom' for AWS DyamoDB:
- New functions
AwsDynamodbConnect.BuildxxxInput
andAwsDynamodbConnect.xxxWithInput
. - Doc fixes and updates.
- New functions
- 'Prom' for AWS DyamoDB:
- Add new function
IsAwsError(err error, code string) bool
- No longer ignore certain AWS errors, lets caller decide to call
AwsIgnoreErrorIfMatched
if needed.
- Add new function
- Update dependencies.
- Other fixes & enhancements.
- 'Prom' for AWS DyamoDB:
- New constants
AwsAttrTypeString
,AwsAttrTypeNumber
andAwsAttrTypeBinary
. - New constants
AwsKeyTypePartition
andAwsKeyTypeSort
. - Add transaction-supported functions.
- New constants
- Update dependencies.
- Other fixes & enhancements.
- 'Prom' for the official Go driver for MongoDB:
MongoConnect
: fixed a bug that incorrectly creates collection index when passingmongo.IndexModel
as parameter.
- 'Prom' for the official Go driver for MongoDB:
- Change
MongoConnect.Ping(timeoutMs ...int)
toMongoConnect.Ping(ctx context.Context)
.
- Change
- Bump Go version to
1.12
and update dependencies. - Other fixes & enhancements.
- 'Prom' for the official Go driver for MongoDB:
- Deprecate function
CreateIndexes
, replaced withCreateCollectionIndexes
.
- Deprecate function
- Add tests.
- New 'Prom' for AWS DyamoDB:
- AWS SDK for Go: https://github.com/aws/aws-sdk-go
- Type:
AwsDynamodbConnect
. - Usage examples.
- For API consistency:
- New function
MongoConnect.Close(context.Context) error
to replaceDisconnect(ctx context.Context) error
. - New function
GoRedisConnect.Close() error
.
- New function
- Libs upgraded:
- Upgrade to github.com/go-redis/redis
v6.15.6
. - Upgrade to go.mongodb.org/mongo-driver
v1.1.2
. - Upgrade to gopkg.in/goracle.v2
v2.21.4
.
- Upgrade to github.com/go-redis/redis
- 'Prom' for the official Go driver for MongoDB:
- Fixed bug
"no documents in result"
- Fixed bug
- Libs upgraded:
- Upgrade to github.com/go-redis/redis
v6.15.5
. - Upgrade to go.mongodb.org/mongo-driver
v1.1.1
. - Upgrade to github.com/lib/pq
v1.2.0
. - Upgrade to gopkg.in/goracle.v2
v2.20.1
.
- Upgrade to github.com/go-redis/redis
- 'Prom' for database/sql:
- Add timezone location attribute to
SqlConnect
struct. - Correctly parse date/time data from db using timezone location attribute.
- Add timezone location attribute to
- 'Prom' for database/sql: solve the case when Mysql's
TIME
is loaded as[]byte
.
- Migrated Go modular design.
- Add
DbFlavor
:- New method
NewSqlConnectWithFlavor
- New method
SqlConnect.fetchOneRow
fetches correct column's data type instead of[]byte
for MySQL. This makes results ofSqlConnect.FetchRows
andSqlConnect.FetchRowsCallback
are correctly typed, too.- Update examples for MongoDB, MySQL and PostgreSQL.
- Add examples for MSSQL and Oracle DB.
- New 'Prom' for database/sql:
- Go's database/sql package: https://pkg.go.dev/database/sql
- Type:
SqlConnect
. - Usage examples: MySQL, PostgreSQL
- 'Prom' for the official Go driver for MongoDB: add 2 functions
DecodeSingleResultRaw(*mongo.SingleResult) (string, error)
DecodeResultCallbackRaw(context.Context, *mongo.Cursor, func(docNum int, doc string, err error))
- Bug fixes & refactoring.
- 'Prom' for the official Go driver for MongoDB:
- Bug fixes, enhancements & refactoring
- Add usage examples
- New 'Prom' for go-redis:
- go-redis: https://github.com/go-redis/redis
- Type:
GoRedisConnect
. - Usage examples
- Function
DecodeSingleResult
andDecodeResultCallback
are now attached to*MongoConnect
- Change Mongo's timeout parameter from
int64
toint
- New 'Prom' for the official Go driver for MongoDB:
- Go driver for MongoDB: https://github.com/mongodb/mongo-go-driver
- Type:
MongoConnect
.