Commit graph

157 commits

Author SHA1 Message Date
814ebddfa2
Add support for PostGIS Geometry columns
This is primarily an experiment. At this point I'm getting back the
Geometry as a GeoJSON blob, which is pretty massive progress, but I'm
still not able to manipulate the data directly the way I'd like.
2026-05-06 20:36:10 +00:00
2053415c76
Make it possible to add fully custom columns to table definition
This adds a few different fields to the column SQL builder that were
once either calculated or hard-coded:
 * Import - so you can import the column from anywhere
 * Type - fully, rather than partially, modifiable to allow any naming
   convention
 * TypeFactory - fully, rather than partially defined

I also alphabetized some things because the OCD compels me.
2026-05-06 16:26:38 +00:00
go-jet
159cd95599 If SELECT_JSON returns more than one row of NULL values, SELECT_JSON should return an error. 2026-05-04 12:41:19 +02:00
Felipe Pinheiro
ea8a35d497
Remove pgproto3/v2 dep by upgrading pgx/v4 to v5
pgx/v4/stdlib was only used in test infrastructure, but its transitive
dependency on jackc/pgproto3/v2 exposed the build to GO-2026-4518 (DoS
via negative field length panic in DataRow.Decode).

Replaces the pgconn.ParseConfig call via GenerateDSN with url.Parse for
DSN validation, and SELECT current_database() for retrieving the
database name, removing the last non-test dependency on the pgx/v4.

Updates TestUInt64Overflow in tests/postgres to match pgx/v5 error
format: v5 renamed Int to Int64 across pgtype to match database/sql
conventions, so the overflow error now says "int64" instead of "Int8".

Bumps minimum Go version to 1.24 (required by pgx/v5).
2026-03-23 14:00:29 -03:00
go-jet
27c67aee3d Fix false positive security scan issues. 2026-02-16 13:04:00 +01:00
Enzo Fernandes
5bc39dae41 fix: remove random comments on CockroachDB tables generation 2026-02-01 18:16:50 -03:00
go-jet
4ee047a675 Add support for additional array types. 2025-10-16 15:09:07 +02:00
go-jet
45d4ced9b0 Merge branch 'arjen-ag5/master' into pg_arrays
# Conflicts:
#	generator/template/model_template.go
#	generator/template/sql_builder_template.go
#	internal/jet/expression.go
#	postgres/cast.go
#	postgres/columns.go
#	postgres/expressions.go
#	postgres/insert_statement_test.go
#	postgres/literal.go
#	tests/postgres/alltypes_test.go
#	tests/postgres/generator_template_test.go
#	tests/postgres/scan_test.go
#	tests/postgres/select_test.go
2025-10-16 13:44:18 +02:00
Arjen Brouwer
d3ada5361e Add support for postgres arrays 2025-10-16 13:32:18 +02:00
SanjaiyKumar
a56447d1fc Excluded GENERATED ALWAYS VIRTUAL columns from mutable columns 2025-06-12 04:22:37 +05:30
go-jet
3f52b182b5 Merge remote-tracking branch 'upstream/master' into develop 2025-04-26 14:37:08 +02:00
go-jet
6813237d4e Merge branch 'master' into develop 2025-04-26 14:36:22 +02:00
Josh Kaplinsky
0d361c8863
chore: remove unit tests 2025-04-14 08:36:13 -04:00
Josh Kaplinsky
e8e4cfc1e0
chore: add unit tests for code cov 2025-04-10 09:28:51 -04:00
Josh Kaplinsky
436a72ae5c
feat: skip model and sql gen options in cli 2025-04-10 09:02:23 -04:00
go-jet
a366feb01d
Merge pull request #476 from markvai/fix-custom-type-parameter-gen
Add a field for additional imports when using generic types
2025-04-02 12:36:47 +02:00
markvai
0947de0628 Add the ability to use custom generic types with non std inner types
- fix #442

- Since handling all edge cases for generic type parsing is not trivial, users will specify the fields manually.
- To support more than one import per type, add an additional field for extra imports per type.

- Add examples for defining those types in the current tests that show how to define custom types.
2025-03-31 21:24:54 +03:00
go-jet
06530363f5
Merge pull request #458 from switchupcb/patch-1
remove redundant call in filesys RemoveDir
2025-03-16 18:50:17 +01:00
SwitchUpCB
77dc0bcb57 remove unused
https://github.com/go-jet/jet/pull/458#discussion_r1986128416
2025-03-11 15:39:22 +00:00
go-jet
74f48fc567 Fix mariadb HasDefault column. 2025-03-02 14:45:41 +01:00
go-jet
c94216ab0e Add support for blob expressions. 2025-02-28 18:23:15 +01:00
charlie
0b664c6425 fixed default columns for mysql generator 2025-02-16 09:30:54 +01:00
charlie
38ea65434f DefaultColumns() helper on Table 2025-02-06 09:34:22 +01:00
TotallyGamerJet
8975f87830 Remove dbName as argument 2025-01-21 14:06:34 -05:00
TotallyGamerJet
e4ceb421de generator/*: allow passing DB directly
Closes #441
2025-01-17 14:50:59 -05:00
Alexander Trost
60ba05b6fb
feat: add generator skip option for table columns
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2025-01-07 22:30:15 +01:00
Jamius Siam
cab3cc63bf Replace path package with filepath 2024-11-26 15:40:34 +06:00
johnflynn
9f8732cd95 Updated sql_builder_template to check if column is in a conflicted column name array and renames to {col}_ if it is a conflicting name. Added unit tests. 2024-10-26 22:43:41 -04:00
Volker Lieber
b5f04ffea8 Improved postgres table comment generation 2024-09-26 14:33:23 +02:00
Volker Lieber
64884e4969 Extracted golang comment format function 2024-09-26 14:17:21 +02:00
Volker Lieber
0f21699a1f Implemented postgres enum comment generation 2024-09-25 14:42:27 +02:00
Volker Lieber
ff82eb5df7 Implemented postgres table and enum comment generation 2024-09-24 20:41:27 +02:00
Volker Lieber
929109622e Include postgres comments in output
#391
2024-09-24 13:23:47 +02:00
Samir Faci
4f80e0d36b Addressing Code review comments 2024-09-22 09:44:13 -04:00
Samir Faci
42a37c09d0 Adding support for enum model AllValues
Fixes #368

ChangeLog:
  - Updating test mysql version as it no longer exists.
  - Add a simple validation test
2024-09-18 12:16:58 -04:00
Mike Nelson
cf08bcd6f7 spacing 2024-08-28 11:46:35 -06:00
Mike Nelson
882b4311b5 Fix Postgres column array detection 2024-08-28 11:09:16 -06:00
Andrew Harding
b7904cde4e Add HasDefault column metadata 2024-08-13 14:52:54 -06:00
Sarkan
893567daca
Range types implemented
plus and minus infinity keyword tests implemented

range table tests added

skip cockroach db added

select test case added for range fields

generator modified to generate correct types

generator tests modified to include sample range table

model and template generators modified to support range fields

returning the T in UPPER and LOWER functions

raw ranges implemented

bounds set as optional

dep modified

dependencies modified and issue fixed

range expression with templates implemented

rangeExpression change to make it more type safe

third parameter of constructor function fixed

literals removed, functions added

tests modified

constructor functions used for creating range expressions

NumRange converted to a constructor function from literal

range_lower and range_upper renamed to lower_bound and upper_bound

range literal removed

PlusInfinity and MinusInfinity implemented

int4 and int8 castings added

issues fixed and tests checked

number, ts, tstz literal and cast implemented

date range literal expression modified and raw function used

parent type converted from RangeExpression to Expression

range type implemented for postgres

range column type, function and literal expression implemented

CONTAINS and OVERLAP operations added for range expressions

range expressions implemented
2024-02-25 01:20:36 +01:00
Jupp Mueller
bffec36917
Improve performance of mysql generator
This change improves performance for generating mysql models
for databases with large number of tables. In my local testing
for a database with about 1000 tables and 140k columns, generation
time was reduced from about 1h to less than one second.
2024-02-17 05:35:56 -08:00
go-jet
6b098b8e41 Replace invalid character from the go identifiers with description string. 2024-02-17 12:46:00 +01:00
go-jet
2eaa75345c [sqlite] Generated columns additional tests. 2024-02-04 18:45:48 +01:00
go-jet
71fb1c7cd1 Add support for sqlite generated columns. 2024-02-04 18:35:26 +01:00
go-jet
7f48e9fb67 Add support for materialized views. 2024-02-01 15:20:49 +01:00
Yosyp Buchma
dd8d043cb8 moved mysql connection pool config to openConection func 2023-09-20 13:13:50 +03:00
Yosyp Buchma
f472becd89 simplified concurrent querying 2023-09-19 20:56:54 +03:00
Yosyp Buchma
ffabf8b26e coalesce pk.IsPrimaryKey 2023-09-19 20:56:21 +03:00
Yosyp Buchma
98dfce2ae5 Concurrent GetTableColumnsMetaData for MySQL 2023-09-18 17:48:35 +03:00
Yosyp Buchma
db808f136b Faster MySQL GetTableColumnsMetaData query 2023-09-18 17:35:11 +03:00
quirell
39f9996b34 Add DefaultAlias option to TableSQLBuilder 2023-08-02 10:03:59 +09:00