postgres
Module for building Postgres containers, serving a postgres service,or querying a running postgres database.
Installation
dagger install github.com/kpenfound/dagger-modules/postgres@v0.1.0
Entrypoint
Return Type
Postgres !
Arguments
Name | Type | Description |
---|---|---|
version | String | The postgres container tag |
Example
dagger -m github.com/kpenfound/dagger-modules/postgres@57352e06a1cfbcb5307c009d37c0201b2719b935 call \
func (m *myModule) example() *Postgres {
return dag.
Postgres()
}
@function
def example() -> dag.Postgres:
return (
dag.postgres()
)
@func()
example(): Postgres {
return dag
.postgres()
}
Types
Postgres 🔗
version() 🔗
Return Type
String !
Example
dagger -m github.com/kpenfound/dagger-modules/postgres@57352e06a1cfbcb5307c009d37c0201b2719b935 call \
version
func (m *myModule) example(ctx context.Context) string {
return dag.
Postgres().
Version(ctx)
}
@function
async def example() -> str:
return await (
dag.postgres()
.version()
)
@func()
async example(): Promise<string> {
return dag
.postgres()
.version()
}
withVersion() 🔗
Specify a tag of postgres to use
Return Type
Postgres !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String ! | - | The postgres container tag |
Example
dagger -m github.com/kpenfound/dagger-modules/postgres@57352e06a1cfbcb5307c009d37c0201b2719b935 call \
with-version --version string
func (m *myModule) example(version string) *Postgres {
return dag.
Postgres().
WithVersion(version)
}
@function
def example(version: str) -> dag.Postgres:
return (
dag.postgres()
.with_version(version)
)
@func()
example(version: string): Postgres {
return dag
.postgres()
.withVersion(version)
}
container() 🔗
Get the postgres container with the directory in it
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
platform | String | - | The platform of the container |
Example
dagger -m github.com/kpenfound/dagger-modules/postgres@57352e06a1cfbcb5307c009d37c0201b2719b935 call \
container
func (m *myModule) example() *Container {
return dag.
Postgres().
Container()
}
@function
def example() -> dagger.Container:
return (
dag.postgres()
.container()
)
@func()
example(): Container {
return dag
.postgres()
.container()
}
service() 🔗
Get a postgres container as a service
Return Type
Service !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
platform | String | - | The platform of the container |
Example
dagger -m github.com/kpenfound/dagger-modules/postgres@57352e06a1cfbcb5307c009d37c0201b2719b935 call \
service
func (m *myModule) example() *Service {
return dag.
Postgres().
Service()
}
@function
def example() -> dagger.Service:
return (
dag.postgres()
.service()
)
@func()
example(): Service {
return dag
.postgres()
.service()
}
client() 🔗
Get a terminal of a psql client connected to a Postgres database
Return Type
Terminal !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
server | Service ! | - | The Postgres server to connect to |
db | String ! | - | The postgres database |
user | String ! | - | The postgres user |
password | String ! | - | The postgres password |
port | String | "5432" | The postgres port |
version | String | "16" | The postgres client container tag |
Example
dagger -m github.com/kpenfound/dagger-modules/postgres@57352e06a1cfbcb5307c009d37c0201b2719b935 call \
client --server PROTOCOL://HOST:PORT --db string --user string --password string
func (m *myModule) example(server *Service, db string, user string, password string) *Terminal {
return dag.
Postgres().
Client(server, db, user, password)
}
@function
def example(server: dagger.Service, db: str, user: str, password: str) -> dag.Terminal:
return (
dag.postgres()
.client(server, db, user, password)
)
@func()
example(server: Service, db: string, user: string, password: string): Terminal {
return dag
.postgres()
.client(server, db, user, password)
}