Skip to content

Releases: rfberaldo/sqlz

v0.4.2

Choose a tag to compare

@rfberaldo rfberaldo released this 17 Aug 18:38
  • feat: add Scanner.SetIgnoreMissingFields
  • fix: close rows on error

v0.4.0

Choose a tag to compare

@rfberaldo rfberaldo released this 23 Jul 18:47

v0.3.2

Choose a tag to compare

@rfberaldo rfberaldo released this 18 Oct 15:55
  • Add automatic prepared statement caching, see docs.

v0.3.1

Choose a tag to compare

@rfberaldo rfberaldo released this 13 Oct 18:56
  • Breaking: Query and QueryRow now returns a Scanner object, with deferred query error
  • Drop scany as a dependency
  • Performance improvements in general

v0.2.3

Choose a tag to compare

@rfberaldo rfberaldo released this 23 Aug 12:42
  • feat: batch insert now works with suffix clauses (ON DUPLICATE KEY, ON CONFLICT clauses after values)

v0.2.2

Choose a tag to compare

@rfberaldo rfberaldo released this 06 May 14:46
  • fix: return correct error on QueryRow (#4)

v0.2.1

Choose a tag to compare

@rfberaldo rfberaldo released this 25 Mar 15:28
  • fix: do not spread []byte values

v0.2.0

Choose a tag to compare

@rfberaldo rfberaldo released this 21 Mar 21:53
  • feat: support non-english characters (#2)
  • small performance adjustments

v0.1.1

Choose a tag to compare

@rfberaldo rfberaldo released this 21 Mar 15:31
  • Fix batch inserts ending with a mix of whitespaces and semicolon
  • Fix exec with 'IN' clause and default placeholders
  • Better performance for batch inserts

v0.1.0

Choose a tag to compare

@rfberaldo rfberaldo released this 20 Mar 15:46

Package sqlz is a wrapper around sql.DB and sql.Tx. Primary features are:

  • Easy to use: it has a simple API for everyday use that can handle several use cases.
  • Lightweight: performance is similar to sqlx, and only has one dependency.

It has only 3 main methods that can handle different use cases:

Query(ctx context.Context, dst any, query string, args ...any) error
QueryRow(ctx context.Context, dst any, query string, args ...any) error
Exec(ctx context.Context, query string, args ...any) (sql.Result, error)

Both Query/QueryRow execute the query and scan the returned rows into the dst parameter, it works with default or named placeholders, passing a struct or map on args works as a named query.

Exec is similar, passing array/slice as args will be treated as a batch insert.