jet

Type safe SQL builder with code generation and automatic query result data mapping

APACHE-2.0 License

Downloads
14
Stars
2.5K
Committers
34

Bot releases are hidden (Show)

jet - Release v2.11.1 Latest Release

Published by go-jet 7 months ago

[Bug] Postgres ON CONFLICT DO NOTHING without conflict target does not appear in generated SQL (pr).

Special thanks to @BillBuilt for spotting the issue.

jet - Release v2.11.0

Published by go-jet 8 months ago

[New] Postgres support for range types.
[New] Postgres support for materialized views.
[New] Sqlite support for generated columns.
[New] Support for OF in row locking clause.
[New] Postgres support for the FETCH FIRST clause.
[New] Support for NULLS_FIRST and NULLS_LAST sorting order.
[New] Default alias option for table SQL builder.
[New] Faster MySQL code generation for databases with very large numbers of tables.
[New] Postgres support for expression in the OFFSET clause.
[Bug] Invalid go identifiers ASCII characters are replaced with character description string.

New Contributors

@quirell, @ryym, @josephbuchma, @mattdowdell, @jupp0r, @realbucksavage, @sarkan-ag5

jet - Release v2.10.1

Published by go-jet about 1 year ago

[Bug] QRM doesn't group query result correctly if there are two model slices of the same type in the destination and one slice is aliased (issue, more info)
[Bug] Jet generator fails if MySQL column comment contains an ASCII control character (issue)
[Bug] Jet generator usage string shows the wrong version (issue)

jet - Release v2.10.0

Published by go-jet over 1 year ago

[New] Postgres support for GROUPING SET, ROLLUP, CUBE, and GROUPING operators (wiki)
[New] MySQL support for WITH ROLLUP and GROUPING operators (wiki)
[New] UseSchema method to replace targeted schema for table and view SQL Builder types (wiki)
[New] Generated columns are not part of the MutableColumns list anymore (issue)
[New] MySQL column comments are now included in generated files (issue)
[Bug] Generator fails if there is an enum with the same name in multiple Postgres schema (issue)
[Bug] QRM fails to group the result if the primary key is a custom type (issue)
[Bug] QRM fails to group the result if there are duplicate slices in the destination (issue)

jet - Release v.2.9.0

Published by go-jet about 2 years ago

[New] MySql insert row alias for duplicate key update statements (issue, wiki)
[New] MySql statement optimizer hints (issue, wiki)
[New] Postgres json literal (issue)
[Bug] Some mysql and sqlite conditional functions are not exported (issue)
[Bug] Missing SET method for ColumnTimez interface (pr)
[Bug] Reserved word RIGHT missing for postgres dialect (pr)

jet - Release v.2.8.0

Published by go-jet over 2 years ago

[New] CockroachDB support
[New] Table prefix and suffix for multi-tenant environment (issue)
[New] EXTRACT time/date support
[Bug] Ignore tables, views and enums does not work if dsn is present (pr)
[Bug] Statement Query and Exec methods can not be used with sql.Conn (issue)
[Bug] DebugSQL panics with Valuer types (issue)

jet - Release v.2.7.1

Published by go-jet over 2 years ago

[Fix] Poor performance when using Rows to scan the data (issue, wiki)
[New] Global AND and OR functions for better indentation of a complex conditions in the Go code and in the generated SQL (wiki)

jet - Release v.2.7.0

Published by go-jet over 2 years ago

  • [New] [Posgres] [Sqlite] UPDATE statement FROM clause support (issue, wiki)
  • [New] [Postgres] [MySQL] DELETE statement USING clause support (issue, wiki)
  • [New] [QRM] Prevent recursive scan if destination contains circular dependency (issue)
  • [New] WITH RECURSIVE statement support (wiki)
  • [New] BETWEEN operator support (wiki)
  • [New] Aggregate functions DISTINCT operator support (issue)
  • [New] [Postgres] DISTINCT ON clause support (wiki)
  • [New] Ability to update alias of all sub-query(or CTE) projections (wiki)
  • [New] Ability to exclude list of columns from sub-query(or CTE) projections (wiki)
  • [New] Query logger function with additional execution details (issue, wiki)
  • [New] [Postgres] Order set aggregate functions support (issue)
  • [New] Generator flags to ignore tables, views and enums. (issue, wiki)
  • [New] Automatic type cast for sized integer literals (issue)
  • [Fix] Generator no longer supports MySQL 5.7 (issue)
jet - Release v.2.6.0

Published by go-jet almost 3 years ago

  • [New] Generator and SQL Builder support for SQLite databases.
  • [New] Generator customization support (wiki).
  • [New] Ability to exclude columns from ColumnList (wiki)
  • [New] Generator can now connect to the database using DSN (wiki)
  • [Fix] QueryContext panic when the scanned value is nil and the destination is a slice of primitive (issue91)
  • [Fix] Special characters are not working in postgres password for generator (issue95), (issue34),
jet - Release v.2.5.0

Published by go-jet over 3 years ago

  • LATERAL queries support (wiki)
  • RawStatement support (wiki)
  • Expose statement Rows method (wiki)
  • Allow Raw helper to accept named arguments (wiki)
  • Lossless decimal types conversion (wiki)
  • Implicit CROSS JOIN support (wiki)
  • SQL builder schema rename support. (wiki)
  • [Bug][MySQL] UPDATE statement does not escape reserved word when MODEL is used (issue)
  • Allow Bytea literal constructor to accept byte array as well as string
  • New literal constructor functions: (wiki)
    • for each of the integer types - Int32(), UInt32(), Int64, UInt64(), etc..
    • for uuid literal - UUID()
    • for exact decimal literal - Decimal()
jet - Release v.2.4.0

Published by go-jet over 4 years ago

Go modules support
For new download procedure take a look at Installation.
Go mod requires for projects with major version 2 or higher, to include major version at the end of the module paths. This means for go.mod projects, depending of go-jet, will have to update there import paths. This can be achieved with the following command:

find . -type f \
    -name '*.go' \
    -exec sed -i -e 's,github.com/go-jet/jet,github.com/go-jet/jet/v2,g' {} \;

For GOPATH projects import path remains the same.

jet - Release v.2.3.0

Published by go-jet over 4 years ago

  • Support for WITH statements and Common Table Expressions(CTE). Sample usage.
  • [postgres] Support for ON CONFLICT clause (sample)
  • [mysql] Support for ON DUPLICATE KEY UDPATE clause (sample)
  • New type-safe SET clause for UPDATE statement (sample)
  • Generated files idempotency (timestamp removed from generated files) (issue)
  • Automatic query logging (sample)
jet - Release v.2.2.0

Published by go-jet over 4 years ago

  • Interval type support. Sample usage can be seen here.
  • Datetime arithmetic with interval types (ADD/SUB).
  • Dynamic projection list support. Sample usage.
  • [bug] Escape reserved words used as identifiers in generated SQL(issue).
  • [bug] Fix crash on generating enum SQL Builder files when database enum contains numeric values(issue).
jet - Release v.2.1.2

Published by go-jet almost 5 years ago

  • [bug] Incorrect query result mapping into complex destination when UUID is used as primary key(issue).
  • [bug] Query should return error when scanning into struct destination and query result set is empty. Query and QueryContext will now return qrm.ErrNoRows(issue).
jet - Release v.2.1.1

Published by go-jet about 5 years ago

  • New aggregate MIN and MAX functions added that accepts any expression type (issue).
jet - Release v.2.1.0

Published by go-jet about 5 years ago

  • Window function support. Sample usage can be seen here.
  • Database views support
    • Jet generator now generates view sqlbuilder and model types.
    • sqlBuilder types are generated in view folder and will behave the same as table sqlbuilder types.
    • model types are generated in model folder. To use view model type as grouping destination primary_key tag has to be specified manually. More information here.
  • Jet internal types are now aliased. This allows passing of manually constructed expression slices as variadic argument of some operators and functions.
  • [API break] ColumnList is aliased and reverted to be defined as slice of Columns. This will allow conditionally constructing the list of columns, by appending to a slice, before the statements.
    To fix build, just replace parentheses with braces. ColumnList(.....) -> ColumnList{......}
jet - Release v.2.0.0

Published by go-jet about 5 years ago

Changes:

  1. MySQL and MariaDB support:
    • SELECT (DISTINCT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, FOR, UNION, LOCK_IN_SHARE_MODE, sub-queries)
    • INSERT (VALUES, query),
    • UPDATE (SET, WHERE),
    • DELETE (WHERE, ORDER_BY, LIMIT),
    • LOCK (READ, WRITE)
  2. PostgreSQL import part has changed: github.com/go-jet/jet -> github.com/go-jet/jet/postgres
  3. Query execution mapping will also try to convert result set object to destination type if such a conversion is allowed.
  4. For every time type there is now a constructor method that accepts time.Time (DateT, TimeT, TimestampT, TimezT...)
  5. Some methods and types are changed or replaced:
    • Sql() and DebuSql does not return error as a last parameter. If there is an error in statement this methods will panic.
    • RAW -> Raw
    • SIMILAR_TO -> REGEXP_LIKE
    • NOT_SIMILAR_TO -> NOT_REGEXP_LIKE
    • ColumnList{column1, ...} -> ColumnList(column1, ...)
jet - Release v.1.0.0

Published by go-jet about 5 years ago

  • Auto-generated type-safe SQL Builder
    • Types - boolean, integers(smallint, integer, bigint), floats(real, numeric, decimal, double precision),
      strings(text, character, character varying), date, time(z), timestamp(z) and enums.
    • Statements:
      • SELECT (DISTINCT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, FOR, UNION, INTERSECT, EXCEPT, sub-queries)
      • INSERT (VALUES, query, RETURNING),
      • UPDATE (SET, WHERE, RETURNING),
      • DELETE (WHERE, RETURNING),
      • LOCK (IN, NOWAIT)
  • Auto-generated Data Model types - Go types mapped to database type (table or enum), used to store
    result of database queries. Can be combined to create desired query result destination.
  • Query execution with result mapping to arbitrary destination structure.
Package Rankings
Top 1.92% on Proxy.golang.org
Top 30.44% on Formulae.brew.sh
Badges
Extracted from project README
go-jet codecov Go Report Card Documentation GitHub release