psql
It enables you to type in queries interactively, issue them to Postgres, and see the query results.Alternatively, input can be from a file.
In addition, it provides a number of meta-commands and various shell-like features to facilitate writing scripts and automating a wide variety of tasks.
Installation
dagger install github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2eEntrypoint
Return Type
Psql !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | - | Version (image tag) to use from the official image repository as a base container. |
| container | Container | - | Custom container to use as a base container. Takes precedence over version. |
| host | String | - | Name of host to connect to. |
| service | Service | - | Service to connect to. Port needs to match the exposed port of the service. |
| port | Integer | 5432 | Port number to connect to at the server host. |
| user | Secret | - | PostgreSQL user name to connect as. (default "postgres") |
| password | Secret | - | Password to be used if the server demands password authentication. |
| database | String | - | The database name. |
| sslmode | Enum | - | This option determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. |
Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
func (m *MyModule) Example() *dagger.Psql {
return dag.
Psql()
}@function
def example() -> dagger.Psql:
return (
dag.psql()
)@func()
example(): Psql {
return dag
.psql()
}Types
Psql 🔗
container() 🔗
Return Type
Container ! Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
containerfunc (m *MyModule) Example() *dagger.Container {
return dag.
Psql().
Container()
}@function
def example() -> dagger.Container:
return (
dag.psql()
.container()
)@func()
example(): Container {
return dag
.psql()
.container()
}terminal() 🔗
Open a psql terminal.
Return Type
Container ! Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
terminalfunc (m *MyModule) Example() *dagger.Container {
return dag.
Psql().
Terminal()
}@function
def example() -> dagger.Container:
return (
dag.psql()
.terminal()
)@func()
example(): Container {
return dag
.psql()
.terminal()
}list() 🔗
List all available databases.
Return Type
[DatabaseListEntry ! ] ! Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
listfunc (m *MyModule) Example() []*dagger.PsqlDatabaseListEntry {
return dag.
Psql().
List()
}@function
def example() -> List[dagger.PsqlDatabaseListEntry]:
return (
dag.psql()
.list()
)@func()
example(): PsqlDatabaseListEntry[] {
return dag
.psql()
.list()
}runCommand() 🔗
Run a single command.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| command | String ! | - | No description provided |
Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
run-command --command stringfunc (m *MyModule) Example(ctx context.Context, command string) string {
return dag.
Psql().
RunCommand(ctx, command)
}@function
async def example(command: str) -> str:
return await (
dag.psql()
.run_command(command)
)@func()
async example(command: string): Promise<string> {
return dag
.psql()
.runCommand(command)
}runFile() 🔗
Run a single command from a file.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| file | File ! | - | No description provided |
Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
run-file --file file:pathfunc (m *MyModule) Example(ctx context.Context, file *dagger.File) string {
return dag.
Psql().
RunFile(ctx, file)
}@function
async def example(file: dagger.File) -> str:
return await (
dag.psql()
.run_file(file)
)@func()
async example(file: File): Promise<string> {
return dag
.psql()
.runFile(file)
}run() 🔗
Run a series of commands.
Return Type
Run ! Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
runfunc (m *MyModule) Example() *dagger.PsqlRun {
return dag.
Psql().
Run()
}@function
def example() -> dagger.PsqlRun:
return (
dag.psql()
.run()
)@func()
example(): PsqlRun {
return dag
.psql()
.run()
}DatabaseListEntry 🔗
name() 🔗
Return Type
String ! Example
Function PsqlDatabaseListEntry.name is not accessible from the psql moduleFunction PsqlDatabaseListEntry.name is not accessible from the psql moduleFunction PsqlDatabaseListEntry.name is not accessible from the psql moduleFunction PsqlDatabaseListEntry.name is not accessible from the psql moduleowner() 🔗
Return Type
String ! Example
Function PsqlDatabaseListEntry.owner is not accessible from the psql moduleFunction PsqlDatabaseListEntry.owner is not accessible from the psql moduleFunction PsqlDatabaseListEntry.owner is not accessible from the psql moduleFunction PsqlDatabaseListEntry.owner is not accessible from the psql moduleencoding() 🔗
Return Type
String ! Example
Function PsqlDatabaseListEntry.encoding is not accessible from the psql moduleFunction PsqlDatabaseListEntry.encoding is not accessible from the psql moduleFunction PsqlDatabaseListEntry.encoding is not accessible from the psql moduleFunction PsqlDatabaseListEntry.encoding is not accessible from the psql modulelocaleProvider() 🔗
Return Type
String ! Example
Function PsqlDatabaseListEntry.localeProvider is not accessible from the psql moduleFunction PsqlDatabaseListEntry.localeProvider is not accessible from the psql moduleFunction PsqlDatabaseListEntry.localeProvider is not accessible from the psql moduleFunction PsqlDatabaseListEntry.localeProvider is not accessible from the psql modulecollate() 🔗
Return Type
String ! Example
Function PsqlDatabaseListEntry.collate is not accessible from the psql moduleFunction PsqlDatabaseListEntry.collate is not accessible from the psql moduleFunction PsqlDatabaseListEntry.collate is not accessible from the psql moduleFunction PsqlDatabaseListEntry.collate is not accessible from the psql modulectype() 🔗
Return Type
String ! Example
Function PsqlDatabaseListEntry.ctype is not accessible from the psql moduleFunction PsqlDatabaseListEntry.ctype is not accessible from the psql moduleFunction PsqlDatabaseListEntry.ctype is not accessible from the psql moduleFunction PsqlDatabaseListEntry.ctype is not accessible from the psql moduleiculocale() 🔗
Return Type
String ! Example
Function PsqlDatabaseListEntry.iculocale is not accessible from the psql moduleFunction PsqlDatabaseListEntry.iculocale is not accessible from the psql moduleFunction PsqlDatabaseListEntry.iculocale is not accessible from the psql moduleFunction PsqlDatabaseListEntry.iculocale is not accessible from the psql moduleicurules() 🔗
Return Type
String ! Example
Function PsqlDatabaseListEntry.icurules is not accessible from the psql moduleFunction PsqlDatabaseListEntry.icurules is not accessible from the psql moduleFunction PsqlDatabaseListEntry.icurules is not accessible from the psql moduleFunction PsqlDatabaseListEntry.icurules is not accessible from the psql moduleaccessPrivileges() 🔗
Return Type
String ! Example
Function PsqlDatabaseListEntry.accessPrivileges is not accessible from the psql moduleFunction PsqlDatabaseListEntry.accessPrivileges is not accessible from the psql moduleFunction PsqlDatabaseListEntry.accessPrivileges is not accessible from the psql moduleFunction PsqlDatabaseListEntry.accessPrivileges is not accessible from the psql moduleRun 🔗
withCommand() 🔗
Add a command to the list of commands.
Return Type
Run !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| command | String ! | - | No description provided |
Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
run \
with-command --command stringfunc (m *MyModule) Example(command string) *dagger.PsqlRun {
return dag.
Psql().
Run().
WithCommand(command)
}@function
def example(command: str) -> dagger.PsqlRun:
return (
dag.psql()
.run()
.with_command(command)
)@func()
example(command: string): PsqlRun {
return dag
.psql()
.run()
.withCommand(command)
}withFile() 🔗
Add a command to the list of commands from a file.
Return Type
Run !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| file | File ! | - | No description provided |
Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
run \
with-file --file file:pathfunc (m *MyModule) Example(file *dagger.File) *dagger.PsqlRun {
return dag.
Psql().
Run().
WithFile(file)
}@function
def example(file: dagger.File) -> dagger.PsqlRun:
return (
dag.psql()
.run()
.with_file(file)
)@func()
example(file: File): PsqlRun {
return dag
.psql()
.run()
.withFile(file)
}execute() 🔗
Add a command to the list of commands from a file.
Return Type
String ! Example
dagger -m github.com/jedevc/daggerverse-sagikazarmark/psql@a104424df38ca8b0b758f699dcfeeb0c2210cc2e call \
run \
executefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Psql().
Run().
Execute(ctx)
}@function
async def example() -> str:
return await (
dag.psql()
.run()
.execute()
)@func()
async example(): Promise<string> {
return dag
.psql()
.run()
.execute()
}