Skip to content

Instantly share code, notes, and snippets.

@sumanthkumarc
Created February 10, 2023 06:45
Show Gist options
  • Save sumanthkumarc/99b0a972fef01283aee4c0ced96a4c79 to your computer and use it in GitHub Desktop.
Save sumanthkumarc/99b0a972fef01283aee4c0ced96a4c79 to your computer and use it in GitHub Desktop.
Database config file sample for usql
databases:
my_handy_db_alias: # SOME HANDY IDENTIFIER KEY TO USE IN CLI ARGS FOR --db. USEFUL WHEN TWO DB'S ACROSS HOSTS HAS SAME NAME.
name: <DATABASE_NAME> # THIS IS THE ACTUAL DATABASE NAME
host: <WRITER_HOST_URL> # THIS IS THE DEFAULT HOST BEING USED FOR OPERATIONS.
reader_host: <READER_HOST_URL> # IDEA IS TO USE THIS AUTOMATICALLY FOR READER USER ROLE. THIS IS TODO FOR NOW.
port: <DB_PORT>
db_type: <DATABASE_TYPE> # THIS IS DIRECT RELATED TO USQL DRIVER NAMES. THE SCHEME PART OF DSN.
credentials:
- username: root
role: admin # USED IN CLI ARGS FOR --role.
password: <PASSWORD>
- username: reader
role: reader # IDEA OF ROLES IS TO SEGREGATE USERS AND PROVIDE ABILITY TO HAVE MULTIPLE USERS IN CONFIG FOR USAGE.
password: <PASSWORD>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment