Skip to content
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

Support Amazon Redshift #105

Merged
merged 4 commits into from
May 15, 2019
Merged

Support Amazon Redshift #105

merged 4 commits into from
May 15, 2019

Conversation

k1LoW
Copy link
Owner

@k1LoW k1LoW commented May 13, 2019

Fix #103

rs:// or redshift://

@k1LoW k1LoW self-assigned this May 13, 2019
@codecov
Copy link

codecov bot commented May 13, 2019

Codecov Report

Merging #105 into master will decrease coverage by 0.66%.
The diff coverage is 61.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #105      +/-   ##
==========================================
- Coverage   72.31%   71.64%   -0.67%     
==========================================
  Files          11       11              
  Lines        1983     2007      +24     
==========================================
+ Hits         1434     1438       +4     
- Misses        414      430      +16     
- Partials      135      139       +4
Impacted Files Coverage Δ
datasource/datasource.go 53.91% <40%> (-1.05%) ⬇️
drivers/postgres/postgres.go 77.64% <63.63%> (-3.92%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84c4cd2...5b6a042. Read the comment docs.

@k1LoW k1LoW changed the title Support Redshift Support Amazon Redshift May 13, 2019
@k1LoW k1LoW marked this pull request as ready for review May 13, 2019 15:54
@k1LoW
Copy link
Owner Author

k1LoW commented May 13, 2019

Hi @watarukura . Can you build this branch and execute tbls doc, if you do not mind ?

@watarukura
Copy link

DEBUG=1 tbls doc --force --er-format svg
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x41f76c6]

goroutine 1 [running]:
database/sql.(*Rows).close(0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/opt/go/libexec/src/database/sql/sql.go:2976 +0x66
database/sql.(*Rows).Close(0x0, 0x48b8611, 0x108)
        /usr/local/opt/go/libexec/src/database/sql/sql.go:2972 +0x33
github.com/k1LoW/tbls/drivers/postgres.(*Postgres).Analyze(0xc00040a100, 0xc0002dc320, 0x49804e0, 0xc00040cd80)
        /Users/watarukura/src/github.com/k1LoW/tbls/drivers/postgres/postgres.go:158 +0x2919
github.com/k1LoW/tbls/datasource.Analyze(0xc00030e180, 0x54, 0x0, 0x0, 0x0)
        /Users/watarukura/src/github.com/k1LoW/tbls/datasource/datasource.go:74 +0x683
github.com/k1LoW/tbls/cmd.glob..func2(0x4e48ba0, 0xc000155050, 0x0, 0x3)
        /Users/watarukura/src/github.com/k1LoW/tbls/cmd/doc.go:72 +0x111
github.com/spf13/cobra.(*Command).execute(0x4e48ba0, 0xc000155020, 0x3, 0x3, 0x4e48ba0, 0xc000155020)
        /Users/watarukura/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0x4e48480, 0x0, 0x0, 0x45e26d5)
        /Users/watarukura/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2ec
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/watarukura/pkg/mod/github.com/spf13/[email protected]/command.go:800
github.com/k1LoW/tbls/cmd.Execute()
        /Users/watarukura/src/github.com/k1LoW/tbls/cmd/root.go:59 +0x2e
main.main()
        /Users/watarukura/src/github.com/k1LoW/tbls/main.go:32 +0x20
make: *** [Makefile:3: doc] Error 2
SELECT pc.conname AS name,
    pg_get_constraintdef(pc.oid) AS def,
    contype AS type
FROM pg_constraint AS pc
         LEFT JOIN pg_stat_user_tables AS ps ON ps.relid = pc.conrelid
WHERE ps.relname = 'xxxxxxxx'
        AND ps.schemaname = 'xxxxxxxxx'
ORDER BY pc.conrelid, pc.conindid, pc.conname;
[42601][500310] [Amazon](500310) Invalid operation: syntax error at or near "pc" Position: 1; java.lang.RuntimeException: com.amazon.support.exceptions.ErrorException: [Amazon](500310) Invalid operation: syntax error at or near "pc" Position: 1;

pc.conindid がないようです。

@k1LoW
Copy link
Owner Author

k1LoW commented May 14, 2019

@watarukura Thank you for your work !!! I removed pc.conindid from query!

@watarukura
Copy link

cat connection.yml comments_*.yml relations_*.yml > .tbls.yml
DEBUG=1 tbls doc --force --er-format svg
dbdoc/schema.svg
...

tbls doc / lint / diff とも動作しました。
THANKS!

@k1LoW k1LoW merged commit 1fa450c into master May 15, 2019
@k1LoW k1LoW deleted the redshift branch May 15, 2019 05:04
@k1LoW
Copy link
Owner Author

k1LoW commented May 15, 2019

@watarukura Thank you !!!!!!! Released as v1.14.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS Redshift has no trigger
2 participants