keynote-demo-app
Build or extend a SQLCon EU 2026 keynote demo application so it looks and behaves like the other keynote apps. Use when creating a new demo view (invoices, operations, orders), restyling an existing app to match, adding a deliberate database anti-pattern for a troubleshooting demo, or wiring an app to Azure SQL or Fabric SQL with managed identity. Triggers include "make this look like the keynote app", "build a demo view", "add the slow query demo", "match Caldova styling".
- License 许可
- MIT
- 最近更新
- 2026-11-01
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- keynote-demo-app
- description
- Build or extend a SQLCon EU 2026 keynote demo application so it looks and behaves like the other keynote apps. Use when creating a new demo view (invoices, operations, orders), restyling an existing app to match, adding a deliberate database anti-pattern for a troubleshooting demo, or wiring an app to Azure SQL or Fabric SQL with managed identity. Triggers include "make this look like the keynote app", "build a demo view", "add the slow query demo", "match Caldova styling".
02 资源文件 12
- 其他design-system/tokens.css4.1 KB
- 参考文档references/alembic_migrations.md13.4 KB
- 参考文档references/fulltext_search.md16.1 KB
- 参考文档references/indexes.md14.5 KB
- 参考文档references/jsonb_usage.md14.0 KB
- 参考文档references/query_optimization.md12.1 KB
- 参考文档references/schema_design.md9.9 KB
- 参考文档references/sqlalchemy_models.md17.0 KB
- 脚本scripts/analyze_indexes.py6.9 KB
- 脚本scripts/analyze_queries.py8.0 KB
- 脚本scripts/init_alembic.py9.3 KB
- 脚本scripts/schema_inspector.py6.7 KB
03 SKILL.md 正文
Keynote demo app
Two keynote demos share one product identity. Demo 2 shows evidence search on Azure SQL Hyperscale. Demo 3 shows a different view of the same product running slowly, then fixed. They must read as one application. This skill is how you keep that true.
Non-negotiables
-
Import the shared tokens. Never invent colours or fonts.
@import '../../shared/design-system/tokens.css';Palette: canvas
#f8f9f6, ink#183129, forest#1b5343, coral#e27156. Type: Manrope for UI, Newsreader for headings, DM Mono for anything numeric or SQL. -
Reuse the layout skeleton. Sticky
.topbarwith.brand+.brand-mark, a centred.workspace, an.eyebrowabove theh1, and a.metric-bandfor live numbers. -
Show the SQL. Every keynote app has a tab or panel that displays the exact parameterized statement it just ran. The audience needs to see it is real SQL.
-
Never fake a number. If the database is unreachable or a contract check fails, render
--and say so. Do not interpolate, estimate, or reuse a previous value. This rule cost real work in demo 2 and it is the reason the demo is trustworthy. -
Parameterize everything. No string-concatenated SQL, ever. It is both a security issue and the subject of demo 3.
Building a new view
Start from demo3-estate-running-itself/app. It is deliberately small: a Vite React client,
an Express API, and one SQL module. Copy it, rename the entity, keep the shell.
Structure to preserve:
app/
server/index.ts Express API. One route per screen. Parameterized queries only.
src/App.tsx One page. Search control, metric band, results table, SQL panel.
src/App.css View-specific styles only. Tokens come from shared/.
Connecting to the database
Use Microsoft Entra authentication and a managed identity. Never put a SQL login in code or in an environment file.
import { DefaultAzureCredential } from '@azure/identity'
import sql from 'mssql' // NOTE: default import. mssql is CommonJS.
import type * as MSSQL from 'mssql' // types only
const token = await new DefaultAzureCredential().getToken('https://database.windows.net/.default')
const pool = await new sql.ConnectionPool({
server: process.env.AZURE_SQL_SERVER,
database: process.env.AZURE_SQL_DATABASE,
authentication: { type: 'azure-active-directory-access-token', options: { token: token.token } },
options: { encrypt: true, trustServerCertificate: false },
}).connect()
Grant the identity a least-privilege role, not db_owner:
CREATE USER [my-app-identity] FROM EXTERNAL PROVIDER;
ALTER ROLE MyAppReader ADD MEMBER [my-app-identity];
Known traps
These cost hours during demo 2. Do not rediscover them.
import * as sql from 'mssql'compiles but throwssql.ConnectionPool is not a constructorat runtime. mssql is CommonJS with no ESM named exports. Use a default import.COUNT_BIGcomes back as a string through tedious.count === 1000is always false. Wrap inNumber().CAST(vector AS NVARCHAR(MAX))is lossy at about 8 significant digits, so it cannot verify a float32 round trip. Compare vectors in-engine withVECTOR_DISTANCE('euclidean', a, b) = 0.- Docker
COPYpreserves restrictive host file permissions. If files come from OneDrive, addCOPY --chown=node:nodeandchmod, or the container fails withEACCES. - A Container Apps job with a system-assigned identity cannot pull its own first image. Create a
user-assigned identity, grant
AcrPull, then reference it with--registry-identity.
Adding a deliberate anti-pattern
Demo 3 needs a query that is slow for a reason a human can explain in one sentence. The approved one is a parameter type mismatch that forces a scan instead of a seek.
Make the column and the parameter disagree:
CREATE TABLE dbo.Invoice (InvoiceNumber VARCHAR(20) NOT NULL, ...);
CREATE NONCLUSTERED INDEX IX_Invoice_InvoiceNumber ON dbo.Invoice (InvoiceNumber);
// Slow: NVarChar parameter against a VARCHAR column forces CONVERT_IMPLICIT on every row.
request.input('invoiceNumber', sql.NVarChar(20), value)
// Fixed: matching type allows an index seek.
request.input('invoiceNumber', sql.VarChar(20), value)
The fix is one word in the application. That is the point of the demo: the database was never wrong, and nobody had to change the schema.
Keep both paths in the code behind a config flag so the before and after can be shown live without editing files on stage.
Writing copy for the app
Match the house voice: short sentences, plain English, direct address. Say "1,000 chunks" not "a corpus of approximately one thousand document fragments". Avoid "leverage", "seamless", "powerful", and "exciting".
04 同仓库更多 Skills
validate-post-migration-data
Validate data and schema after migrating SQL Server to Azure SQL Database, Azure SQL Managed Instance, or SQL Server on Azure VM. Use after migration, restore, BACPAC import, LRS completion, cutover validation, row-count comparison, or source-target reconciliation.
sql-server-to-sql-mi-lrs-migration
Migrate SQL Server databases to Azure SQL Managed Instance with Log Replay Service (LRS) using managed identity for Blob access. Use for SQL Server to SQL MI, LRS, log replay, continuous restore, or low-downtime backup-chain migrations.
sql-bacpac-to-azure-sql-db-migration
Migrate one or all user databases from SQL Server to Azure SQL Database with an offline BACPAC workflow. Use for BACPAC, SqlPackage export/import, bulk database migration, or offline Azure SQL Database migration requests.
sql-backup-restore-to-azure-sql-vm-migration
Migrate a SQL Server 2008 through SQL Server 2025 source to a SQL Server 2025 target wherever it runs, including SQL Server on Azure VM, by creating a local full backup, uploading it to Azure Blob Storage with AzCopy and the operator's Microsoft Entra identity, and restoring from URL with the target SQL Server managed identity. Sources newer than SQL Server 2025 are blocked because target restore compatibility has not been validated. Use for SQL-to-SQL, local-backup, AzCopy, managed-identity, Azure SQL VM, or SQL Server 2025 restore migrations.
run-migration-assessment
Route generic or unresolved SQL Server assessment, readiness, compatibility, cost, and SKU recommendation requests. Use for bare server names or whenever Azure versus local/on-premises is not explicit; ask which source applies, then delegate.
recommend-sku-sizing
Collect performance data and calculate Azure SQL SKU recommendations only after the source is explicitly confirmed local/on-premises. Never use for a generic SKU request or bare server name; route unresolved requests through run-migration-assessment.