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

refactor: use silverhand slonik #5513

Merged
merged 3 commits into from
Mar 19, 2024
Merged

refactor: use silverhand slonik #5513

merged 3 commits into from
Mar 19, 2024

Conversation

gao-sun
Copy link
Member

@gao-sun gao-sun commented Mar 16, 2024

Summary

use the fine-tuned version of slonik for better dependency management and code control. the upstream has embraced with type validation for queries, which is not desired in our case.

Testing

no business logic changed, ci should be good

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@github-actions github-actions bot added the enhancement Make it better label Mar 16, 2024
Copy link

github-actions bot commented Mar 16, 2024

COMPARE TO master

Total Size Diff 📉 -7.44 KB

Diff by File
Name Diff
packages/cli/package.json 📉 -61 Bytes
packages/cli/src/commands/database/alteration/index.test.ts 📉 -12 Bytes
packages/cli/src/commands/database/alteration/index.ts 📉 -12 Bytes
packages/cli/src/commands/database/seed/cloud.ts 📉 -24 Bytes
packages/cli/src/commands/database/seed/index.ts 📉 -12 Bytes
packages/cli/src/commands/database/seed/oidc-config.ts 📉 -12 Bytes
packages/cli/src/commands/database/seed/tables.ts 📉 -10 Bytes
packages/cli/src/commands/database/seed/tenant-organizations.ts 📉 -12 Bytes
packages/cli/src/commands/database/seed/tenant.ts 📉 -14 Bytes
packages/cli/src/database.ts 📉 -3 Bytes
packages/cli/src/include.d/slonik-interceptor-preset.d.ts 📉 -293 Bytes
packages/cli/src/queries/database.ts 📉 -24 Bytes
packages/cli/src/queries/logto-config.ts 📉 -24 Bytes
packages/cli/src/queries/system.test.ts 📉 -12 Bytes
packages/cli/src/queries/system.ts 📉 -24 Bytes
packages/cli/src/sql.ts 📉 -12 Bytes
packages/cli/src/test-utils.ts 📉 -24 Bytes
packages/core/package.json 📉 -61 Bytes
packages/core/src/database/delete-by-id.ts 📉 -12 Bytes
packages/core/src/database/find-all-entities.ts 📉 -12 Bytes
packages/core/src/database/find-entity-by-id.ts 📉 -24 Bytes
packages/core/src/database/insert-into.ts 📉 -24 Bytes
packages/core/src/database/row-count.ts 📉 -24 Bytes
packages/core/src/database/update-where.ts 📉 -24 Bytes
packages/core/src/database/utils.ts 📉 -12 Bytes
packages/core/src/env-set/check-alteration-state.ts 📉 -12 Bytes
packages/core/src/env-set/create-pool.ts 📉 -27 Bytes
packages/core/src/env-set/index.ts 📉 -12 Bytes
packages/core/src/errors/SlonikError/index.ts 📉 -12 Bytes
packages/core/src/errors/SlonikError/slonik-error.test.ts 📉 -12 Bytes
packages/core/src/include.d/slonik-interceptor-preset.d.ts 📉 -293 Bytes
packages/core/src/middleware/koa-auth/utils.ts 📉 -12 Bytes
packages/core/src/middleware/koa-slonik-error-handler.test.ts 📉 -19 Bytes
packages/core/src/middleware/koa-slonik-error-handler.ts 📉 -12 Bytes
packages/core/src/queries/application-sign-in-experience.ts 📉 -12 Bytes
packages/core/src/queries/application-user-consent-organizations.ts 📉 -12 Bytes
packages/core/src/queries/application-user-consent-scopes.ts 📉 -12 Bytes
packages/core/src/queries/application.test.ts 📉 -12 Bytes
packages/core/src/queries/application.ts 📉 -24 Bytes
packages/core/src/queries/applications-roles.ts 📉 -24 Bytes
packages/core/src/queries/connector.test.ts 📉 -12 Bytes
packages/core/src/queries/connector.ts 📉 -24 Bytes
packages/core/src/queries/custom-phrase.ts 📉 -24 Bytes
packages/core/src/queries/daily-active-user.ts 📉 -12 Bytes
packages/core/src/queries/daily-token-usage.ts 📉 -24 Bytes
packages/core/src/queries/domains.ts 📉 -24 Bytes
packages/core/src/queries/hooks.ts 📉 -24 Bytes
packages/core/src/queries/log.ts 📉 -24 Bytes
packages/core/src/queries/logto-config.test.ts 📉 -12 Bytes
packages/core/src/queries/logto-config.ts 📉 -24 Bytes
packages/core/src/queries/oidc-model-instance.test.ts 📉 -12 Bytes
packages/core/src/queries/oidc-model-instance.ts 📉 -24 Bytes
packages/core/src/queries/organization/index.ts 📉 -12 Bytes
packages/core/src/queries/organization/relations.ts 📉 -12 Bytes
packages/core/src/queries/passcode.test.ts 📉 -12 Bytes
packages/core/src/queries/passcode.ts 📉 -24 Bytes
packages/core/src/queries/resource.test.ts 📉 -12 Bytes
packages/core/src/queries/resource.ts 📉 -24 Bytes
packages/core/src/queries/roles-scopes.ts 📉 -24 Bytes
packages/core/src/queries/roles.test.ts 📉 -12 Bytes
packages/core/src/queries/roles.ts 📉 -24 Bytes
packages/core/src/queries/scope.ts 📉 -24 Bytes
packages/core/src/queries/sign-in-experience.test.ts 📉 -12 Bytes
packages/core/src/queries/sign-in-experience.ts 📉 -12 Bytes
packages/core/src/queries/sso-connectors.ts 📉 -12 Bytes
packages/core/src/queries/system.ts 📉 -24 Bytes
packages/core/src/queries/tenant.ts 📉 -12 Bytes
packages/core/src/queries/user-sso-identities.ts 📉 -12 Bytes
packages/core/src/queries/user.test.ts 📉 -12 Bytes
packages/core/src/queries/user.ts 📉 -24 Bytes
packages/core/src/queries/users-roles.ts 📉 -24 Bytes
packages/core/src/queries/verification-status.ts 📉 -24 Bytes
packages/core/src/routes/organization/utils.ts 📉 -12 Bytes
packages/core/src/sentinel/basic-sentinel.ts 📉 -12 Bytes
packages/core/src/tenants/Queries.ts 📉 -12 Bytes
packages/core/src/tenants/SystemContex.test.ts 📉 -12 Bytes
packages/core/src/tenants/SystemContext.ts 📉 -12 Bytes
packages/core/src/tenants/utils.ts 📉 -24 Bytes
packages/core/src/test-utils/tenant.ts 📉 -12 Bytes
packages/core/src/utils/RelationQueries.ts 📉 -89 Bytes
packages/core/src/utils/SchemaQueries.ts 📉 -12 Bytes
packages/core/src/utils/search.test.ts 📉 -24 Bytes
packages/core/src/utils/search.ts 📉 -12 Bytes
packages/core/src/utils/sql.test.ts 📉 -24 Bytes
packages/core/src/utils/sql.ts 📉 -24 Bytes
packages/core/src/utils/tenant.ts 📉 -12 Bytes
packages/core/src/utils/test-utils.ts 📉 -36 Bytes
packages/schemas/alterations/1.0.0-1677208902-update-admin-console-config.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0-1677765137-seed-for-admin-tenant.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0-1677907982-allow-admin-create-multiple-tenants.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0-1678157950-privacy-policy-url.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0-1678199795-add-verification-status-table.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0-1678259693-remove-branding-style-config.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0-1678269972-use-restrictive-policies.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0-1678284778-restrict-internal-roles.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0-1678425761-m2m-app-for-tenants.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0-1678450233-support-custom-content.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0-1678716747-service-logs.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0-1678928481-remove-deprecated-logto-config-item.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0-1678953179-update-get-started-task-config.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0-1679209413-drop-connector-database-storage.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.10-1-logto-config.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.10-1663923211-machine-to-machine-app.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.10-1664265197-custom-phrases.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.11-1664347703-rename-language-key-to-tag.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.11-1664356000-add-created-at-column-to-users.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.11-1664462389-correct-user-created-at-column-by-user-logs.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.14-1665300135-sign-in-sign-up.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.14-1667283640-remove-forgot-password.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.14-1667292082-remove-sign-in-method.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.14-1667374974-user-suspend.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.14-1667900481-add-passcode-type-continue.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.18-1668666590-support-multiple-connector-instances.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.18-1668666600-remove-connector-enabled.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.18-1669091623-roles-and-scopes.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.18-1669702299-sign-up.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0_beta.18-1671039448-add-user-name-index.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.18-1671080370-terms-of-use.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0_beta.18-1671336831-refactor-log-types.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.18-1671509870-hooks.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_beta.18-1672119200-align-passcode-type-with-message-type.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1672815959-user-roles.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1672820345-scope-resource-id.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1672901841-roles-and-scopes-not-null.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1673001922-support-generic-passcode.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1673165463-scope-name-index.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1673349501-sms-sign-in-identifier-to-phone.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1673465463-ac-scope-name.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1673853579-ac-default-scope.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1673863835-ac-scope-role.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1673882867-fix-alteration-issues.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1673940577-scope-description-not-null.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1673941897-application-roles.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1674032095.1-dedup-resources-constraint.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1674032095.2-oidc-model-pkey.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1674032095.3-tenant-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1674032095.4-add-id-column.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1674032095.5-multi-tenancy.ts 📉 -10 Bytes
packages/schemas/alterations/1.0.0_rc.0-1674032095.6-add-tenant-id-trigger.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1674987042-drop-settings-and-create-systems.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.0-1675316731-update-seed-data.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.1-1675788753-multi-tenancy-rls.ts 📉 -14 Bytes
packages/schemas/alterations/1.0.0_rc.1-1676115897-add-admin-tenant.ts 📉 -14 Bytes
packages/schemas/alterations/1.0.0_rc.1-1676185899-fix-logs-index.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.1-1676190092-migrate-admin-data.ts 📉 -24 Bytes
packages/schemas/alterations/1.0.0_rc.1-1676823841-update-sie-primary-key.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.1-1676874936-support-custom-css.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.1-1676886855-connector-database-read-write.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.1-1676906977-remove-demo-app.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.1-1676956206-move-console-sie-to-database.ts 📉 -12 Bytes
packages/schemas/alterations/1.0.0_rc.1-1677059985-move-console-application-to-database.ts 📉 -12 Bytes
packages/schemas/alterations/1.10.1-1695647183-update-private-key-type.ts 📉 -24 Bytes
packages/schemas/alterations/1.10.1-1696657546-organization-tables.ts 📉 -12 Bytes
packages/schemas/alterations/1.10.1-1697683802-add-sso-connectors-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.10.1-1698646271-add-organization-created-flag.ts 📉 -24 Bytes
packages/schemas/alterations/1.10.1-1698820410-add-user-sso-identities-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.10.1-1698910485-user-logto-data.ts 📉 -12 Bytes
packages/schemas/alterations/1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.12.0-1700031616-update-org-role-foreign-keys.ts 📉 -12 Bytes
packages/schemas/alterations/1.12.0-1701054133-add-unique-constraint-to-the-sso-connector-name.ts 📉 -12 Bytes
packages/schemas/alterations/1.12.0-1701245520-add-single-sign-on-enabled-flag-to-sie.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1702274830-add-new-third-party-column-to-applications-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1702372401-add-application-permissions-tables.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1702544178-sync-tenant-orgs.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1702871078-protected-application-type.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1702877515-protected-app-configs.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1702978120-application-sign-in-experience-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1703229996-daily-token-usage.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1703230000-update-tenant-roles.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1704692973-remove-legacy-resources.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1704934999-add-magic-links-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1704935001-add-organization-invitation-tables.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1705288654-add-application-user-consent-organizations-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1705991158-update-invitation-indices.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1706449174-update-organization-invitation-column.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1706510290-protected-app-host-index.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1706512952-restore-get-started-page.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1706528755-remove-magic-links.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.0-1706585206-protected-app-custom-domain-unique.ts 📉 -12 Bytes
packages/schemas/alterations/1.13.1-1707360939-grant-is-suspended-read-permission.ts 📉 -12 Bytes
packages/schemas/alterations/1.14.0-1708916601-remove-management-api-scopes-assigned-to-user-role.ts 📉 -12 Bytes
packages/schemas/alterations/1.14.0-1709190131-enhance-dau-data-accuracy.ts 📉 -12 Bytes
packages/schemas/alterations/1.2.0-1681267285-fix-get-started-passwordless-status.ts 📉 -12 Bytes
packages/schemas/alterations/1.3.0-1683292832-update-hooks.ts 📉 -12 Bytes
packages/schemas/alterations/1.5.0-1684382842-add-name-tag-created-at-for-tenants-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.5.0-1684739802-create-hook-id-index-for-logs.ts 📉 -12 Bytes
packages/schemas/alterations/1.5.0-1684822341-init-domains.ts 📉 -24 Bytes
packages/schemas/alterations/1.5.0-1684837981-add-manage-tenant-self-scope-to-user-role.ts 📉 -12 Bytes
packages/schemas/alterations/1.5.0-1685285719-support-default-resource.ts 📉 -12 Bytes
packages/schemas/alterations/1.6.0-1685691718-domain-unique.ts 📉 -12 Bytes
packages/schemas/alterations/1.7.0-1688375200-sync-cloud-m2m-to-logto-config.ts 📉 -12 Bytes
packages/schemas/alterations/1.7.0-1688613459-remove-m2m-credentials-from-existing-logto-email-connector-config.ts 📉 -12 Bytes
packages/schemas/alterations/1.7.0-1688627407-daily-active-users.ts 📉 -12 Bytes
packages/schemas/alterations/1.8.0-1692088012-add-is-suspend-column-to-tenants-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.8.0-1692194751-add-affiliate-scopes.ts 📉 -12 Bytes
packages/schemas/alterations/1.9.0-1693554904-add-possword-policy.ts 📉 -12 Bytes
packages/schemas/alterations/1.9.0-1694399696-add-type-col-to-roles-table.ts 📉 -12 Bytes
packages/schemas/alterations/1.9.0-1694418765-specify-check-role-type-function-to-be-public-schema.ts 📉 -12 Bytes
packages/schemas/alterations/1.9.0-1694484927-remove-deprecated-challenge-flag.ts 📉 -24 Bytes
packages/schemas/alterations/1.9.0-1694487524-sie-mfa.ts 📉 -12 Bytes
packages/schemas/alterations/1.9.0-1694509714-keep-existing-password-policy.ts 📉 -12 Bytes
packages/schemas/alterations/1.9.0-1694746763-user-verifications.ts 📉 -12 Bytes
packages/schemas/alterations/1.9.2-1694854226-init-sentinel.ts 📉 -12 Bytes
packages/schemas/alterations/1.9.2-1695198741-remove-m2m-app-admin-access-switch.ts 📉 -12 Bytes
packages/schemas/alterations/next-1709521416-user-password-encrypt-method.ts 📉 -12 Bytes
packages/schemas/alterations/next-1709528944-regenerate-dau-data.ts 📉 -12 Bytes
packages/schemas/alterations/next-1710223946-add-fetch-custom-jwt-cloud-scope.ts 📉 -12 Bytes
packages/schemas/alterations/utils/1704934999-tables.ts 📉 -12 Bytes
packages/schemas/package.json 📉 -17 Bytes
packages/schemas/src/types/alteration.ts 📉 -12 Bytes
pnpm-lock.yaml 📉 -9.63 KB

@gao-sun gao-sun force-pushed the gao-use-svhd-slonik branch 2 times, most recently from 67b0aaa to 35a9766 Compare March 17, 2024 15:20
@gao-sun gao-sun marked this pull request as ready for review March 17, 2024 15:20
Base automatically changed from gao-shared-default-universal to master March 18, 2024 01:58
@gao-sun gao-sun merged commit b40a347 into master Mar 19, 2024
21 checks passed
@gao-sun gao-sun deleted the gao-use-svhd-slonik branch March 19, 2024 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Make it better size/l
Development

Successfully merging this pull request may close these issues.

3 participants