-
Notifications
You must be signed in to change notification settings - Fork 427
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 procedures to sdkv2 #2202
Conversation
if r.Arguments != nil { | ||
s := make([]ProcedureArgument, len(r.Arguments)) | ||
for i, v := range r.Arguments { | ||
s[i] = ProcedureArgument{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureArgumentRequest) to ProcedureArgument instead of using struct literal (gosimple)
pkg/sdk/procedures_impl_gen.go
Outdated
if r.Returns.Table.Columns != nil { | ||
s := make([]ProcedureColumn, len(r.Returns.Table.Columns)) | ||
for i, v := range r.Returns.Table.Columns { | ||
s[i] = ProcedureColumn{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureColumnRequest) to ProcedureColumn instead of using struct literal (gosimple)
if r.Packages != nil { | ||
s := make([]ProcedurePackage, len(r.Packages)) | ||
for i, v := range r.Packages { | ||
s[i] = ProcedurePackage{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedurePackageRequest) to ProcedurePackage instead of using struct literal (gosimple)
if r.Imports != nil { | ||
s := make([]ProcedureImport, len(r.Imports)) | ||
for i, v := range r.Imports { | ||
s[i] = ProcedureImport{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureImportRequest) to ProcedureImport instead of using struct literal (gosimple)
pkg/sdk/procedures_impl_gen.go
Outdated
if r.Secrets != nil { | ||
s := make([]ProcedureSecret, len(r.Secrets)) | ||
for i, v := range r.Secrets { | ||
s[i] = ProcedureSecret{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureSecretRequest) to ProcedureSecret instead of using struct literal (gosimple)
if r.Packages != nil { | ||
s := make([]ProcedurePackage, len(r.Packages)) | ||
for i, v := range r.Packages { | ||
s[i] = ProcedurePackage{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedurePackageRequest) to ProcedurePackage instead of using struct literal (gosimple)
if r.Imports != nil { | ||
s := make([]ProcedureImport, len(r.Imports)) | ||
for i, v := range r.Imports { | ||
s[i] = ProcedureImport{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureImportRequest) to ProcedureImport instead of using struct literal (gosimple)
pkg/sdk/procedures_impl_gen.go
Outdated
if r.ArgumentTypes != nil { | ||
s := make([]ProcedureArgumentType, len(r.ArgumentTypes)) | ||
for i, v := range r.ArgumentTypes { | ||
s[i] = ProcedureArgumentType{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal (gosimple)
pkg/sdk/procedures_impl_gen.go
Outdated
if r.ArgumentTypes != nil { | ||
s := make([]ProcedureArgumentType, len(r.ArgumentTypes)) | ||
for i, v := range r.ArgumentTypes { | ||
s[i] = ProcedureArgumentType{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal (gosimple)
pkg/sdk/procedures_impl_gen.go
Outdated
if r.ArgumentTypes != nil { | ||
s := make([]ProcedureArgumentType, len(r.ArgumentTypes)) | ||
for i, v := range r.ArgumentTypes { | ||
s[i] = ProcedureArgumentType{ |
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.
🚫 [golangci] reported by reviewdog 🐶
S1016: should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal (gosimple)
Integration tests failure for 5dba820e79e671d17f8a671fecf14e2d23740b96 |
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/procedures_impl_gen.go|237 col 13| should convert v (type ProcedureColumnRequest) to ProcedureColumn instead of using struct literal
pkg/sdk/procedures_impl_gen.go|249 col 11| should convert v (type ProcedurePackageRequest) to ProcedurePackage instead of using struct literal
pkg/sdk/procedures_impl_gen.go|258 col 11| should convert v (type ProcedureImportRequest) to ProcedureImport instead of using struct literal
pkg/sdk/procedures_impl_gen.go|267 col 11| should convert v (type ProcedureSecretRequest) to ProcedureSecret instead of using struct literal
pkg/sdk/procedures_impl_gen.go|299 col 11| should convert v (type ProcedureArgumentRequest) to ProcedureArgument instead of using struct literal
pkg/sdk/procedures_impl_gen.go|320 col 13| should convert v (type ProcedureColumnRequest) to ProcedureColumn instead of using struct literal
pkg/sdk/procedures_impl_gen.go|332 col 11| should convert v (type ProcedurePackageRequest) to ProcedurePackage instead of using struct literal
pkg/sdk/procedures_impl_gen.go|341 col 11| should convert v (type ProcedureImportRequest) to ProcedureImport instead of using struct literal
pkg/sdk/procedures_impl_gen.go|367 col 11| should convert v (type ProcedureArgumentRequest) to ProcedureArgument instead of using struct literal
pkg/sdk/procedures_impl_gen.go|388 col 13| should convert v (type ProcedureColumnRequest) to ProcedureColumn instead of using struct literal
pkg/sdk/procedures_impl_gen.go|414 col 11| should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal
pkg/sdk/procedures_impl_gen.go|444 col 11| should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal
pkg/sdk/procedures_impl_gen.go|461 col 23| func procedureRow.convert is unused
pkg/sdk/procedures_impl_gen.go|480 col 11| should convert v (type ProcedureArgumentTypeRequest) to ProcedureArgumentType instead of using struct literal
pkg/sdk/procedures_impl_gen.go|489 col 29| func procedureDetailRow.convert is unused
pkg/sdk/procedures_gen.go
Outdated
|
||
// CreateProcedureForJavaProcedureOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-procedure. | ||
type CreateProcedureForJavaProcedureOptions 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/procedures_gen.go
Outdated
create bool `ddl:"static" sql:"CREATE"` | ||
OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"` | ||
Secure *bool `ddl:"keyword" sql:"SECURE"` | ||
procedure bool `ddl:"static" sql:"PROCEDURE"` |
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/procedures_gen.go
Outdated
Arguments []ProcedureArgument `ddl:"parameter,parentheses,no_equals"` | ||
CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"` | ||
Returns *ProcedureReturns `ddl:"keyword" sql:"RETURNS"` | ||
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/procedures_gen.go
Outdated
|
||
// CreateProcedureForJavaScriptProcedureOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-procedure. | ||
type CreateProcedureForJavaScriptProcedureOptions 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/procedures_gen.go
Outdated
create bool `ddl:"static" sql:"CREATE"` | ||
OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"` | ||
Secure *bool `ddl:"keyword" sql:"SECURE"` | ||
procedure bool `ddl:"static" sql:"PROCEDURE"` |
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.Packages != nil { | ||
s := make([]ProcedurePackage, len(r.Packages)) | ||
for i, v := range r.Packages { | ||
s[i] = ProcedurePackage{ |
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.Imports != nil { | ||
s := make([]ProcedureImport, len(r.Imports)) | ||
for i, v := range r.Imports { | ||
s[i] = ProcedureImport{ |
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/procedures_impl_gen.go
Outdated
if r.Secrets != nil { | ||
s := make([]ProcedureSecret, len(r.Secrets)) | ||
for i, v := range r.Secrets { | ||
s[i] = ProcedureSecret{ |
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([]ProcedureArgument, len(r.Arguments)) | ||
for i, v := range r.Arguments { | ||
s[i] = ProcedureArgument{ |
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([]ProcedureArgument, len(r.Arguments)) | ||
for i, v := range r.Arguments { | ||
s[i] = ProcedureArgument{ |
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.
id := sdk.NewSchemaObjectIdentifier(databaseTest.Name, schemaTest.Name, name) | ||
|
||
as := ` | ||
import joblib |
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.
We should probably run those with go-snowflake exec and implement proper call function in the following pr ?
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.
i dont think this is necessary
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.
But we are going for all of the functionalities in the SDK, right ? Maybe we should create at least a follow-up task on creating a call / call with functions to invoke those procedures with SDK
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.
added todo comment for this test
/*
todo: add custom operation for:
- call and call-with for scripting https://docs.snowflake.com/en/sql-reference/sql/call
*/
Integration tests failure for a0f9ccdf90b127d39958f4e8d7e47c67ece91bea |
Integration tests failure for ecf18a02c7c3fabfa58e3b3630521c5e289aed12 |
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.
Small ones, and also the build checks are failing, please look at them
Integration tests failure for 5e9c2c263d388a964a0337c8556aece4f1bca7cf |
Integration tests failure for 5e2469f74549885befccbbca97e23f4e5ee83648 |
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.
Here also #2202 (comment) other than the comment it's 👍 for me
🥇
Integration tests failure for 948f478fc2b9d4603e7259f223fd82114eae88d8 |
Integration tests failure for 99b8e6362e13592004e7c3c1c3040c7c163500ab |
Integration tests failure for e791214bcf13c282fd7d710d46dbe2de1c81e034 |
Adds procedures to sdk.
https://docs.snowflake.com/en/sql-reference/sql/create-procedure