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

integration: geospatial types support #1

Closed
wants to merge 211 commits into from

Conversation

janpio
Copy link

@janpio janpio commented Nov 30, 2023

aqrln and others added 30 commits September 11, 2023 10:38
* Add quickfix to migrate `SetDefault` -> `NoAction`
when using `relationMode = "foreignkeys"` on mysql

closes prisma/language-tools#1286
* fix(driver-adapters): stop caching the previous driver adapter in case of same "provider" on the nth libquery constructor invocation

* fix(driver-adapters): clippy

* fix(driver-adapters): replace "HashMap<String, DriverAdapter>\ registry with simpler "Option<DriverAdapter>"

* fix(driver-adapters): clippy

* remove indirection, change naming

---------

Co-authored-by: Miguel Fernandez <[email protected]>
* chore(driver-adapters): remove outdated part of README

* test(driver-adapters): turn libquery tests into assertions

* chore: merge main, fix conflicts, unify test commands

* chore: bump prisma version

* fix: README

* chore: add pgbouncer=true comment in .envrc.example to trigger "DEALLOCATE ALL" in "@prisma/client" tests with Rust drivers

* fix: remove type ignores and update Prisma Client initialisation

* chore: address comments

* chore: remove unused var

* chore: Update query-engine/driver-adapters/js/smoke-test-js/src/client/client.ts

Co-authored-by: Alexey Orlenko <[email protected]>

* chore: apply nit

Co-authored-by: Alexey Orlenko <[email protected]>

* chore: remove unused code

---------

Co-authored-by: Alexey Orlenko <[email protected]>
* feat(quaint): remove "chrono" conditional flag

* feat(quaint): remove "chrono" conditional flag from tests as well
- Update the Nix flake to get new things (especially newer Node.js and pnpm, current pnpm version was older than what driver-adapters required)
- Switch from Node.js 18 to Node.js 20 to match .nvmrc
- Fix the flake after updating to latest nixpkgs due to changes in cargo-auditable. The problem was that we were overriding cargo and rustc packages using our own overlay on top of rust-overlay, but the packages from rust-overlay do not accept the same arguments as those in nixpkgs. That's probably the reason why rust-overlay doesn't do that and defines new packages instead. The `rustToolchain` package we were defining was fine but I moved it to module arguments instead and got rid of the overlay completely.
- Add a way to opt-out of nix for gitpod
* Remove duplicates from metrics listing

* Instead of whitelisting prisma metrics to have an initial value, we are
only whitelisting mobc metrics, and assigning an initial value to them.

Then on the renaming phase (see `METRIC_RENAMES`) these metrics will be
renamed from the mobc name to the internal prisma name, and no duplicates will
appear.

Fixes prisma/prisma#21069
Since type aliases are not a thing,
`AttributesValidationState.attributes` does not need to be a Vec anymore
(we were accumulating attributes defined on the model and on aliases),
it can be an Option. This is simpler to reason about.
… of metrics (#4239)

* Prevent descriptions from mobc leaking into the presentation

* Add a condition over the text, to match on the expected number of metrics

* Fix library engine use of metrics initialization

* Omit pool size counts

* Comment on test

* Do not depend on variable data, TYPE is always displayed when rendering the metric

* Update query-engine/black-box-tests/tests/metrics/smoke_tests.rs

Co-authored-by: Jan Piotrowski <[email protected]>

---------

Co-authored-by: Jan Piotrowski <[email protected]>
Co-authored-by: Sergey Tatarintsev <[email protected]>
Co-authored-by: Miguel Fernandez <[email protected]>
* Allow driver adapters for sqlite family

* Bump driver-adapter-utils version
Currently, get_columns on CockroachDB can end up using a parital index
on pg_class, which can end up internally scanning the pg_class index
multiple times.  Since get_columns only cares about tables, it can have
an extra predicate to avoid unnecessary overhead.

Fixes: #4250
…4260)

Update dependencies of `connector-test-kit-executor` after renaming the
packages in #4252.
Fixup things that were missed after the last and even one of the
previous renames.
When we switched to array mode, we adapted PG driver correctly, but
`neon` only partially. As a result, row values were returned as
`undefined` and deserialuzatuin failed on Rust side.
- Switch planetscale driver to array mode too
- For neon-http, pass `arrayMode` and `fullResult` options on all
  invocations, making us agnostic to the settings used in constructor.
…dapter that we support (#4265)

This PR changes the executor for driver adapters to instantiate a different driver adapter based on environment configuration.

From the chunk of documentation added to the connector kit README:

#### Running tests through driver adapters

The query engine is able to delegate query execution to javascript through [driver adapters](query-engine/driver-adapters/js/README.md).
This means that instead of drivers being implemented in Rust, it's a layer of adapters over NodeJs drivers the code that actually communicates with the databases. 

To run tests through a driver adapters, you should also configure the following environment variables:

* `NODE_TEST_EXECUTOR`: tells the query engine test kit to use an external process to run the queries, this is a node process running
a program that will read the queries to run from STDIN, and return responses to STDOUT. The connector kit follows a protocol over JSON RPC for this communication. 
* `DRIVER_ADAPTER`: tells the test executor to use a particular driver adapter. Set to `neon`, `planetscale` or any other supported adapter.
* `DRIVER_ADAPTER_URL_OVERRIDE`: it overrides the schema URL for the database to use one understood by the driver adapter (ex. neon, planetscale)
 

Example:

```shell
export NODE_TEST_EXECUTOR="$WORKSPACE_ROOT/query-engine/driver-adapters/js/connector-test-kit-executor/script/start_node.sh"
export DRIVER_ADAPTER=neon
export DRIVER_ADAPTER_URL_OVERRIDE ="postgres://USER:PASSWORD@DATABASExxxx"
````

Closes https://github.com/prisma/team-orm/issues/364
#4267)

* driver-adapters: Ensure error propohation works for `startTransaction`

`startTransaction` was not correctly wrapped when converting `Adapter`
to `ErrorCapturingAdapter`. As a result, `GenericError` message was
returned in case of JS error. This PR fixes the problem.

Since it is hard to test those kinds of errors with real drivers, new
test suite for the error propogation is introduced. It uses fake
postgres adapter that throws on every call.

* Add test for executeRaw
Geography default SRID is 4326 in PG, but 0 in CRDB. But in both cases, if non 0, the column SRID it will be always explicitly mentioned in the type information column.
…ne geometry tests for spatialite enabled version
@janpio janpio closed this Nov 30, 2023
@janpio
Copy link
Author

janpio commented Nov 30, 2023

clicked the wrong button.
wanted to do this actually: prisma#4507

Oreilles pushed a commit that referenced this pull request Sep 30, 2024
* ci(github): Build Linux engines (#1)

* add run-name

* fix: add target_path to Linux Status (x86_64) (prisma#3)

* chore: update actions and autoformat

* ci: do all the things `engineer` CLI does for releasing engines (prisma#4)

* remove /target from cache

* add release if github.event_name == 'workflow_dispatch'

* Comment out push/pr triggers

* Run on PR (tmp)

* Remove old pipelines, make commit optional

* Run linux jobs in docker containers

* Revert "Run linux jobs in docker containers"

This reverts commit aa6e6cc.

* Remove explicit repository

* Try to mount cache dirs, use rust-toolchain files

* No quotes

* Add osx arm toolchain

* Uncomment s3 upload

* Fix shellcheck

* Correct bucket

* Comment out R2

* Setup R2 uploads again

* Add workflow-dispatch for engines-wrapper

* Fix script

* Use github.sha everywhere

* Use prisma bot token

* Use repository dispatch

* Use short branch name

* Correct repo for dispatch

* head-ref?

* Skip engines build if no release is necessary

* Add all DBs tested on buildkite to GH Actions

* Split qe test job into multiple jobs because FML

* Adjust job/workflows names

* And again

* Run mysql as single threaded

* Ignore joins test on old mysql

* Bring back mariadb

* Organize pipelines better

* Add order by to fix postgres9

* Move DA tests into unified view

* Cleanup

* Address some of the review comments

* Pull command construction into separate script

[integration]

* Correctly check for [integration]

[integration]

* PR-safe way of getting commit message

[integration]

* n1

[integration]

* Correct multiline string

[integration]

* Checkout different ref

[integration]

* Try more things

[integration]

* Fix shellcheck

[integration]

* Check repository owner

[integration]

* I am sad

[integration]

* permissions?

* Revert to prisma bot token

* Revert back to membership check

[integration]

* Please

[integration]

* Uncomment triggers

---------

Co-authored-by: Jan Piotrowski <[email protected]>
Co-authored-by: Joël Galeran <[email protected]>
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.