-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbb7c91
commit 5148be4
Showing
11 changed files
with
99 additions
and
99 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,87 @@ | ||
package generator | ||
|
||
func (v *queryStruct) OptionalSQL(sql string) *queryStruct { | ||
func (v *QueryStruct) OptionalSQL(sql string) *QueryStruct { | ||
v.fields = append(v.fields, NewField(sqlToFieldName(sql, true), "*bool", Tags().Keyword().SQL(sql), nil)) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) OrReplace() *queryStruct { | ||
func (v *QueryStruct) OrReplace() *QueryStruct { | ||
return v.OptionalSQL("OR REPLACE") | ||
} | ||
|
||
func (v *queryStruct) IfNotExists() *queryStruct { | ||
func (v *QueryStruct) IfNotExists() *QueryStruct { | ||
return v.OptionalSQL("IF NOT EXISTS") | ||
} | ||
|
||
func (v *queryStruct) IfExists() *queryStruct { | ||
func (v *QueryStruct) IfExists() *QueryStruct { | ||
return v.OptionalSQL("IF EXISTS") | ||
} | ||
|
||
func (v *queryStruct) Terse() *queryStruct { | ||
func (v *QueryStruct) Terse() *QueryStruct { | ||
return v.OptionalSQL("TERSE") | ||
} | ||
|
||
func (v *queryStruct) Text(name string, transformer *KeywordTransformer) *queryStruct { | ||
func (v *QueryStruct) Text(name string, transformer *KeywordTransformer) *QueryStruct { | ||
v.fields = append(v.fields, NewField(name, "string", Tags().Keyword(), transformer)) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) OptionalText(name string, transformer *KeywordTransformer) *queryStruct { | ||
func (v *QueryStruct) OptionalText(name string, transformer *KeywordTransformer) *QueryStruct { | ||
v.fields = append(v.fields, NewField(name, "*string", Tags().Keyword(), transformer)) | ||
return v | ||
} | ||
|
||
// SessionParameters *SessionParameters `ddl:"list,no_parentheses"` | ||
func (v *queryStruct) SessionParameters() *queryStruct { | ||
func (v *QueryStruct) SessionParameters() *QueryStruct { | ||
v.fields = append(v.fields, NewField("SessionParameters", "*SessionParameters", Tags().List().NoParentheses(), nil).withValidations(NewValidation(ValidateValue, "SessionParameters"))) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) OptionalSessionParameters() *queryStruct { | ||
func (v *QueryStruct) OptionalSessionParameters() *QueryStruct { | ||
v.fields = append(v.fields, NewField("SessionParameters", "*SessionParameters", Tags().List().NoParentheses(), nil).withValidations(NewValidation(ValidateValue, "SessionParameters"))) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) OptionalSessionParametersUnset() *queryStruct { | ||
func (v *QueryStruct) OptionalSessionParametersUnset() *QueryStruct { | ||
v.fields = append(v.fields, NewField("SessionParametersUnset", "*SessionParametersUnset", Tags().List().NoParentheses(), nil).withValidations(NewValidation(ValidateValue, "SessionParametersUnset"))) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) WithTags() *queryStruct { | ||
func (v *QueryStruct) WithTags() *QueryStruct { | ||
v.fields = append(v.fields, NewField("Tag", "[]TagAssociation", Tags().Keyword().Parentheses().SQL("TAG"), nil)) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) SetTags() *queryStruct { | ||
func (v *QueryStruct) SetTags() *QueryStruct { | ||
v.fields = append(v.fields, NewField("SetTags", "[]TagAssociation", Tags().Keyword().SQL("SET TAG"), nil)) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) UnsetTags() *queryStruct { | ||
func (v *QueryStruct) UnsetTags() *QueryStruct { | ||
v.fields = append(v.fields, NewField("UnsetTags", "[]ObjectIdentifier", Tags().Keyword().SQL("UNSET TAG"), nil)) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) OptionalLike() *queryStruct { | ||
func (v *QueryStruct) OptionalLike() *QueryStruct { | ||
v.fields = append(v.fields, NewField("Like", "*Like", Tags().Keyword().SQL("LIKE"), nil)) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) OptionalIn() *queryStruct { | ||
func (v *QueryStruct) OptionalIn() *QueryStruct { | ||
v.fields = append(v.fields, NewField("In", "*In", Tags().Keyword().SQL("IN"), nil)) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) OptionalStartsWith() *queryStruct { | ||
func (v *QueryStruct) OptionalStartsWith() *QueryStruct { | ||
v.fields = append(v.fields, NewField("StartsWith", "*string", Tags().Parameter().NoEquals().SingleQuotes().SQL("STARTS WITH"), nil)) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) OptionalLimit() *queryStruct { | ||
func (v *QueryStruct) OptionalLimit() *QueryStruct { | ||
v.fields = append(v.fields, NewField("Limit", "*LimitFrom", Tags().Keyword().SQL("LIMIT"), nil)) | ||
return v | ||
} | ||
|
||
func (v *queryStruct) OptionalCopyGrants() *queryStruct { | ||
func (v *QueryStruct) OptionalCopyGrants() *QueryStruct { | ||
return v.OptionalSQL("COPY GRANTS") | ||
} |
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
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
Oops, something went wrong.