Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/daterange #307

Merged
merged 39 commits into from
Feb 26, 2024
Merged

Feature/daterange #307

merged 39 commits into from
Feb 26, 2024

Conversation

sarkan-ag5
Copy link
Contributor

@sarkan-ag5 sarkan-ag5 commented Jan 31, 2024

This pull request introduces support for PostgreSQL range type fields. With this enhancement, Jet gains the ability to handle PostgreSQL range types seamlessly, enabling users to define and manipulate range-based data directly. The implementation is based on PostgreSQL documents.

dependabot bot and others added 14 commits April 25, 2023 21:59
Bumps [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/go-sql-driver/mysql/releases)
- [Changelog](https://github.com/go-sql-driver/mysql/blob/master/CHANGELOG.md)
- [Commits](go-sql-driver/mysql@v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/go-sql-driver/mysql
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github.com/jackc/pgconn](https://github.com/jackc/pgconn) from 1.14.0 to 1.14.1.
- [Changelog](https://github.com/jackc/pgconn/blob/master/CHANGELOG.md)
- [Commits](jackc/pgconn@v1.14.0...v1.14.1)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgconn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Add DefaultAlias option to TableSQLBuilder
gen/ -> .gen/
…querying

10x mysql db info querying speedup
This adds support for statements such as `SELECT ... FOR UPDATE OF table NOWAIT` where `OF table`
could not be specified previously. Fixes go-jet#285.
Add support for OF in row lock clauses
@sarkan-ag5 sarkan-ag5 marked this pull request as draft January 31, 2024 14:40
postgres/cast.go Outdated Show resolved Hide resolved
@go-jet
Copy link
Owner

go-jet commented Feb 2, 2024

Hi @sarkan-ag5,

Nice work overall.

Couple of additional comments:

  • generator would need to be updated next with a new sql builder types, check -
    func getSqlBuilderColumnType(columnMetaData metadata.Column) string {

    I've made some changes in generator recently, so you might need first to rebase with master.
  • for integration tests we can add one more table range_table to test_sample database. Check test folder how to setup and run intergration tests.

postgres/expressions.go Outdated Show resolved Hide resolved
@go-jet
Copy link
Owner

go-jet commented Feb 13, 2024

Looks, good. The next steps would be to update generator and add integration tests.

go-jet and others added 7 commits February 17, 2024 12:46
…b.com/google/uuid-1.6.0

Bump github.com/google/uuid from 1.3.0 to 1.6.0
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.
…rator-performance

Improve performance of mysql generator
mysql: added a helper to compare UUID strings with uuid_to_bin
@go-jet
Copy link
Owner

go-jet commented Feb 24, 2024

I think we are close now to merge this PR. Could you squash all the commits into one. I'm not completely sure but if I do squash and merge your contribution might be deleted from git history.

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
@go-jet go-jet changed the base branch from master to develop February 26, 2024 10:28
@go-jet
Copy link
Owner

go-jet commented Feb 26, 2024

Looks great. 👍

@go-jet go-jet merged commit f9f8268 into go-jet:develop Feb 26, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants