Support custom namespaces for dg_ctl create model(#1591)#2539
Open
two-headBoy wants to merge 1 commit into
Open
Support custom namespaces for dg_ctl create model(#1591)#2539two-headBoy wants to merge 1 commit into
two-headBoy wants to merge 1 commit into
Conversation
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.
Description
This PR resolves feature request #1591, decoupling generated model namespace from raw database name and providing two ways to customize namespace: command line argument --namespace and namespace field in model.json.
Changes
1. Command Entry & Header Definition
Update command help text to document
--namespaceoptionAdd
namespaceName_andnamespaceOverridden_member variables2. Core Logic File
--namespaceCLI argumentmodel.jsonas fallback when no CLI overridenamespaceName_into template render data for PG/MySQL/SQLite three database branches3. Template Files (Dynamic Namespace Generation)
Dynamically generate namespace bracket blocks and closing comment
Rewrite
using namespacesplicing logic to use custom namespaceAdapt
usingstatement templateAdapt
usingstatement template4. Test Script
Add full SQLite test cases covering:
Closes #1591