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

feat: add tablesFilter to pushSchema api #3141

Merged
merged 3 commits into from
Nov 4, 2024

Conversation

DanRibbens
Copy link
Contributor

For us to support postgis extensions to Payload projects we need this so that we do not get prompts to delete all tables that were created by CREATE IF NOT EXISTS extension postgis

r1tsuu added a commit to payloadcms/payload that referenced this pull request Oct 18, 2024
@DanRibbens
Copy link
Contributor Author

Hey @AndriiSherman, is there anything more we need to do to get this merged?

@ainsleyclark
Copy link

Hi there,
Is there any possibility of getting this merged?

@AndriiSherman AndriiSherman changed the base branch from main to beta November 3, 2024 09:30
@AndriiSherman
Copy link
Member

Will be included in the next release!

@AndriiSherman AndriiSherman merged commit 4d56096 into drizzle-team:beta Nov 4, 2024
6 checks passed
AndriiSherman added a commit that referenced this pull request Nov 6, 2024
* Fix breakpoints option default value

* fix: added commonly used columns to supabase auth.users table schema

* imports checker with OHM grammar

* imports checker with OHM grammar + fix of imports issues

* Formatting fix

* [MySQL] Add unsigned floating point types + Fix unsigned integer type bugs in Kit (#3284)

* Fix bugs with MySQL introspection tests

* Update float data type in MySQL

* Better support for float types in MySQL

* Handle existing unsigned numerical types in MySQL

* Add unsigned to floating point types in MySQL

* Handle unsigned floating point types in MySQL

* Update decimal data type

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Batch of bugfixes for ORM (#3181)

* (MySQL) Fix placeholder type error in offset and limit

* Add prepared statement tests

* Add PG test

* Fix blob parsing in bun sqlite driver

* Lint and format

* Fix file

* Fix tests

* Use const instead of let in tests

* Format

---------

Co-authored-by: Andrii Sherman <[email protected]>

* main to beta (#3404)

* Update Github issue templates (#3157)

* Update GH issue templates

* Update issue templates

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Fix checkboxes

---------

Co-authored-by: L-Mario564 <[email protected]>

* feat: add tablesFilter to pushSchema api (#3141)

* feat: add tablesFilter to pushSchema api

* Format with dprint

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Batch of bugfixes for Kit (#2959)

* Escape single quote in enum value

* Escape single quotes in string default values

* Handle instrospection of strings with single quotes

* Add tests

* Add tests

* Uncomment tests

* Fix SQL statement order in MySQL

* Add MySQL test

* Fix alter composite PK statement missing quotes in PG

* Add tests

* Handle SQL expressions in timestamp, date and time in PG

* Use `.run` instead of `.query` in SQLite queries that don't return anything

* Fix parsing of enum array types in PG

* Generate more PG index operators

* Fix primary key recreate on table rename

* Format

* Format

* Update test

* Format

* Fix tests

* Fix terminal output mistake

* Remove duplicate import

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Bump versions

---------

Co-authored-by: Steffen <[email protected]>
Co-authored-by: Nicholas Ly <[email protected]>
Co-authored-by: Alex Blokh <[email protected]>
Co-authored-by: Sukairo-02 <[email protected]>
Co-authored-by: L-Mario564 <[email protected]>
Co-authored-by: Dan Ribbens <[email protected]>
@ainsleyclark
Copy link

Hi @AndriiSherman do you know when this will be released into main?
Many thanks.

DanRibbens pushed a commit to payloadcms/payload that referenced this pull request Nov 11, 2024
### What?
Adds full support for the point field to Postgres and Vercel Postgres
adapters through the Postgis extension. Fully the same API as with
MongoDB, including support for `near`, `within` and `intersects`
operators.

Additionally, exposes to adapter args:
*
`tablesFilter`https://orm.drizzle.team/docs/drizzle-kit-push#including-tables-schemas-and-extensions.
* `extensions` list of extensions to create, for example `['vector',
'pg_search']`, `postgis` is created automatically if there's any point
field

### Why?
It's essential to support that field type, especially if the postgres
adapter should be out of beta on 3.0 stable.

### How?
* Bumps `drizzle-orm` to `0.36.1` and `drizzle-kit` to `0.28.0` as we
need this change drizzle-team/drizzle-orm#3141
* Uses its functions to achieve querying functionality, for example the
`near` operator works through `ST_DWithin` or `intersects` through
`ST_Intersects`.
* Removes MongoDB condition from all point field tests, but keeps for
SQLite

Resolves these discussions:
#8996
#8644
AndriiSherman added a commit that referenced this pull request Nov 12, 2024
* Beta (#3503)

* Fix breakpoints option default value

* fix: added commonly used columns to supabase auth.users table schema

* imports checker with OHM grammar

* imports checker with OHM grammar + fix of imports issues

* Formatting fix

* [MySQL] Add unsigned floating point types + Fix unsigned integer type bugs in Kit (#3284)

* Fix bugs with MySQL introspection tests

* Update float data type in MySQL

* Better support for float types in MySQL

* Handle existing unsigned numerical types in MySQL

* Add unsigned to floating point types in MySQL

* Handle unsigned floating point types in MySQL

* Update decimal data type

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Batch of bugfixes for ORM (#3181)

* (MySQL) Fix placeholder type error in offset and limit

* Add prepared statement tests

* Add PG test

* Fix blob parsing in bun sqlite driver

* Lint and format

* Fix file

* Fix tests

* Use const instead of let in tests

* Format

---------

Co-authored-by: Andrii Sherman <[email protected]>

* main to beta (#3404)

* Update Github issue templates (#3157)

* Update GH issue templates

* Update issue templates

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Fix checkboxes

---------

Co-authored-by: L-Mario564 <[email protected]>

* feat: add tablesFilter to pushSchema api (#3141)

* feat: add tablesFilter to pushSchema api

* Format with dprint

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Batch of bugfixes for Kit (#2959)

* Escape single quote in enum value

* Escape single quotes in string default values

* Handle instrospection of strings with single quotes

* Add tests

* Add tests

* Uncomment tests

* Fix SQL statement order in MySQL

* Add MySQL test

* Fix alter composite PK statement missing quotes in PG

* Add tests

* Handle SQL expressions in timestamp, date and time in PG

* Use `.run` instead of `.query` in SQLite queries that don't return anything

* Fix parsing of enum array types in PG

* Generate more PG index operators

* Fix primary key recreate on table rename

* Format

* Format

* Update test

* Format

* Fix tests

* Fix terminal output mistake

* Remove duplicate import

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Bump versions

---------

Co-authored-by: Steffen <[email protected]>
Co-authored-by: Nicholas Ly <[email protected]>
Co-authored-by: Alex Blokh <[email protected]>
Co-authored-by: Sukairo-02 <[email protected]>
Co-authored-by: L-Mario564 <[email protected]>
Co-authored-by: Dan Ribbens <[email protected]>

* Dprint

* Fixed `sql` omitting schema names when processing columns, fixed related test cases

* Fixed dprint formatting issues

* Fixed lack of schema name on integration tests column references

* Removed `\!`

---------

Co-authored-by: Andrii Sherman <[email protected]>
Co-authored-by: Steffen <[email protected]>
Co-authored-by: Nicholas Ly <[email protected]>
Co-authored-by: Alex Blokh <[email protected]>
Co-authored-by: L-Mario564 <[email protected]>
Co-authored-by: Dan Ribbens <[email protected]>
AndriiSherman added a commit that referenced this pull request Nov 14, 2024
* Fix breakpoints option default value

* fix: added commonly used columns to supabase auth.users table schema

* imports checker with OHM grammar

* imports checker with OHM grammar + fix of imports issues

* Formatting fix

* [MySQL] Add unsigned floating point types + Fix unsigned integer type bugs in Kit (#3284)

* Fix bugs with MySQL introspection tests

* Update float data type in MySQL

* Better support for float types in MySQL

* Handle existing unsigned numerical types in MySQL

* Add unsigned to floating point types in MySQL

* Handle unsigned floating point types in MySQL

* Update decimal data type

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Batch of bugfixes for ORM (#3181)

* (MySQL) Fix placeholder type error in offset and limit

* Add prepared statement tests

* Add PG test

* Fix blob parsing in bun sqlite driver

* Lint and format

* Fix file

* Fix tests

* Use const instead of let in tests

* Format

---------

Co-authored-by: Andrii Sherman <[email protected]>

* main to beta (#3404)

* Update Github issue templates (#3157)

* Update GH issue templates

* Update issue templates

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Fix checkboxes

---------

Co-authored-by: L-Mario564 <[email protected]>

* feat: add tablesFilter to pushSchema api (#3141)

* feat: add tablesFilter to pushSchema api

* Format with dprint

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Batch of bugfixes for Kit (#2959)

* Escape single quote in enum value

* Escape single quotes in string default values

* Handle instrospection of strings with single quotes

* Add tests

* Add tests

* Uncomment tests

* Fix SQL statement order in MySQL

* Add MySQL test

* Fix alter composite PK statement missing quotes in PG

* Add tests

* Handle SQL expressions in timestamp, date and time in PG

* Use `.run` instead of `.query` in SQLite queries that don't return anything

* Fix parsing of enum array types in PG

* Generate more PG index operators

* Fix primary key recreate on table rename

* Format

* Format

* Update test

* Format

* Fix tests

* Fix terminal output mistake

* Remove duplicate import

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Bump versions

* fix: typo (#3172)

Co-authored-by: Andrii Sherman <[email protected]>

* Fix typo (#3030)

Trivial: "You ... is ready" -> "Your ... is ready"

Co-authored-by: Andrii Sherman <[email protected]>

* [MySQL] Correct $returningId() implementation to correctly store selected fields (#2975)

* Add test to reproduce $returningId() column order issue

Currently, $returningId() only works when the primary key is in the
first column (of the Drizzle table definition not the underlying
MySQL table).

This new test checks for this behaviour by using $returningId()
when the primary key is in the second column.

See #2971

Signed-off-by: Daniel Harvey <[email protected]>

* Fix $returningId() to correctly set selected fields

The local variable `returning` computes the selected fields in
$returningId() but throws this away. Change to correctly
store config in the insert query builder.

Fixed #2971

Signed-off-by: Daniel Harvey <[email protected]>

---------

Signed-off-by: Daniel Harvey <[email protected]>
Co-authored-by: Andrii Sherman <[email protected]>

* revise and proofread project documentation (#2960)

Co-authored-by: Andrii Sherman <[email protected]>

* Fixed lack of schema name on columns in sql (#3531)

* Beta (#3503)

* Fix breakpoints option default value

* fix: added commonly used columns to supabase auth.users table schema

* imports checker with OHM grammar

* imports checker with OHM grammar + fix of imports issues

* Formatting fix

* [MySQL] Add unsigned floating point types + Fix unsigned integer type bugs in Kit (#3284)

* Fix bugs with MySQL introspection tests

* Update float data type in MySQL

* Better support for float types in MySQL

* Handle existing unsigned numerical types in MySQL

* Add unsigned to floating point types in MySQL

* Handle unsigned floating point types in MySQL

* Update decimal data type

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Batch of bugfixes for ORM (#3181)

* (MySQL) Fix placeholder type error in offset and limit

* Add prepared statement tests

* Add PG test

* Fix blob parsing in bun sqlite driver

* Lint and format

* Fix file

* Fix tests

* Use const instead of let in tests

* Format

---------

Co-authored-by: Andrii Sherman <[email protected]>

* main to beta (#3404)

* Update Github issue templates (#3157)

* Update GH issue templates

* Update issue templates

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Fix checkboxes

---------

Co-authored-by: L-Mario564 <[email protected]>

* feat: add tablesFilter to pushSchema api (#3141)

* feat: add tablesFilter to pushSchema api

* Format with dprint

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Batch of bugfixes for Kit (#2959)

* Escape single quote in enum value

* Escape single quotes in string default values

* Handle instrospection of strings with single quotes

* Add tests

* Add tests

* Uncomment tests

* Fix SQL statement order in MySQL

* Add MySQL test

* Fix alter composite PK statement missing quotes in PG

* Add tests

* Handle SQL expressions in timestamp, date and time in PG

* Use `.run` instead of `.query` in SQLite queries that don't return anything

* Fix parsing of enum array types in PG

* Generate more PG index operators

* Fix primary key recreate on table rename

* Format

* Format

* Update test

* Format

* Fix tests

* Fix terminal output mistake

* Remove duplicate import

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Bump versions

---------

Co-authored-by: Steffen <[email protected]>
Co-authored-by: Nicholas Ly <[email protected]>
Co-authored-by: Alex Blokh <[email protected]>
Co-authored-by: Sukairo-02 <[email protected]>
Co-authored-by: L-Mario564 <[email protected]>
Co-authored-by: Dan Ribbens <[email protected]>

* Dprint

* Fixed `sql` omitting schema names when processing columns, fixed related test cases

* Fixed dprint formatting issues

* Fixed lack of schema name on integration tests column references

* Removed `\!`

---------

Co-authored-by: Andrii Sherman <[email protected]>
Co-authored-by: Steffen <[email protected]>
Co-authored-by: Nicholas Ly <[email protected]>
Co-authored-by: Alex Blokh <[email protected]>
Co-authored-by: L-Mario564 <[email protected]>
Co-authored-by: Dan Ribbens <[email protected]>

* Update driver.ts (#3424)

Co-authored-by: Andrii Sherman <[email protected]>

* fix: wrong dialect set in mysql/sqlite introspect (#2865)

Co-authored-by: Andrii Sherman <[email protected]>

* Extra `update` in comment (#2864)

Removed and extra `update` text in the comment description using onDuplicateKeyUpdate

* chore: export PgIntegerBuilderInitial type as are all other pg-core columns (#2846)

Co-authored-by: Alexis Reymann <[email protected]>
Co-authored-by: Andrii Sherman <[email protected]>

* Support more types in text comparing sql expressions (#2805)

Co-authored-by: Andrii Sherman <[email protected]>

* drizzle-kit/commands/migrate: fix "you code" typo (#2801)

"put you code below" 
should be
"put your code below"

* Fixed `.generated` behaviour with non-strict `tsconfig` (fixes #2654) (#3542)

* Fix Drizzle ORM for expo-sqlite (#3197)

* Fix Drizzle ORM for expo-sqlite

closes #3195

* bump expo-sqlite version to 14.0.0 in package.json and pnpm-lock.yaml

---------

Co-authored-by: Andrii Sherman <[email protected]>

* Upgrade turbo to v2

* Wait for drizzle-orm to be ready

* Format turbo json

* Fix turbo for eslint plugin

* Add release notes

---------

Signed-off-by: Daniel Harvey <[email protected]>
Co-authored-by: Steffen <[email protected]>
Co-authored-by: Nicholas Ly <[email protected]>
Co-authored-by: Alex Blokh <[email protected]>
Co-authored-by: Sukairo-02 <[email protected]>
Co-authored-by: L-Mario564 <[email protected]>
Co-authored-by: Dan Ribbens <[email protected]>
Co-authored-by: Armand SALLE <[email protected]>
Co-authored-by: Christopher Masto <[email protected]>
Co-authored-by: Daniel Harvey <[email protected]>
Co-authored-by: wackbyte <[email protected]>
Co-authored-by: Sergey Reka <[email protected]>
Co-authored-by: Michael Lohr <[email protected]>
Co-authored-by: Mickael Lecoq <[email protected]>
Co-authored-by: Asher Chan <[email protected]>
Co-authored-by: Alexis Reymann <[email protected]>
Co-authored-by: Alexis Reymann <[email protected]>
Co-authored-by: Max Leiter <[email protected]>
Co-authored-by: Subramanya Chakravarthy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants