postgres
This module is aimed at providing a simple way to launch a Postgres database server for development and testing purposes.Check out the official Postgres image on Docker Hub for further customization options: https://hub.docker.com/_/postgres
Installation
dagger install github.com/sagikazarmark/daggerverse/postgres@v0.1.0
Entrypoint
Return Type
Postgres !
Arguments
Name | Type | 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. |
user | Secret | Superuser name. (default "postgres") |
password | Secret | Superuser password. (defaults to a generated password) |
database | String | The database name. (defaults to the user name) |
dataVolume | CacheVolume | Mount a volume to persist data between runs. |
initScripts | Directory | Initialization scripts (*.sql and *.sh) to run when the service first starts. |
initdbArgs | [String ! ] | Additional arguments to pass to initdb. |
Example
dagger -m github.com/sagikazarmark/daggerverse/postgres@97042d257879e5ab8756af5d5077675058de2fd9 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 🔗
user() 🔗
Superuser name.
Return Type
Secret !
Example
dagger -m github.com/sagikazarmark/daggerverse/postgres@97042d257879e5ab8756af5d5077675058de2fd9 call \
user
func (m *myModule) example() *Secret {
return dag.
Postgres().
User()
}
@function
def example() -> dagger.Secret:
return (
dag.postgres()
.user()
)
@func()
example(): Secret {
return dag
.postgres()
.user()
}
password() 🔗
Superuser password.
Return Type
Secret !
Example
dagger -m github.com/sagikazarmark/daggerverse/postgres@97042d257879e5ab8756af5d5077675058de2fd9 call \
password
func (m *myModule) example() *Secret {
return dag.
Postgres().
Password()
}
@function
def example() -> dagger.Secret:
return (
dag.postgres()
.password()
)
@func()
example(): Secret {
return dag
.postgres()
.password()
}
database() 🔗
The database name.
Return Type
String !
Example
dagger -m github.com/sagikazarmark/daggerverse/postgres@97042d257879e5ab8756af5d5077675058de2fd9 call \
database
func (m *myModule) example(ctx context.Context) string {
return dag.
Postgres().
Database(ctx)
}
@function
async def example() -> str:
return await (
dag.postgres()
.database()
)
@func()
async example(): Promise<string> {
return dag
.postgres()
.database()
}
service() 🔗
The Postgres service.
Return Type
Service !
Example
dagger -m github.com/sagikazarmark/daggerverse/postgres@97042d257879e5ab8756af5d5077675058de2fd9 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()
}