SvelteKit Dashboard
Setup
pnpm install
Developing
- Start a development database:
pnpm run db:dev:up
To stop the database:
pnpm run db:dev:down
- Start a development server:
pnpm run dev
Useful psql
commands:
To connect to a PostgreSQL database using the psql
command-line client, you'll need the following information:
- Hostname or IP address: The address where the PostgreSQL server is running.
- Port: The port on which PostgreSQL is listening. The default is usually 5432.
- Database name: The name of the database you want to connect to.
- Username: The username used to authenticate to the database.
- Password: The password for the specified username.
psql -h hostname -p port -d database -U username
or you can use the connection string
psql postgresql://username:password@dbmaster:5433/mydb?sslmode=require
Connect to a Database: As mentioned earlier, you can connect to a database using:
- List Databases: To list all databases, you can use:
\l
- Connect to a Specific Database: You can connect to a specific database after starting psql using:
\c database_name
- List Tables: To list all tables in the current database, use:
\dt
- Describe Table Structure: To describe the structure of a specific table, use:
\d table_name
- Execute SQL Queries: You can directly execute SQL queries within psql. For example:
SELECT * FROM table_name;
- Quit psql: To exit the psql command-line client, you can use:
\q
- Help: For a list of all available commands and their descriptions, you can use:
\?
- Search Command History: You can search your command history using:
\s
- Toggle Expanded Display: To toggle the expanded display, which shows rows vertically, use:
\x