-
Notifications
You must be signed in to change notification settings - Fork 426
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
feat: add functions to sdk #2205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
staticcheck
pkg/sdk/functions_impl_gen.go|257 col 13| should convert v (type FunctionColumnRequest) to FunctionColumn instead of using struct literal
pkg/sdk/functions_impl_gen.go|278 col 11| should convert v (type FunctionImportsRequest) to FunctionImports instead of using struct literal
pkg/sdk/functions_impl_gen.go|287 col 11| should convert v (type FunctionPackagesRequest) to FunctionPackages instead of using struct literal
pkg/sdk/functions_impl_gen.go|296 col 11| should convert v (type FunctionSecretRequest) to FunctionSecret instead of using struct literal
pkg/sdk/functions_impl_gen.go|328 col 11| should convert v (type FunctionArgumentRequest) to FunctionArgument instead of using struct literal
pkg/sdk/functions_impl_gen.go|344 col 13| should convert v (type FunctionColumnRequest) to FunctionColumn instead of using struct literal
pkg/sdk/functions_impl_gen.go|365 col 11| should convert v (type FunctionImportsRequest) to FunctionImports instead of using struct literal
pkg/sdk/functions_impl_gen.go|374 col 11| should convert v (type FunctionPackagesRequest) to FunctionPackages instead of using struct literal
pkg/sdk/functions_impl_gen.go|402 col 11| should convert v (type FunctionArgumentRequest) to FunctionArgument instead of using struct literal
pkg/sdk/functions_impl_gen.go|418 col 13| should convert v (type FunctionColumnRequest) to FunctionColumn instead of using struct literal
pkg/sdk/functions_impl_gen.go|451 col 11| should convert v (type FunctionArgumentTypeRequest) to FunctionArgumentType instead of using struct literal
pkg/sdk/functions_impl_gen.go|484 col 11| should convert v (type FunctionArgumentTypeRequest) to FunctionArgumentType instead of using struct literal
pkg/sdk/functions_impl_gen.go|501 col 22| func functionRow.convert is unused
pkg/sdk/functions_impl_gen.go|524 col 11| should convert v (type FunctionArgumentTypeRequest) to FunctionArgumentType instead of using struct literal
pkg/sdk/functions_impl_gen.go|533 col 28| func functionDetailRow.convert is unused
pkg/sdk/functions_gen.go
Outdated
|
||
// CreateFunctionForJavaFunctionOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-function. | ||
type CreateFunctionForJavaFunctionOptions struct { | ||
create bool `ddl:"static" sql:"CREATE"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_gen.go
Outdated
OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"` | ||
Temporary *bool `ddl:"keyword" sql:"TEMPORARY"` | ||
Secure *bool `ddl:"keyword" sql:"SECURE"` | ||
function bool `ddl:"static" sql:"FUNCTION"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_gen.go
Outdated
CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"` | ||
Returns *FunctionReturns `ddl:"keyword" sql:"RETURNS"` | ||
ReturnNullValues *FunctionReturnNullValues `ddl:"keyword"` | ||
languageJava bool `ddl:"static" sql:"LANGUAGE JAVA"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_gen.go
Outdated
|
||
// CreateFunctionForJavascriptFunctionOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-function. | ||
type CreateFunctionForJavascriptFunctionOptions struct { | ||
create bool `ddl:"static" sql:"CREATE"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_gen.go
Outdated
OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"` | ||
Temporary *bool `ddl:"keyword" sql:"TEMPORARY"` | ||
Secure *bool `ddl:"keyword" sql:"SECURE"` | ||
function bool `ddl:"static" sql:"FUNCTION"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.Packages != nil { | ||
s := make([]FunctionPackages, len(r.Packages)) | ||
for i, v := range r.Packages { | ||
s[i] = FunctionPackages{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.Secrets != nil { | ||
s := make([]FunctionSecret, len(r.Secrets)) | ||
for i, v := range r.Secrets { | ||
s[i] = FunctionSecret{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if r.Arguments != nil { | ||
s := make([]FunctionArgument, len(r.Arguments)) | ||
for i, v := range r.Arguments { | ||
s[i] = FunctionArgument{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.Returns.Table.Columns != nil { | ||
s := make([]FunctionColumn, len(r.Returns.Table.Columns)) | ||
for i, v := range r.Returns.Table.Columns { | ||
s[i] = FunctionColumn{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if r.Arguments != nil { | ||
s := make([]FunctionArgument, len(r.Arguments)) | ||
for i, v := range r.Arguments { | ||
s[i] = FunctionArgument{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.Returns.Table.Columns != nil { | ||
s := make([]FunctionColumn, len(r.Returns.Table.Columns)) | ||
for i, v := range r.Returns.Table.Columns { | ||
s[i] = FunctionColumn{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.Imports != nil { | ||
s := make([]FunctionImports, len(r.Imports)) | ||
for i, v := range r.Imports { | ||
s[i] = FunctionImports{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.Packages != nil { | ||
s := make([]FunctionPackages, len(r.Packages)) | ||
for i, v := range r.Packages { | ||
s[i] = FunctionPackages{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.Secrets != nil { | ||
s := make([]FunctionSecret, len(r.Secrets)) | ||
for i, v := range r.Secrets { | ||
s[i] = FunctionSecret{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if r.Arguments != nil { | ||
s := make([]FunctionArgument, len(r.Arguments)) | ||
for i, v := range r.Arguments { | ||
s[i] = FunctionArgument{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.ArgumentTypes != nil { | ||
s := make([]FunctionArgumentType, len(r.ArgumentTypes)) | ||
for i, v := range r.ArgumentTypes { | ||
s[i] = FunctionArgumentType{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.ArgumentTypes != nil { | ||
s := make([]FunctionArgumentType, len(r.ArgumentTypes)) | ||
for i, v := range r.ArgumentTypes { | ||
s[i] = FunctionArgumentType{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return opts | ||
} | ||
|
||
func (r functionRow) convert() *Function { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/sdk/functions_impl_gen.go
Outdated
if r.ArgumentTypes != nil { | ||
s := make([]FunctionArgumentType, len(r.ArgumentTypes)) | ||
for i, v := range r.ArgumentTypes { | ||
s[i] = FunctionArgumentType{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return opts | ||
} | ||
|
||
func (r functionDetailRow) convert() *FunctionDetail { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integration tests failure for fc6b2e02e7b2434d3dc7754c4965551484516dc8 |
Integration tests failure for 17ef49f54533d3cbd08bf2147ba5f4c8eecb7a07 |
Integration tests failure for c7fbc465faf91a2e999a9b0f1bee135b99637c16 |
Integration tests failure for a121f435d85c3de5651fca7301e5bfc9d4fd7b40 |
Integration tests failure for 6f9c4a5d97570b431d1eb78f34cf83c5deb062d0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, just leave a comment I've asked for in #2205 (comment) and other than that it's 👍
🥇
Integration tests failure for 364ce2e4eb27758ef50923f1b5386925d5ccc65c |
Integration tests success for 7cb75f8c3d2be22d22b7c4d32446ff020c96add4 |
Integration tests failure for d532974bf351c3613ca5034154f19187c4e24cc3 |
Integration tests failure for 11d8d82d33d997d8a9a2a4c15ef94d2765bbf803 |
Integration tests failure for 2e6c0e9f20e7faff3ade26d6c46012df7f42b0bf |
Integration tests failure for a5436b0cb951f8b7c65ce1ac3ad65a458351b1f9 |
Integration tests failure for 3af6f874fdf0fedd1ff2816b3c4fc3d2f68f2836 |
Integration tests failure for a7fd45b0864c1b3231d92b2150485976d8f83110 |
Integration tests failure for 53acfd5c87099c8e334ff80d0705f385eaf037d0 |
🤖 I have created a release *beep* *boop* --- ## [0.82.0](v0.81.0...v0.82.0) (2023-12-21) ### 🎉 **What's new:** * add functions to sdk ([#2205](#2205)) ([e542b67](e542b67)) ### 🔧 **Misc** * Add short scripts used to fetch all currently opened issues ([#2288](#2288)) ([0b5ce4e](0b5ce4e)) * Bump dependencies and fix linter complaints ([#2300](#2300)) ([124e862](124e862)) ### 🐛 **Bug fixes:** * Fix resource monitor alter validations in the SDK ([#2298](#2298)) ([74d19d0](74d19d0)) * Fix email notification integration ([#2292](#2292)) ([70edd3e](70edd3e)) * Fix for #2283 ([#2284](#2284)) ([bbad5c6](bbad5c6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
add functions to SDK v2
https://docs.snowflake.com/en/sql-reference/sql/create-function