superset icon indicating copy to clipboard operation
superset copied to clipboard

Add a database via superset_config.py script

Open nawazxy opened this issue 6 years ago • 3 comments

I'm running superset in a docker container with my config in superset_config.py script. Currently, there's just one database wired to the app which contains superset's default schema. In order to build charts, I'd like to know if there's a way to add a new database via the superset_config.py in a similar manner as we do with the examples database instead of doing so through the UI.

nawazxy avatar Apr 26 '20 08:04 nawazxy

There's no way to add a database on the config (unless you write some code around it). Yet, we will soon implement an API endpoint to support this

dpgaspar avatar Apr 28 '20 15:04 dpgaspar

After a bit of digging around I found the command superset set_database_uri -d <db_name> -u <db_uri> useful. I'm running it after superset db upgrade and init commands in a bash script within the Superset container and it adds a new database entry for me. Is that okay?

nawazxy avatar Apr 28 '20 18:04 nawazxy

Oh yes, totally forgot that one, yes it's fine

dpgaspar avatar May 04 '20 02:05 dpgaspar