@dbos-inc/create 0.0.0-placeholder

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "dbos-hello",
3
+ "version": "0.0.1",
4
+ "scripts": {
5
+ "build": "tsc",
6
+ "test": "npx knex migrate:rollback && npx knex migrate:up && jest",
7
+ "lint": "eslint src",
8
+ "lint-fix": "eslint --fix src"
9
+ },
10
+ "devDependencies": {
11
+ "@dbos-inc/eslint-plugin": "^0.0.6",
12
+ "@types/jest": "^29.5.5",
13
+ "@types/supertest": "^2.0.14",
14
+ "eslint": "^8.56.0",
15
+ "jest": "^29.7.0",
16
+ "supertest": "^6.3.3",
17
+ "ts-jest": "^29.1.1",
18
+ "typescript": "^5.2.2"
19
+ },
20
+ "dependencies": {
21
+ "@dbos-inc/dbos-sdk": "../../../..",
22
+ "knex": "3.1.0"
23
+ }
24
+ }
@@ -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^!
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Check if PGPASSWORD is set
5
+ if [[ -z "${PGPASSWORD}" ]]; then
6
+ echo "Error: PGPASSWORD is not set." >&2
7
+ exit 1
8
+ fi
9
+
10
+ # Start Postgres in a local Docker container
11
+ 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
12
+
13
+ # Wait for PostgreSQL to start
14
+ echo "Waiting for PostgreSQL to start..."
15
+ for i in {1..30}; do
16
+ if docker exec dbos-db psql -U postgres -c "SELECT 1;" > /dev/null 2>&1; then
17
+ echo "PostgreSQL started!"
18
+ break
19
+ fi
20
+ sleep 1
21
+ done
22
+
23
+ echo "Database started successfully!"