Skip to content

Commit f3d322c

Browse files
author
CI Build
committed
Update RELEASE-NOTES.md, module.go and *.go files for new version 1.1.0
1 parent e25878e commit f3d322c

9 files changed

+57
-33
lines changed

RELEASE-NOTES.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# gocosmos - Release notes
22

3+
## 2024-02-13 - v1.1.0
4+
5+
### Added/Refactoring
6+
7+
- Refactored DELETE statement: appending PK values at the end of parameter list is no longer needed.
8+
- Refactored UPDATE statement: appending PK values at the end of parameter list is no longer needed.
9+
- Feature: INSERT/UPSERT statement accepts WITH PK clause. Appending PK values at the end of parameter list is no longer needed.
10+
11+
### Deprecated
12+
13+
- Deprecated: WITH singlePK/SINGLE_PK is now deprecated for INSERT/UPSERT, DELETE and UPDATE statements.
14+
15+
### Fixed/Improvement
16+
17+
- Improvement: implement fmt.Stringer
18+
- Improvement: Conn implements interface driver.Pinger
19+
- Improvement: Driver implements interface driver.DriverContext
20+
- Improvement: StmtCreateCollection/StmtAlterCollection/StmtDropCollection implements interface driver.StmtExecContext
21+
- Improvement: StmtListCollections implements interface driver.StmtQueryContext
22+
- Improvement: StmtCreateDatabase/StmtAlterDatabase/StmtDropDatabase implements interface driver.StmtExecContext
23+
- Improvement: StmtListDatabases implements interface driver.StmtQueryContext
24+
- Improvement: StmtInsert/StmtDelete/StmtUpdate implements interface driver.StmtExecContext
25+
- Improvement: StmtSelect implements interface driver.StmtQueryContext
26+
327
## 2023-12-22 - v1.0.0
428

529
### Changed

SQL.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ INSERT INTO mydb.mytable (
360360
) WITH PK=/id
361361
```
362362

363-
**Since <<VERSION>>**:
363+
**Since v1.1.0**:
364364

365365
- `WITH SINGLE_PK` is deprecated and will be _removed_ in future version! Instead, use `WITH PK=/pkey` (or `WITH PK=/pkey1,/pkey2` if [Hierarchical Partition Keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) - also known as sub-partitions - is used on the collection).
366366
- Supplying values for partition key at the end of parameter list is no longer required, but still supported for backward compatibility. This behaviour will be _removed_ in future version!
@@ -420,7 +420,7 @@ fmt.Println(dbresult.RowsAffected()) // output 1
420420
> `gocosmos` automatically discovers PK of the collection by fetching metadata from server.
421421
> Supplying pk-fields and pk-values is highly recommended to save one round-trip to server to fetch the collection's partition key info.
422422
423-
**Since <<VERSION>>**:
423+
**Since v1.1.0**:
424424

425425
- `WITH SINGLE_PK` is deprecated and will be _removed_ in future version! Instead, use `AND pkfield=value` (or `AND pkfield1=value1 AND pkfield2=value2...` if [Hierarchical Partition Keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) - also known as sub-partitions - is used on the collection).
426426
- Supplying values for partition key at the end of parameter list is no longer required, but still supported for backward compatibility. This behaviour will be _removed_ in future version!
@@ -463,7 +463,7 @@ fmt.Println(dbresult.RowsAffected())
463463
> `gocosmos` automatically discovers PK of the collection by fetching metadata from server.
464464
> Supplying pk-fields and pk-values is highly recommended to save one round-trip to server to fetch the collection's partition key info.
465465
466-
**Since <<VERSION>>**:
466+
**Since v1.1.0**:
467467

468468
- `WITH SINGLE_PK` is deprecated and will be _removed_ in future version! Instead, use `AND pkfield=value` (or `AND pkfield1=value1 AND pkfield2=value2...` if [Hierarchical Partition Keys](https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys) - also known as sub-partitions - is used on the collection).
469469
- Supplying values for partition key at the end of parameter list is no longer required, but still supported for backward compatibility. This behaviour will be _removed_ in future version!

conn.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type Conn struct {
2020

2121
// String implements fmt.Stringer/String.
2222
//
23-
// @Available since <<VERSION>>
23+
// @Available since v1.1.0
2424
func (c *Conn) String() string {
2525
return fmt.Sprintf(`Conn{default_db: %q}`, c.defaultDb)
2626
}
@@ -62,7 +62,7 @@ func (c *Conn) CheckNamedValue(_ *driver.NamedValue) error {
6262

6363
// Ping implements driver.Pinger/Ping.
6464
//
65-
// @Available since <<VERSION>>
65+
// @Available since v1.1.0
6666
func (c *Conn) Ping(_ context.Context) error {
6767
// since connection to Cosmos DB server is stateless, Ping always returns nil
6868
return nil

driver.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (d *Driver) Open(connStr string) (driver.Conn, error) {
129129

130130
// OpenConnector implements driver.DriverContext/OpenConnector.
131131
//
132-
// @Available since <<VERSION>>
132+
// @Available since v1.1.0
133133
func (d *Driver) OpenConnector(connStr string) (driver.Connector, error) {
134134
conn, err := d.Open(connStr)
135135
if err != nil {
@@ -146,7 +146,7 @@ func (d *Driver) OpenConnector(connStr string) (driver.Connector, error) {
146146

147147
// Connector is Azure Cosmos DB implementation of driver.Connector.
148148
//
149-
// @Available since <<VERSION>>
149+
// @Available since v1.1.0
150150
type Connector struct {
151151
driver *Driver
152152
connStr string

module.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package gocosmos
33

44
const (
55
// Version holds the semantic version number of package gocosmos.
6-
Version = "1.0.0"
6+
Version = "1.1.0"
77
)
88

99
// This file contains module's metadata only, which is package level documentation and module Version string.

stmt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ type Stmt struct {
219219

220220
// String implements interface fmt.Stringer/String.
221221
//
222-
// @Available since <<VERSION>>
222+
// @Available since v1.1.0
223223
func (s *Stmt) String() string {
224224
return fmt.Sprintf(`Stmt{query: %q, num_inputs: %d, with_opts: %v}`, s.query, s.numInputs, s.withOpts)
225225
}

stmt_collection.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type StmtCreateCollection struct {
3838

3939
// String implements fmt.Stringer/String.
4040
//
41-
// @Available since <<VERSION>>
41+
// @Available since v1.1.0
4242
func (s *StmtCreateCollection) String() string {
4343
return fmt.Sprintf(`StmtCreateCollection{Stmt: %s, db: %q, collection: %q, if_not_exists: %t, ru: %d, maxru: %d, pk: %q, uk: %v}`,
4444
s.Stmt, s.dbName, s.collName, s.ifNotExists, s.ru, s.maxru, s.pk, s.uk)
@@ -108,7 +108,7 @@ func (s *StmtCreateCollection) Exec(args []driver.Value) (driver.Result, error)
108108

109109
// ExecContext implements driver.StmtExecContext/ExecContext.
110110
//
111-
// @Available since <<VERSION>>
111+
// @Available since v1.1.0
112112
func (s *StmtCreateCollection) ExecContext(_ context.Context, args []driver.NamedValue) (driver.Result, error) {
113113
if len(args) != 0 {
114114
return nil, fmt.Errorf("expected 0 input value, got %d", len(args))
@@ -164,7 +164,7 @@ type StmtAlterCollection struct {
164164

165165
// String implements fmt.Stringer/String.
166166
//
167-
// @Available since <<VERSION>>
167+
// @Available since v1.1.0
168168
func (s *StmtAlterCollection) String() string {
169169
return fmt.Sprintf(`StmtAlterCollection{Stmt: %s, db: %q, collection: %q, ru: %d, maxru: %d}`,
170170
s.Stmt, s.dbName, s.collName, s.ru, s.maxru)
@@ -220,7 +220,7 @@ func (s *StmtAlterCollection) Exec(args []driver.Value) (driver.Result, error) {
220220

221221
// ExecContext implements driver.StmtExecContext/ExecContext.
222222
//
223-
// @Available since <<VERSION>>
223+
// @Available since v1.1.0
224224
func (s *StmtAlterCollection) ExecContext(_ context.Context, args []driver.NamedValue) (driver.Result, error) {
225225
if len(args) != 0 {
226226
return nil, fmt.Errorf("expected 0 input value, got %d", len(args))
@@ -261,7 +261,7 @@ type StmtDropCollection struct {
261261

262262
// String implements fmt.Stringer/String.
263263
//
264-
// @Available since <<VERSION>>
264+
// @Available since v1.1.0
265265
func (s *StmtDropCollection) String() string {
266266
return fmt.Sprintf(`StmtDropCollection{Stmt: %s, db: %q, collection: %q, if_exists: %t}`,
267267
s.Stmt, s.dbName, s.collName, s.ifExists)
@@ -287,7 +287,7 @@ func (s *StmtDropCollection) Exec(args []driver.Value) (driver.Result, error) {
287287

288288
// ExecContext implements driver.StmtExecContext/ExecContext.
289289
//
290-
// @Available since <<VERSION>>
290+
// @Available since v1.1.0
291291
func (s *StmtDropCollection) ExecContext(_ context.Context, args []driver.NamedValue) (driver.Result, error) {
292292
if len(args) != 0 {
293293
return nil, fmt.Errorf("expected 0 input value, got %d", len(args))
@@ -317,7 +317,7 @@ type StmtListCollections struct {
317317

318318
// String implements fmt.Stringer/String.
319319
//
320-
// @Available since <<VERSION>>
320+
// @Available since v1.1.0
321321
func (s *StmtListCollections) String() string {
322322
return fmt.Sprintf(`StmtListCollections{Stmt: %s, db: %q}`, s.Stmt, s.dbName)
323323
}
@@ -342,7 +342,7 @@ func (s *StmtListCollections) Query(args []driver.Value) (driver.Rows, error) {
342342

343343
// QueryContext implements driver.StmtQueryContext/QueryContext.
344344
//
345-
// @Available since <<VERSION>>
345+
// @Available since v1.1.0
346346
func (s *StmtListCollections) QueryContext(_ context.Context, args []driver.NamedValue) (driver.Rows, error) {
347347
if len(args) != 0 {
348348
return nil, fmt.Errorf("expected 0 input value, got %d", len(args))

stmt_database.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type StmtCreateDatabase struct {
2626

2727
// String implements fmt.Stringer/String.
2828
//
29-
// @Available since <<VERSION>>
29+
// @Available since v1.1.0
3030
func (s *StmtCreateDatabase) String() string {
3131
return fmt.Sprintf(`StmtCreateDatabase{Stmt: %s, db: %q, if_not_exists: %t, ru: %d, maxru: %d}`,
3232
s.Stmt, s.dbName, s.ifNotExists, s.ru, s.maxru)
@@ -79,7 +79,7 @@ func (s *StmtCreateDatabase) Exec(args []driver.Value) (driver.Result, error) {
7979

8080
// ExecContext implements driver.StmtExecContext/ExecContext.
8181
//
82-
// @Available since <<VERSION>>
82+
// @Available since v1.1.0
8383
func (s *StmtCreateDatabase) ExecContext(_ context.Context, args []driver.NamedValue) (driver.Result, error) {
8484
if len(args) != 0 {
8585
return nil, fmt.Errorf("expected 0 input value, got %d", len(args))
@@ -114,7 +114,7 @@ type StmtAlterDatabase struct {
114114

115115
// String implements fmt.Stringer/String.
116116
//
117-
// @Available since <<VERSION>>
117+
// @Available since v1.1.0
118118
func (s *StmtAlterDatabase) String() string {
119119
return fmt.Sprintf(`StmtAlterDatabase{Stmt: %s, db: %q, ru: %d, maxru: %d}`,
120120
s.Stmt, s.dbName, s.ru, s.maxru)
@@ -206,7 +206,7 @@ type StmtDropDatabase struct {
206206

207207
// String implements fmt.Stringer/String.
208208
//
209-
// @Available since <<VERSION>>
209+
// @Available since v1.1.0
210210
func (s *StmtDropDatabase) String() string {
211211
return fmt.Sprintf(`StmtDropDatabase{Stmt: %s, db: %q, if_exists: %t}`,
212212
s.Stmt, s.dbName, s.ifExists)
@@ -229,7 +229,7 @@ func (s *StmtDropDatabase) Exec(args []driver.Value) (driver.Result, error) {
229229

230230
// ExecContext implements driver.StmtExecContext/ExecContext.
231231
//
232-
// @Available since <<VERSION>>
232+
// @Available since v1.1.0
233233
func (s *StmtDropDatabase) ExecContext(_ context.Context, args []driver.NamedValue) (driver.Result, error) {
234234
if len(args) != 0 {
235235
return nil, fmt.Errorf("expected 0 input value, got %d", len(args))
@@ -258,7 +258,7 @@ type StmtListDatabases struct {
258258

259259
// String implements fmt.Stringer/String.
260260
//
261-
// @Available since <<VERSION>>
261+
// @Available since v1.1.0
262262
func (s *StmtListDatabases) String() string {
263263
return fmt.Sprintf(`StmtListDatabases{Stmt: %s}`, s.Stmt)
264264
}
@@ -280,7 +280,7 @@ func (s *StmtListDatabases) Query(args []driver.Value) (driver.Rows, error) {
280280

281281
// QueryContext implements driver.StmtQueryContext/QueryContext.
282282
//
283-
// @Available since <<VERSION>>
283+
// @Available since v1.1.0
284284
func (s *StmtListDatabases) QueryContext(_ context.Context, args []driver.NamedValue) (driver.Rows, error) {
285285
if len(args) != 0 {
286286
return nil, fmt.Errorf("expected 0 input value, got %d", len(args))

stmt_document.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ type StmtCRUD struct {
165165

166166
// String implements interface fmt.Stringer/String.
167167
//
168-
// @Available since <<VERSION>>
168+
// @Available since v1.1.0
169169
func (s *StmtCRUD) String() string {
170170
return fmt.Sprintf(`StmtCRUD{Stmt: %s, db: %q, collection: %q, is_single_pk: %v, with_pk: %q, pk_paths: %v, num_pk_paths: %d}`,
171171
s.Stmt, s.dbName, s.collName, s.isSinglePathPk, s.withPk, s.pkPaths, s.numPkPaths)
@@ -265,7 +265,7 @@ type StmtInsert struct {
265265

266266
// String implements interface fmt.Stringer/String.
267267
//
268-
// @Available since <<VERSION>>
268+
// @Available since v1.1.0
269269
func (s *StmtInsert) String() string {
270270
return fmt.Sprintf(`StmtInsert{StmtCRUD: %s, upsert: %v, field_str: %q, value_str: %q, fields: %v, values: %v}`,
271271
s.StmtCRUD, s.isUpsert, s.fieldsStr, s.valuesStr, s.fields, s.values)
@@ -321,7 +321,7 @@ func (s *StmtInsert) Exec(args []driver.Value) (driver.Result, error) {
321321

322322
// ExecContext implements driver.StmtExecContext/ExecContext.
323323
//
324-
// @Available since <<VERSION>>
324+
// @Available since v1.1.0
325325
func (s *StmtInsert) ExecContext(_ context.Context, args []driver.NamedValue) (driver.Result, error) {
326326
// TODO: pass ctx to REST API client
327327

@@ -414,7 +414,7 @@ type StmtDelete struct {
414414

415415
// String implements interface fmt.Stringer/String.
416416
//
417-
// @Available since <<VERSION>>
417+
// @Available since v1.1.0
418418
func (s *StmtDelete) String() string {
419419
return fmt.Sprintf(`StmtDelete{StmtCRUD: %s, where_clause: %q, id: %v, pk_values: %v}`,
420420
s.StmtCRUD, s.whereStr, s.id, s.pkValues)
@@ -478,7 +478,7 @@ func (s *StmtDelete) Exec(args []driver.Value) (driver.Result, error) {
478478

479479
// ExecContext implements driver.StmtExecContext/ExecContext.
480480
//
481-
// @Available since <<VERSION>>
481+
// @Available since v1.1.0
482482
func (s *StmtDelete) ExecContext(_ context.Context, args []driver.NamedValue) (driver.Result, error) {
483483
// TODO: pass ctx to REST API client
484484

@@ -571,7 +571,7 @@ type StmtSelect struct {
571571

572572
// String implements interface fmt.Stringer/String.
573573
//
574-
// @Available since <<VERSION>>
574+
// @Available since v1.1.0
575575
func (s *StmtSelect) String() string {
576576
return fmt.Sprintf(`StmtSelect{Stmt: %s, cross_partition: %v, db: %q, collection: %q}`,
577577
s.Stmt, s.isCrossPartition, s.dbName, s.collName)
@@ -643,7 +643,7 @@ func (s *StmtSelect) Query(args []driver.Value) (driver.Rows, error) {
643643

644644
// QueryContext implements driver.StmtQueryContext/QueryContext.
645645
//
646-
// @Available since <<VERSION>>
646+
// @Available since v1.1.0
647647
func (s *StmtSelect) QueryContext(_ context.Context, args []driver.NamedValue) (driver.Rows, error) {
648648
// TODO: pass ctx to REST API client
649649

@@ -709,7 +709,7 @@ type StmtUpdate struct {
709709

710710
// String implements interface fmt.Stringer/String.
711711
//
712-
// @Available since <<VERSION>>
712+
// @Available since v1.1.0
713713
func (s *StmtUpdate) String() string {
714714
return fmt.Sprintf(`StmtUpdate{StmtCRUD: %s, fields: %v, values: %v, where_clause: %q, id: %v, pk_values: %v}`,
715715
s.StmtCRUD, s.fields, s.values, s.whereStr, s.id, s.pkValues)
@@ -813,7 +813,7 @@ func (s *StmtUpdate) Exec(args []driver.Value) (driver.Result, error) {
813813

814814
// ExecContext implements driver.StmtExecContext/ExecContext.
815815
//
816-
// @Available since <<VERSION>>
816+
// @Available since v1.1.0
817817
func (s *StmtUpdate) ExecContext(_ context.Context, args []driver.NamedValue) (driver.Result, error) {
818818
// TODO: pass ctx to REST API client
819819

0 commit comments

Comments
 (0)