{"id":13546017,"url":"https://github.com/kurtosis-tech/postgres-package","last_synced_at":"2025-07-22T19:04:32.028Z","repository":{"id":157745622,"uuid":"633607730","full_name":"kurtosis-tech/postgres-package","owner":"kurtosis-tech","description":"A Postgres Kurtosis package","archived":false,"fork":false,"pushed_at":"2025-03-19T17:08:36.000Z","size":51,"stargazers_count":9,"open_issues_count":4,"forks_count":10,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-07T20:44:06.539Z","etag":null,"topics":["kurtosis","kurtosis-package"],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kurtosis-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-27T22:12:06.000Z","updated_at":"2025-03-19T17:08:39.000Z","dependencies_parsed_at":"2023-10-16T20:39:45.376Z","dependency_job_id":"1fa002db-22fc-4c24-906d-393f880543df","html_url":"https://github.com/kurtosis-tech/postgres-package","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"kurtosis-tech/package-template-repo","purl":"pkg:github/kurtosis-tech/postgres-package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtosis-tech%2Fpostgres-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtosis-tech%2Fpostgres-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtosis-tech%2Fpostgres-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtosis-tech%2Fpostgres-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kurtosis-tech","download_url":"https://codeload.github.com/kurtosis-tech/postgres-package/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtosis-tech%2Fpostgres-package/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266554177,"owners_count":23947282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kurtosis","kurtosis-package"],"created_at":"2024-08-01T12:00:30.090Z","updated_at":"2025-07-22T19:04:32.007Z","avatar_url":"https://github.com/kurtosis-tech.png","language":"Starlark","readme":"Postgres Package\n================\nThis is a [Kurtosis package](https://docs.kurtosis.com/concepts-reference/packages) for starting a Postgres instance.\n\nRun this package\n----------------\nIf [you have Kurtosis installed][install-kurtosis], you can run: \n\n```bash\nkurtosis run github.com/kurtosis-tech/postgres-package\n```\n\nIf you don't have Kurtosis installed, [click here to run this package on the Kurtosis playground](https://gitpod.io/#KURTOSIS_PACKAGE_LOCATOR=github.com%2Fkurtosis-tech%2Fpostgres-package/https://github.com/kurtosis-tech/playground-gitpod).\n\nThe information for accessing the Postgres port will be outputted as a result of the run:\n\n```\n========================================== User Services ==========================================\nUUID           Name       Ports                                                  Status\nd411d8452f44   postgres   postgresql: 5432/tcp -\u003e postgresql://127.0.0.1:65332   RUNNING\n```\n\nTo blow away the created [enclave][enclaves-reference], run `kurtosis clean -a`.\n\n#### Return value\n\nSee the \"Using this package in your package\" section below.\n\n\n#### Configuration\n\n\u003cdetails\u003e\n    \u003csummary\u003eClick to see configuration\u003c/summary\u003e\n\nYou can configure this package using the following JSON structure (though note that `//` lines aren't valid JSON, so you must remove them!). The default value each parameter will take if omitted is shown here:\n\n```javascript\n{\n    // The Docker image that will be run\n    \"image\": \"postgres:alpine\",\n\n    // The name given to the service that gets added\n    \"name\": \"postgres\",\n\n    // The name of the user that will be created\n    \"user\": \"postgres\",\n\n    // The password given to the created user\n    \"password\": \"MyPassword1!\",\n\n    // The name of the database that will be created\n    // OPTIONAL\n    \"database\": \"postgres\",\n\n    // The name of a files artifact (https://docs.kurtosis.com/concepts-reference/files-artifacts) that should contain \n    // a 'postgresql.conf' file for configuring the database.\n    \"config_file_artifact\": \"\",\n\n    // The name of a files artifact (https://docs.kurtosis.com/concepts-reference/files-artifacts) that should contain \n    // SQL files which will be called upon server startup to seed the database\n    \"seed_file_artifact\": \"\",\n\n    // An array of key=value string that overrides postgres config default values.\n    // example: \"[log_connections=yes]\"\n    \"postgres_config\": [],\n}\n```\n\nFor example:\n\n```bash\nkurtosis run github.com/kurtosis-tech/postgres-package '{\"image\":\"postgres:15.2-alpine\",\"user\":\"johnsnow\"}'\n```\n\n\u003c/details\u003e\n\nUse this package in your package\n--------------------------------\nKurtosis packages can be composed inside other Kurtosis packages. To use this package in your package...\n\nFirst, import this package by adding the following to the top of your Starlark file:\n\n```python\npostgres = import_module(\"github.com/kurtosis-tech/postgres-package/main.star\")\n```\n\nThen, call the this package's `run` function somewhere in your Starlark script:\n\n```python\npostgres_output = postgres.run(plan, args)\n```\n\nThe `run` function of this package will return a struct with the following properties:\n\n```python\npostgres_output = postgres.run(plan, args)\n\n# A convenience URL for depending on the started Postgres, of the form postgresql://USER:PASSWORD@HOSTNAME/DATABASE\npostgres_output.url\n\n# An Service object instance (see https://docs.kurtosis.com/starlark-reference/service)\n# Used to get information about the Postgres instance\npostgres_output.service\n\n# A PortSpec object containing information about the port Postgres is listening on (see https://docs.kurtosis.com/starlark-reference/port-spec)\npostgres_output.port\n\n# The user that the Postgres service was created with\npostgres_output.user\n\n# The password the user was created with\npostgres_output.password\n\n# The name of the Postgres database\npostgres_output.database\n```\n\nThis can be used to depend on the created Postgres service:\n\n```python\npostgres_output = postgres.run(plan, args)\n\n# Depends on Postgres\nplan.add_service(\n    name = \"my-app\",\n    config = ServiceConfig(\n        image = \"my-app\",\n        env_vars = {\n            \"POSTGRES\": postgres_output.url,\n        }\n    )\n)\n```\n\nDevelop on this package\n-----------------------\n1. [Install Kurtosis][install-kurtosis]\n1. Clone this repo\n1. For your dev loop, run `kurtosis clean -a \u0026\u0026 kurtosis run .` inside the repo directory\n\n\n\u003c!-------------------------------- LINKS -------------------------------\u003e\n[install-kurtosis]: https://docs.kurtosis.com/install\n[enclaves-reference]: https://docs.kurtosis.com/concepts-reference/enclaves\n[service-reference]: https://docs.kurtosis.com/starlark-reference/plan\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurtosis-tech%2Fpostgres-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkurtosis-tech%2Fpostgres-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurtosis-tech%2Fpostgres-package/lists"}