feat: Decide base creation behaviour on app load based on permission
Change Summary
Provide summary of changes with issue number if any.
Change type
- [ ] feat: (new feature for the user, not a new feature for build script)
- [ ] fix: (bug fix for the user, not a fix to a build script)
- [ ] docs: (changes to the documentation)
- [ ] style: (formatting, missing semi colons, etc; no production code change)
- [ ] refactor: (refactoring production code, eg. renaming a variable)
- [ ] test: (adding missing tests, refactoring tests; no production code change)
- [ ] chore: (updating grunt tasks etc; no production code change)
Test/ Verification
Provide summary of changes.
Additional information / screenshots (optional)
Anything for maintainers to be made aware of
[!CAUTION]
Review failed
The pull request is closed.
:memo: Walkthrough
:memo: Walkthrough
Walkthrough
This pull request introduces multiple changes across various files, primarily aimed at enhancing database management and configuration, particularly for PostgreSQL. A new environment variable, NC_MINIMAL_DBS, is documented alongside updates to classes for improved schema handling and local database configurations. New migration files are added to facilitate schema modifications, and the overall code structure is refined for better clarity and functionality.
Changes
| Files | Change Summary |
|---|---|
packages/noco-docs/docs/.../020.environment-variables.md |
Added a section on "Minimal Database" detailing SQLite and PostgreSQL data organization and updated the NC_MINIMAL_DBS variable description. Reformatted the environment variables table for clarity. |
packages/nocodb/src/controllers/filters.controller.ts |
Modified the FiltersController to ensure proper syntax in the filterList method call. |
packages/nocodb/src/db/BaseModelSqlv2.ts |
Added an optional schema property to the BaseModelSqlv2 class and updated the getTnPath method to utilize this property for PostgreSQL. |
packages/nocodb/src/db/sql-client/lib/pg/PgClient.ts |
Introduced getEffectiveSchema method for flexible schema handling in SQL queries, affecting multiple operations. |
packages/nocodb/src/helpers/initBaseBehaviour.ts |
Introduced initBaseBehavior function to initialize database behavior for PostgreSQL, including permission checks for schema creation. |
packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts |
Added new migration module nc_064_pg_minimal_dbs to handle new schema changes. |
packages/nocodb/src/meta/migrations/v2/nc_064_pg_minimal_dbs.ts |
Created migration file containing up and down functions to modify the BASES table by adding and removing the is_local column. |
packages/nocodb/src/models/Model.ts |
Updated the get method to handle source objects and instantiate BaseModelSqlv2 with schema information based on the source type. |
packages/nocodb/src/models/Source.ts |
Added optional is_local property to the Source class and updated related methods to consider this property. |
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts |
Simplified duplicate entry check logic in AtImportProcessor. |
packages/nocodb/src/modules/jobs/jobs/at-import/helpers/fetchAT.ts |
Removed a blank line in the readView function without affecting functionality. |
packages/nocodb/src/providers/init-meta-service.provider.ts |
Added import and asynchronous call to initBaseBehavior in InitMetaServiceProvider to determine base behavior based on environment and permissions. |
packages/nocodb/src/services/bases.service.ts |
Modified logic in BasesService to handle database configurations based on NC_MINIMAL_DBS, including adjustments for PostgreSQL and SQLite. |
packages/nocodb/src/utils/common/NcConnectionMgrv2.ts |
Introduced getDataConfig static method to retrieve database configuration from Noco. |
Possibly related PRs
-
#9530: This PR is directly related as it includes the same changes to the documentation regarding the "Minimal Database" section and the
NC_MINIMAL_DBSenvironment variable, which are also part of the main PR's updates.
Suggested reviewers
- mertmit
- dstala
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
:placard: Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Uffizzi Preview deployment-56522 was deleted.