Skip to content

Commit

Permalink
feat: add spanner as a db option for the init command (#9121)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonireilly committed Jun 22, 2022
1 parent e24cced commit e61cade
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/commands/InitCommand.ts
Expand Up @@ -232,7 +232,13 @@ sid: "xe.oracle.docker",`
break
case "mongodb":
dbSettings = `type: "mongodb",
database: "test",`
database: "test",`
break
case "spanner":
dbSettings = `type: "spanner",
projectId: "test",
instanceId: "test",
databaseId: "test",`
break
}
return `import "reflect-metadata"
Expand Down Expand Up @@ -602,6 +608,17 @@ services:
ports:
- "27017:27017"
`
case "spanner":
return `version: '3'
services:
spanner:
image: gcr.io/cloud-spanner-emulator/emulator:1.4.1
ports:
- "9010:9010"
- "9020:9020"
`
}
return ""
Expand Down Expand Up @@ -679,6 +696,9 @@ Steps to run this project:
case "mongodb":
packageJson.dependencies["mongodb"] = "^3.0.8"
break
case "spanner":
packageJson.dependencies["@google-cloud/spanner"] = "^5.18.0"
break
}

if (express) {
Expand Down

0 comments on commit e61cade

Please sign in to comment.