-
Notifications
You must be signed in to change notification settings - Fork 2
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
V6 #20
Merged
Merged
V6 #20
Conversation
This file contains 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
The code changes introduce a new struct called `TenantPKModel` which is identical to `TenantModel` but with `SchemaName` as a primary key field. This change allows for more efficient querying and management of tenant data.
This commit refactors the `GetDSN` function in the `testutil` package to accept an optional `WithDBName` option. This option allows the caller to set the database name for the connection. The function now checks if the `dbname` parameter already exists in the DSN string and replaces it if found. If the `dbname` parameter does not exist, it appends it to the DSN string. This change provides more flexibility in configuring the test database connection.
This commit refactors the `tableNameFromReflectValue` function in the `scopes` package to improve table name caching performance. It introduces a cache to store previously calculated table names, reducing the need for reflection and improving overall performance. This change enhances the efficiency of table name retrieval, resulting in faster execution of database queries.
…vers/postgres/schema" BREAKING CHANGE: This commit moves the "schema/postgres" package to "drivers/postgres/schema". This change aligns the package location and name with its purpose of providing utilities for managing PostgreSQL schemas in a multi-tenant application. The relocation and renaming improve code organization and clarity. This is a breaking change and requires updates in the code where this package is imported.
BREAKING CHANGE: All file references to github.com/bartventer/gorm-multitenancy have been updated from v5 to v6. This major version upgrade may introduce breaking changes that require updates in the code where this package is imported.
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
bartventer
commented
May 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and approved
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.
Restructure postgres driver file structure, optimize scoping queries and enhance documentation.