Skip to content

Rework preloading data section#145

Open
victorpacyna wants to merge 1 commit intomasterfrom
pacyna/updateRunWithDocker
Open

Rework preloading data section#145
victorpacyna wants to merge 1 commit intomasterfrom
pacyna/updateRunWithDocker

Conversation

@victorpacyna
Copy link

Rephrased the preload data section. I added an .sh file that uses the new process_sql function. The example works now without building a new image, but by volume mounting the files.

Comment on lines +135 to +136
CedarDB supports auto-initializing a new database with SQL and shell scripts. Additionally, the docker image accepts `xz`, `gzip`, or `zstd` compressed SQL files.
Files in `/docker-entrypoint-initdb.d/` are executed or sourced during container setup. Supported file extensions are `.sh`, `.sql`, `.sql.gz`, `sql.xz` and `sql.zst`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might drop zstd in the near future.

Suggested change
CedarDB supports auto-initializing a new database with SQL and shell scripts. Additionally, the docker image accepts `xz`, `gzip`, or `zstd` compressed SQL files.
Files in `/docker-entrypoint-initdb.d/` are executed or sourced during container setup. Supported file extensions are `.sh`, `.sql`, `.sql.gz`, `sql.xz` and `sql.zst`.
CedarDB supports auto-initializing a new database with SQL and shell scripts. Additionally, the docker image accepts `xz` or `gzip` compressed SQL files.
Files in `/docker-entrypoint-initdb.d/` are executed or sourced during container setup. Supported file extensions are `.sh`, `.sql`, `.sql.gz`, and `sql.xz`.

Comment on lines 96 to 118
#### Domain socket authentication

To avoid passing credentials in the shell (e.g., because you don't want it to appear in your history), you can run CedarDB in domain socket-only mode:
To avoid passing credentials in the shell (e.g., because you don't want it to appear in your history), you can run CedarDB in domain socket-only mode:

```shell
docker run --rm -p 5432:5432 \
-e CEDAR_DOMAIN_SOCKET_ONLY=yes \
--name cedardb \
cedardb/cedardb
```

Then connect from the same host using the domain socket:

```shell
docker exec -it cedardb psql -U postgres
```

Once connected, you can [manually create users and databases](/docs/references/sqlreference/statements/createrole):

```sql
create user {{username}} superuser with password '1234';
create database {{username}};
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also drop this part. Alternatively we can now use the init files to set a password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants