@dbos-inc/dbos-sdk 1.1.12-preview → 1.1.13-preview

Sign up to get free protection for your applications and to get access to all the features.
@@ -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^!
@@ -20,7 +20,4 @@ for i in {1..30}; do
20
20
  sleep 1
21
21
  done
22
22
 
23
- # Create a database in Postgres.
24
- docker exec dbos-db psql -U postgres -c "CREATE DATABASE hello;"
25
-
26
23
  echo "Database started successfully!"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbos-inc/dbos-sdk",
3
- "version": "1.1.12-preview",
3
+ "version": "1.1.13-preview",
4
4
  "description": "A Typescript framework built on the database",
5
5
  "license": "MIT",
6
6
  "repository": {