Project File
Projects use the .d1pac extension:
<D1Pac ProjectVersion="1">
<PropertyGroup>
<PackageId>ApplicationDatabase</PackageId>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Table Include="Tables/**/*.sql" />
<Index Include="Indexes/**/*.sql" />
<View Include="Views/**/*.sql" />
<Trigger Include="Triggers/**/*.sql" />
</ItemGroup>
<Target>
<Comparison>
<Ignore Type="table" Name="application_metadata" />
</Comparison>
<Plan AllowCreate="true" AllowAlter="true" AllowDrop="false" />
<Apply UseTransaction="true" StopOnDataLossRisk="true" />
</Target>
</D1Pac>
Properties
PackageId: artifact name when the output is a directory.Version: application-controlled schema package version.ProjectVersion: d1pac project format version.
Items
Table,Index,View, andTriggeraccept doublestar glob patterns.- Files must have a
.sqlextension. - Tables are compiled before indexes, views, and triggers, independently of XML declaration order.
Each file can contain multiple statements. Desired inputs should contain DDL, not data changes.
Target
Comparison/Ignoreexcludes a namedtable,index,view,trigger, or all types withType="*".AllowCreate,AllowAlter, andAllowDropcontrol which plan operations are executable.UseTransactionapplies the plan as one D1 query batch when enabled.StopOnDataLossRiskrecords the project's safety intent; destructive operations always require explicit drop authorization.
SQLite names beginning with sqlite_ or _cf_, plus d1_migrations, are
always ignored.