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

V6 #20

Merged
merged 25 commits into from
May 12, 2024
Merged

V6 #20

merged 25 commits into from
May 12, 2024

Conversation

bartventer
Copy link
Owner

Restructure postgres driver file structure, optimize scoping queries and enhance documentation.

bartventer and others added 25 commits May 11, 2024 19:00
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.
Copy link

codesandbox bot commented May 12, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Owner Author

@bartventer bartventer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and approved

@bartventer bartventer merged commit 836a4bf into master May 12, 2024
8 checks passed
@bartventer bartventer deleted the v6 branch May 12, 2024 17:35
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.

None yet

1 participant