Help us learn about your current experience with the documentation.
Take the survey.
Database Lab access using thepgai
Ruby gem
@mbobin created the pgai
Ruby Gem that greatly simplifies access to a database clone, with support for:
psql
sessions on the same clone.If you have AllFeaturesUser
psql
access, you can follow the steps below to configure the pgai
Gem:
To get started, you need to gather some values from the Postgres.ai instances page:
Go to the instance that you want to configure and the on right side of the screen.
Under Connection, select Connect. The menu might be collapsed.
A dialog with everything that’s needed for configuration appears, using this format:
dblab init --url "http://127.0.0.1:<local-port>" --token TOKEN --environment-id <environment-id>
ssh -NTML <local-port>:localhost:<instance-port> <instance-host> -i ~/.ssh/id_rsa
To configure ssh
, follow the instruction at Access the console with psql
, replacing ${USER}
with your postgres.ai username.
Run the following commands:
gem install pgai
# Before running the following command,
# grab an access token from https://console.postgres.ai/gitlab/tokens
pgai config --prefix=<postgresai-user>
# Grab the respective port values from https://console.postgres.ai/gitlab/instances
# for the instances you'll be using (in this case, for the `main` database instance)
pgai env add --alias main --id <instance-host> --port <instance-port> -n gitlabhq_dblab
Once this one-time configuration is done, you can use pgai connect
to connect to a particular database. For instance, to connect to the main
database:
Once done with the clone, you can destroy it:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4