@dbos-inc/dbos-sdk 1.1.12-preview.g10d6bbb0dc → 1.1.13-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/dbos-runtime/config.d.ts +2 -0
- package/dist/src/dbos-runtime/config.d.ts.map +1 -1
- package/dist/src/dbos-runtime/config.js +33 -18
- package/dist/src/dbos-runtime/config.js.map +1 -1
- package/dist/src/dbos-runtime/migrate.d.ts.map +1 -1
- package/dist/src/dbos-runtime/migrate.js +5 -34
- package/dist/src/dbos-runtime/migrate.js.map +1 -1
- package/dist/src/httpServer/server.d.ts +6 -0
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/httpServer/server.js +20 -1
- package/dist/src/httpServer/server.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/examples/hello/README.md +9 -1
- package/examples/hello/start_postgres_docker.bat +36 -0
- package/examples/hello/start_postgres_docker.sh +0 -3
- package/package.json +1 -1
package/examples/hello/README.md
CHANGED
@@ -5,13 +5,21 @@ This is a [DBOS app](https://docs.dbos.dev/) bootstrapped with `npx @dbos-inc/db
|
|
5
5
|
## Getting Started
|
6
6
|
|
7
7
|
Before you can launch your app, you need a database.
|
8
|
-
DBOS works with any Postgres database, but to make things easier, we've provided a script that starts a Docker Postgres container and creates a database
|
8
|
+
DBOS works with any Postgres database, but to make things easier, we've provided a script that starts a Docker Postgres container and creates a database.
|
9
|
+
On Linux or Mac, run:
|
9
10
|
|
10
11
|
```bash
|
11
12
|
export PGPASSWORD=dbos
|
12
13
|
./start_postgres_docker.sh
|
13
14
|
```
|
14
15
|
|
16
|
+
On Windows (cmd), run:
|
17
|
+
|
18
|
+
```cmd
|
19
|
+
set PGPASSWORD=dbos
|
20
|
+
start_postgres_docker.bat
|
21
|
+
```
|
22
|
+
|
15
23
|
If successful, the script should print `Database started successfully!`.
|
16
24
|
|
17
25
|
Then, let's run a schema migration to create some tables:
|
@@ -0,0 +1,36 @@
|
|
1
|
+
@echo off
|
2
|
+
|
3
|
+
setlocal ENABLEEXTENSIONS
|
4
|
+
|
5
|
+
echo Checking if PGPASSWORD is set.
|
6
|
+
if "%PGPASSWORD%"=="" (
|
7
|
+
echo Error: PGPASSWORD is not set.
|
8
|
+
exit /b 1
|
9
|
+
)
|
10
|
+
|
11
|
+
echo Starting PostgreSQL in a local Docker container
|
12
|
+
docker run --rm --name=dbos-db --env=POSTGRES_PASSWORD=%PGPASSWORD% --env=PGDATA=/var/lib/postgresql/data --volume=/var/lib/postgresql/data -p 5432:5432 -d postgres:16.1
|
13
|
+
|
14
|
+
if %errorlevel% == 125 (
|
15
|
+
echo Error: Check if the Docker container already exists
|
16
|
+
exit /b 1
|
17
|
+
) else (
|
18
|
+
goto :start
|
19
|
+
)
|
20
|
+
|
21
|
+
:start
|
22
|
+
echo Waiting for PostgreSQL to start...
|
23
|
+
for /l %%i in (1,1,30) do (
|
24
|
+
docker exec dbos-db psql -U postgres -c "SELECT 1;" >NUL 2>&1
|
25
|
+
|
26
|
+
if %errorlevel% equ 0 (
|
27
|
+
(
|
28
|
+
echo PostgreSQL started!
|
29
|
+
goto :break
|
30
|
+
)
|
31
|
+
timeout /t 1 /nobreak
|
32
|
+
)
|
33
|
+
)
|
34
|
+
:break
|
35
|
+
|
36
|
+
echo Database started successfully^!
|