Updated dependencies and fixed compactibilty issues with nest js, also fixing Spatial Indexing#159
Open
relativity-codes wants to merge 2 commits into
Open
Updated dependencies and fixed compactibilty issues with nest js, also fixing Spatial Indexing#159relativity-codes wants to merge 2 commits into
relativity-codes wants to merge 2 commits into
Conversation
…o fixing Spatial Indexing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is a comprehensive summary of all the fixes and improvements implemented in the
sequelize-cockroachdb:1. Symlink and Require Interception (
setTypeParsercrash)pgwere loaded, resulting in aCannot read properties of undefined (reading 'setTypeParser')crash.requireinterceptor hook at the top ofsource/index.jsto ensure the samesequelizeinstance is shared from the parent application context, and added a robust fallback to require'pg'directly ifpg.typesis missing.2. Dependency Upgrades
package.jsonto match the host application's versions (sequelize@^6.37.8andpg@^8.21.0), ensuring complete compatibility with the latest version 6 of Sequelize.3. Dynamic Database Engine Auto-Detection
SELECT version() AS versionto dynamically check if the host containsCockroachDB. Standard PostgreSQL connection properties (likeEXCEPTIONsupport and lock modes) are now dynamically restored when not connected to a CockroachDB engine.4. Enum Creation Patch (
pgEnum)DO ... EXCEPTION WHEN duplicate_objectsyntax.pgEnummethod to dynamically outputCREATE TYPE IF NOT EXISTSwhen connected to CockroachDB, while preserving the originalDO ... EXCEPTIONblock when connected to PostgreSQL.5. Spatial Index Mapping (
addIndexQuery)type: 'SPATIAL'on spatial (GEOMETRY/GEOGRAPHY) columns generated default B-tree index queries which are rejected by both CockroachDB and PostgreSQL.QueryGenerator.prototype.addIndexQueryto intercept index definitions usingtype: 'SPATIAL'(ortype: 'spatial') and automatically map them tousing: 'gist'(GIST index) while omitting the unsupportedtypeparameter.6. Test Suite Environment Configuration
npm testcompletely ignored database environment variables.tests/support.js,tests/sequelize_query_test.js,tests/dialects_query_test.js, andtests/belongs_to_many_test.js) to dynamically respect and map database environment variables (DB_NAME,DB_USER,DB_PASS,DB_HOST,DB_PORT,DB_SSL,CA_CERT_PATH), making it fully compatible with custom test databases (such as CockroachDB Cloud) while preserving default fallbacks for GitHub CI workflow.