Skip to content

Commit 984f8fc

Browse files
Odonnoaaronpowell
andauthored
Add dbx hosting integration (#1391)
* feat(dbx): implement sqlserver extensions * feat(dbx): implement postgres extensions * feat(dbx): implement mysql extensions * test: add tests for dbx integration * feat(dbx): implement redis extensions * feat(dbx): implement mongodb extensions * docs(dbx): add missing readme * feat(dbx): disable password protection * Apply suggestions from code review Co-authored-by: Aaron Powell <me@aaron-powell.com> * ci: bump typescript app host sdk version --------- Co-authored-by: Aaron Powell <me@aaron-powell.com>
1 parent 3befda4 commit 984f8fc

39 files changed

Lines changed: 3520 additions & 12 deletions

File tree

CommunityToolkit.Aspire.slnx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<Folder Name="/examples/dbgate/">
3131
<Project Path="examples/dbgate/CommunityToolkit.Aspire.Hosting.DbGate.AppHost/CommunityToolkit.Aspire.Hosting.DbGate.AppHost.csproj" />
3232
</Folder>
33+
<Folder Name="/examples/dbx/">
34+
<Project Path="examples/dbx/CommunityToolkit.Aspire.Hosting.Dbx.AppHost/CommunityToolkit.Aspire.Hosting.Dbx.AppHost.csproj" />
35+
</Folder>
3336
<Folder Name="/examples/deno/">
3437
<Project Path="examples/deno/CommunityToolkit.Aspire.Hosting.Deno.AppHost/CommunityToolkit.Aspire.Hosting.Deno.AppHost.csproj" />
3538
</Folder>
@@ -216,6 +219,7 @@
216219
<Project Path="src/CommunityToolkit.Aspire.Hosting.Azure.Extensions/CommunityToolkit.Aspire.Hosting.Azure.Extensions.csproj" />
217220
<Project Path="src/CommunityToolkit.Aspire.Hosting.Bun/CommunityToolkit.Aspire.Hosting.Bun.csproj" />
218221
<Project Path="src/CommunityToolkit.Aspire.Hosting.DbGate/CommunityToolkit.Aspire.Hosting.DbGate.csproj" />
222+
<Project Path="src/CommunityToolkit.Aspire.Hosting.Dbx/CommunityToolkit.Aspire.Hosting.Dbx.csproj" />
219223
<Project Path="src/CommunityToolkit.Aspire.Hosting.Deno/CommunityToolkit.Aspire.Hosting.Deno.csproj" />
220224
<Project Path="src/CommunityToolkit.Aspire.Hosting.DuckDB/CommunityToolkit.Aspire.Hosting.DuckDB.csproj" />
221225
<Project Path="src/CommunityToolkit.Aspire.Hosting.Elasticsearch.Extensions/CommunityToolkit.Aspire.Hosting.Elasticsearch.Extensions.csproj" />
@@ -283,6 +287,7 @@
283287
<Project Path="tests/CommunityToolkit.Aspire.Hosting.Azure.Extensions.Tests/CommunityToolkit.Aspire.Hosting.Azure.Extensions.Tests.csproj" />
284288
<Project Path="tests/CommunityToolkit.Aspire.Hosting.Bun.Tests/CommunityToolkit.Aspire.Hosting.Bun.Tests.csproj" />
285289
<Project Path="tests/CommunityToolkit.Aspire.Hosting.DbGate.Tests/CommunityToolkit.Aspire.Hosting.DbGate.Tests.csproj" />
290+
<Project Path="tests/CommunityToolkit.Aspire.Hosting.Dbx.Tests/CommunityToolkit.Aspire.Hosting.Dbx.Tests.csproj" />
286291
<Project Path="tests/CommunityToolkit.Aspire.Hosting.Deno.Tests/CommunityToolkit.Aspire.Hosting.Deno.Tests.csproj" />
287292
<Project Path="tests/CommunityToolkit.Aspire.Hosting.DuckDB.Tests/CommunityToolkit.Aspire.Hosting.DuckDB.Tests.csproj" />
288293
<Project Path="tests/CommunityToolkit.Aspire.Hosting.Elasticsearch.Extensions.Tests/CommunityToolkit.Aspire.Hosting.Elasticsearch.Extensions.Tests.csproj" />
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { mkdtempSync } from "node:fs";
2+
import { tmpdir } from "node:os";
3+
import { join } from "node:path";
4+
5+
import { createBuilder } from "./.aspire/modules/aspire.mjs";
6+
7+
const builder = await createBuilder();
8+
9+
// addDbx — create a Dbx resource with an explicit name
10+
const dbx = await builder.addDbx({ name: "dbx" });
11+
12+
// withHostPort — configure a fixed host port
13+
await dbx.withHostPort({ port: 3310 });
14+
15+
// ---- Property access on DbxContainerResource (ExposeProperties = true) ----
16+
const dbxResource = await dbx;
17+
const _primaryEndpoint = await dbxResource.primaryEndpoint();
18+
19+
await builder.build().run();
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"appHost": {
3+
"path": "apphost.mts",
4+
"language": "typescript/nodejs"
5+
},
6+
"sdk": {
7+
"version": "13.4.3"
8+
},
9+
"profiles": {
10+
"https": {
11+
"applicationUrl": "https://localhost:29750;http://localhost:28931",
12+
"environmentVariables": {
13+
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:10975",
14+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:13319"
15+
}
16+
}
17+
},
18+
"packages": {
19+
"CommunityToolkit.Aspire.Hosting.Dbx": "../../../src/CommunityToolkit.Aspire.Hosting.Dbx/CommunityToolkit.Aspire.Hosting.Dbx.csproj"
20+
}
21+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// @ts-check
2+
3+
import { defineConfig } from 'eslint/config';
4+
import tseslint from 'typescript-eslint';
5+
6+
export default defineConfig({
7+
files: ['apphost.mts'],
8+
extends: [tseslint.configs.base],
9+
languageOptions: {
10+
parserOptions: {
11+
projectService: true,
12+
},
13+
},
14+
rules: {
15+
'@typescript-eslint/no-floating-promises': ['error', { checkThenables: true }],
16+
},
17+
});

0 commit comments

Comments
 (0)