Skip to content

Conversation

@paulorsbrito
Copy link
Contributor

@paulorsbrito paulorsbrito commented Jan 17, 2023

Check List

  • Tests has been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Description of Changes Made (if issue reference is not provided)

Add env vars config for Athena session token and use CUBEJS_DB_NAME for Athena default database.

@paulorsbrito paulorsbrito requested review from a team as code owners January 17, 2023 14:56
@github-actions github-actions bot added the pr:community Contribution from Cube.js community members. label Jan 17, 2023
@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.78%. Comparing base (235ec70) to head (b3dccf6).
Report is 2854 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6018      +/-   ##
==========================================
+ Coverage   41.33%   41.78%   +0.45%     
==========================================
  Files         151      153       +2     
  Lines       20014    20163     +149     
  Branches     5206     5259      +53     
==========================================
+ Hits         8272     8425     +153     
- Misses      10904    11428     +524     
+ Partials      838      310     -528     
Flag Coverage Δ
cube-backend 41.78% <ø> (+0.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@paveltiunov
Copy link
Member

Hey @paulorsbrito ! Thanks for contributing! We already have CUBEJS_DB_NAME supported by the Athena driver. It is just not provided as Database connection property. Could you please elaborate on why do you want to provide Database property? Is it to avoid using fully qualified names?

@paveltiunov paveltiunov self-assigned this Jan 22, 2023
@paulorsbrito
Copy link
Contributor Author

Hey @paulorsbrito ! Thanks for contributing! We already have CUBEJS_DB_NAME supported by the Athena driver. It is just not provided as Database connection property. Could you please elaborate on why do you want to provide Database property? Is it to avoid using fully qualified names?

Hi, @paveltiunov! Thanks for your reply.

Yes, the main reason is to avoid using it in sql queries. It's a Athena feature and something we really need in our scenario.

But it's nice to hear that we already have an env var for this. I'll change the code to use that.

@darapuk
Copy link
Contributor

darapuk commented Feb 2, 2023

Instead of this, cant you just push your credentials into AWS default environment variables? The AWS sdk should handle the above case automatically.

As an example, the below would enable authentication to work as intended:

docker run -p 4000:4000 -p 5432:5432 \
  -v ${PWD}:/cube/conf \
  -e CUBEJS_DEV_MODE=true \
  -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
  -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
  cubejs/cube

@paulorsbrito
Copy link
Contributor Author

That really worked, @darapuk ! Thanks!

As far as I could see in the docs, there's no such env var for default database, so I'll keep that specific changes

@josezambrana
Copy link

I couldn't find a way to configure a database different than default  for athena, but I find this PR can solve this that problems. Is there some way to promote this to be integrated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data source driver pr:community Contribution from Cube.js community members.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants