CREATE TABLE and column declarations
CREATE-time primary/foreign keys are routed through KEY-001/KEY-002 once M2 lands; M1 accepts unconstrained tables and NOT NULL declarations.
Contract
| Field | Value |
|---|---|
| Specification | TABLE-001 |
| Module | sql |
| Scope | Required implementation or delivery |
| Milestone | M1, due 2026-12-06 |
| Owner role | SQL / frontend — teammate to claim |
| Implementation | Planned; scaffold only |
| Contract review | Team review required before implementation |
Interface
Catalog.createTable(name, Schema, constraints)
These are proposed C++ design contracts, not an already implemented API. Shared types and ownership define the intended module boundaries.
Dependencies
- DB-002: USE database
- STORE-003: Row encoding and table-page slot layout
- PARSE-001: Parser integration for required SQL grammar
Acceptance checklist
- [ ] Create INT/FLOAT/VARCHAR(n), NOT NULL and DEFAULT metadata
- [ ] Validate repeated column names, lengths and declared key columns
- [ ] Do not impose a hard 10-column cap; course LINEITEM has 13
Setup data
Run this in a fresh isolated data directory before the example. Setup commands emit their own results; the expected block below covers only the listed input.
CREATE DATABASE demo;
USE demo;
Input
CREATE TABLE people (id INT NOT NULL, name VARCHAR(16) NOT NULL, score FLOAT NOT NULL);
Expected output
@
Where no ORDER BY appears, row order is not guaranteed. Error message text is illustrative; required diagnostic keywords and result framing are binding.
Rejections and state
- Duplicate table/column or invalid type declaration -> !ERROR
Verification
Completion rule
Link this spec and its GitLab issue in an MR into develop. Include relevant Linux evidence, obtain the other teammate’s review, merge, delete the feature branch, and close the issue. A page describes intended behavior; the GitLab issue and merged code determine completion.