Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
e985120
feat: add comma expression node
hdnax Jan 13, 2026
f771a01
feat: add comma expression node to markInvalid
hdnax Jan 13, 2026
3ad42dd
feat: support parsing comma expression
hdnax Jan 13, 2026
ba27577
test: update comments
hdnax Jan 14, 2026
3397ebe
feat: add Records element kind
hdnax Jan 14, 2026
fa71ed8
feat: init Records validator and binder
hdnax Jan 14, 2026
14920d0
feat: implement records validator
hdnax Jan 14, 2026
efacde5
feat: implement records binder
hdnax Jan 14, 2026
633536a
feat: init RecordsChecker
hdnax Jan 14, 2026
1c827df
feat: support scientific notation
hdnax Jan 14, 2026
5c36d85
feat: basic interpretation of records & type checking
hdnax Jan 14, 2026
ab4b73f
feat: add suggestions for records and enum in records fields
hdnax Jan 15, 2026
62b06b0
feat: add suggestions for records
hdnax Jan 15, 2026
bb7562d
fix: disallow spaces between callee and args in call expressions & pr…
hdnax Jan 15, 2026
cbc61e2
fix: update some tests & fix some suggestion services
hdnax Jan 15, 2026
2b9d8b1
test: cover more cases related to records
hdnax Jan 15, 2026
f8cd429
refactor: use ElementKind.Records for more robust comparison
hdnax Jan 15, 2026
a075d0d
feat: allow non-null column to have null if there is increment
hdnax Jan 15, 2026
15d9a4a
fix: handle mixed records and records inside tables
hdnax Jan 15, 2026
8954949
feat: make datetime error message clearer
hdnax Jan 15, 2026
305ce88
feat: add option to expand all columns
hdnax Jan 15, 2026
f903761
fix: fail to expand * in Records tuple nested in table
hdnax Jan 15, 2026
18f8015
feat: add basic hover provider
hdnax Jan 15, 2026
311f758
fix: enhance error message and fk violation detection when the target…
hdnax Jan 15, 2026
c937235
fix: remove unnecessary comments
hdnax Jan 15, 2026
ddfb6a6
Revert "feat: add basic hover provider"
hdnax Jan 15, 2026
7f142df
fix: remove unused getRefRelation
hdnax Jan 16, 2026
cdae2eb
fix: simplify default handling
hdnax Jan 16, 2026
52c9b57
doc: refactor comments of fk validator
hdnax Jan 16, 2026
96ccecc
refactor: simplify
hdnax Jan 16, 2026
e954c7d
refactor: DbmlExporter logic for sample data
hdnax Jan 16, 2026
53bc94e
refactor: simplify sample data handling
hdnax Jan 16, 2026
8fdd3fc
fix: remove is_expression from RecordValue
hdnax Jan 16, 2026
954d832
feat: add insert statement handling to snowflake parser
hdnax Jan 16, 2026
1cb9a5e
feat: disallow duplicate column in records
hdnax Jan 16, 2026
ac03362
feat: add string to string types
hdnax Jan 16, 2026
1895932
feat: add sql exporters for INSERT
hdnax Jan 16, 2026
4943478
fix: disable * suggestion in records that already has some columns
hdnax Jan 16, 2026
0313442
fix: disallow newline in csv
hdnax Jan 16, 2026
82fca97
test: update errorneous tests
hdnax Jan 16, 2026
8e5b4fe
fix: infinite loop in comma expression parsing
hdnax Jan 16, 2026
4e7265f
refactor: use @dbml/parse utils for value formatter in dbml exporter
hdnax Jan 16, 2026
096a62e
fix: make @dbml/parse Database compatible with @dbml/core RawDatabase
hdnax Jan 16, 2026
54919c3
chore: lint and rename
hdnax Jan 18, 2026
e3f1b74
test: update snapshots
hdnax Jan 18, 2026
764c300
chore: lint issues
hdnax Jan 18, 2026
33e4c23
fix: improve unknown columns in records error messages
hdnax Jan 19, 2026
358ffdb
fix: handle record validation using constraints from table partials
hdnax Jan 19, 2026
e6afa22
fix: improve error messages
hdnax Jan 19, 2026
43b57c8
refactor: inline messages.ts into each constraints validator
hdnax Jan 19, 2026
89c7c10
fix: properly handle enum value validation
hdnax Jan 19, 2026
0167695
feat: validate type params
hdnax Jan 19, 2026
07f0202
feat: add snippet for records and correctly validate string length us…
hdnax Jan 19, 2026
df2c600
chore: lint issues
hdnax Jan 19, 2026
59327dd
feat: convert records validation errors to warning
hdnax Jan 19, 2026
9a59c69
feat: add Diagnostics provider
hdnax Jan 19, 2026
9d7c550
doc: remove outdated comment
hdnax Jan 19, 2026
64d6c16
test: update test expectations
hdnax Jan 20, 2026
c12901c
fix: revert add snippets
hdnax Jan 20, 2026
af8982a
fix: handle newlines in records
hdnax Jan 20, 2026
953afdf
fix: handle backslash in dbml/exporter
hdnax Jan 20, 2026
3807405
test: add more tests for sample data export and import
hdnax Jan 20, 2026
b300862
fix: make dbml exporter value extraction more robust
hdnax Jan 20, 2026
e4ca79e
feat: add snippet for record entries
hdnax Jan 20, 2026
f7e40fd
fix: improve inline completion provider
hdnax Jan 21, 2026
0b952c7
fix: only trigger inline completion for records on empty line
hdnax Jan 21, 2026
84cde3a
fix: fallback values for data type mismatches
hdnax Jan 21, 2026
1269611
fix: resolve enum in table partial column type
hdnax Jan 21, 2026
b38b604
fix: export record value type
hdnax Jan 21, 2026
6faac98
feat: separate warnings for composite constraints violation
hdnax Jan 21, 2026
5e2d262
fix: do away with inline completion
hdnax Jan 21, 2026
149ca6d
chore: comment out global.browser
hdnax Jan 22, 2026
776b15c
feat: export the value formatter
hdnax Jan 22, 2026
9e67d53
test: lint fix
hdnax Jan 22, 2026
a33599b
feat: enhance sql type and value detection and extraction
hdnax Jan 22, 2026
a8e89ce
feat: export type validation and extraction in dbml/core
hdnax Jan 22, 2026
fdb3d3f
feat: add tryExtractInteger
hdnax Jan 22, 2026
f532bb4
feat: add utils to split qualified identifiers and escape and unescap…
hdnax Jan 22, 2026
f77c806
feat: add utils to modify records in source code
hdnax Jan 22, 2026
a89e18f
feat: support string[][] in records queries
hdnax Jan 22, 2026
cadd5d2
feat: export add double quote if needed
hdnax Jan 22, 2026
281e11b
fix: signature of compiler record queries
hdnax Jan 22, 2026
5383476
fix: handle null in normalizeRecordValue
hdnax Jan 22, 2026
ae98fb7
fix: deduplicate RecordValue type & update type signature of record q…
hdnax Jan 22, 2026
69b5be2
feat: add wrapper around compiler record queries
hdnax Jan 22, 2026
6f3d09c
feat: handle other primitive types as well
hdnax Jan 22, 2026
b70c666
fix: type definitions
hdnax Jan 22, 2026
18c6d7c
fix: incorrectly handle partial table injected snippets
hdnax Jan 23, 2026
3a49dad
chore: remove duplicate formatDbmlRecordValue
hdnax Jan 25, 2026
32e6d9d
fix: RecordValue type definition of @dbml/core
hdnax Jan 25, 2026
c967ea4
Revert "fix: type definitions"
hdnax Jan 25, 2026
4ce13c7
fix: revert reuse of SqlDialect in @dbml/core type definition
hdnax Jan 25, 2026
f0eef2b
test: merge record tests
hdnax Jan 25, 2026
21f5618
test: prevent warnings to break snapshots
hdnax Jan 25, 2026
efd3ecc
test: prevent unused fields in column types from breaking snapshots
hdnax Jan 25, 2026
5f42768
fix: remove unused type definitions in services
hdnax Jan 25, 2026
07cb968
doc: fix comment
hdnax Jan 25, 2026
bcff8f2
fix: avoid breaking changes related to call expression
hdnax Jan 25, 2026
ba69511
fix: extract to a proper warning type
hdnax Jan 25, 2026
9f5918e
fix: remove diagnostic provider readme
hdnax Jan 25, 2026
f1694c0
fix: remove unused RefRelation enum
hdnax Jan 25, 2026
04e19ab
test: update call_expression snapshot tests
hdnax Jan 25, 2026
9aa84ab
feat: normalize datetime values into ISO 8601 with special cases for …
hdnax Jan 26, 2026
128ae4c
chore: remove unused records queries
hdnax Jan 26, 2026
1b3ba5b
doc: remove wrong comment
hdnax Jan 26, 2026
6e81567
refactor: simplify enum membership check
hdnax Jan 26, 2026
0661a78
fix: migrate @dbml/core to use addDoubleQuoteIfNeeded
hdnax Jan 26, 2026
23bed63
fix: rename hasNullInKey to hasNullWithoutDefaultInKey for clarity & …
hdnax Jan 26, 2026
d0e939c
doc: add a comment TODO for FKs on increment fields
hdnax Jan 26, 2026
f66c732
fix: use a compatible Diagnostic interface in diagnostic provider
hdnax Jan 26, 2026
44a76cd
fix: remove some useless user-facing comments
hdnax Jan 26, 2026
a96328e
fix: remove unnecessary fields in interpreted table partials
hdnax Jan 26, 2026
d6bac12
fix: try to extract string before getNodeSourceText
hdnax Jan 27, 2026
8044445
feat: support primitive types in formatRecordValue
hdnax Jan 27, 2026
aedd305
test: update @dbml/core tests
hdnax Jan 27, 2026
cd6a450
fix: prevent breaking changes related to call expression handling & d…
hdnax Jan 27, 2026
8a71ddc
test: datetime interpretation fail due to changing times
hdnax Jan 27, 2026
d553330
refactor: remove unused excludeSuggestions
hdnax Jan 27, 2026
b44ffc5
doc: add comment for getTableAndColumnsOfRecords
hdnax Jan 27, 2026
a3ce937
refactor: simplify diagnostics provider
hdnax Jan 27, 2026
b1e20be
fix: make addExpandAllColumnsSuggestion more general
hdnax Jan 27, 2026
daf3f0b
refactor: rename getSource to getNodeOrTokenSource for more clarity
hdnax Jan 27, 2026
0dad5c2
refactor: simplify extractColumnNameAndType
hdnax Jan 27, 2026
6b20ed8
fix: do not merge records for a table
hdnax Jan 27, 2026
28f7249
fix: typescript errors
hdnax Jan 27, 2026
3350ac8
test: update tests to use luxon for time comparison
hdnax Jan 27, 2026
0c1ade1
feat: support more time formats
hdnax Jan 27, 2026
1b7c958
test: update tests
hdnax Jan 27, 2026
e4c1428
refactor: DiagnosticsProvider documentation and proper typing
hdnax Jan 28, 2026
d4b8d6b
refactor: remove unused generateRecordEntrySnippet
hdnax Jan 28, 2026
766c86f
refactor: simplify the records row snippet helper
hdnax Jan 28, 2026
06e23be
refactor: rename extractColumnNameAndType to extractNameAndTypeOfColu…
hdnax Jan 28, 2026
d0d6a6c
refactor: make early return on the same line as condition in suggesti…
hdnax Jan 28, 2026
e8478de
test: update tests
hdnax Jan 28, 2026
9175666
refactor: extract out function to suggest in element header
hdnax Jan 28, 2026
17ebe61
refactor: merge Records keyword suggestion to other keywords suggestions
hdnax Jan 28, 2026
ae1f1f0
refactor: use ElementKind.Records instead of records as bare string
hdnax Jan 28, 2026
c4c6c5d
refactor: denest suggestion provider
hdnax Jan 28, 2026
f26447d
refactor: remove duplicate addQuoteIfNeeded
hdnax Jan 28, 2026
71e6be1
fix: require env in processColumnType
hdnax Jan 28, 2026
ec6b856
fix: temporarily disallow multiple records for the same table
hdnax Jan 28, 2026
1ecf862
test: update tests
hdnax Jan 28, 2026
d943893
fix: properly handle implicit column order in records
hdnax Jan 28, 2026
53ceac6
fix: temporarily turn off escape string in table alias export
hdnax Jan 28, 2026
dbefd33
fix: use addDoubleQuoteIfNeeded for records table, schema, column names
hdnax Jan 28, 2026
761f601
refactor: sql exporters
hdnax Jan 28, 2026
586cefb
fix: escape string in addDoubleQuoteIfNeeded
hdnax Jan 28, 2026
ffa1f67
test: update tests
hdnax Jan 28, 2026
b4bf0e5
fix: simplify logic of suggestion provider & fix bug where quotes are…
hdnax Jan 28, 2026
293eefd
fix: unnecessary spreading in suggestTopLevelElementType
hdnax Jan 28, 2026
d784722
fix: unnecessary spreading in suggestInColumn
hdnax Jan 28, 2026
fbbc765
refactor: simplify processColumnType
hdnax Jan 28, 2026
e98df81
fix: simplify logic for pk constraint checker
hdnax Jan 28, 2026
f765254
fix: merge multiple records block into one in dbml exporter
hdnax Jan 28, 2026
69ccc4d
refactor: simplify constraint checker
hdnax Jan 28, 2026
b385132
feat: allow extract other values as strings
hdnax Jan 28, 2026
df7ecfb
test: add more tests for merging records
hdnax Jan 28, 2026
8754fd7
fix: type error in tryExtractString
hdnax Jan 28, 2026
0657f22
doc: add dbml-homepage section for data sample
hdnax Jan 28, 2026
6f14f66
Revert "refactor: simplify constraint checker"
hdnax Jan 28, 2026
6d3bfbe
doc: remove non-existent section in toc
hdnax Jan 28, 2026
cd37179
refactor: simplify dbml exporter export records
hdnax Jan 28, 2026
9f53443
refactor: simplify constraint checker
hdnax Jan 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 222 additions & 0 deletions dbml-homepage/docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ outlines the full syntax documentations of DBML.
- [TableGroup Notes](#tablegroup-notes-1)
- [TableGroup Settings](#tablegroup-settings)
- [TablePartial](#tablepartial)
- [Data Sample](#data-sample)
- [Explicit Column List](#explicit-column-list)
- [Implicit Column List](#implicit-column-list)
- [Data Types](#data-types)
- [Multi-line String](#multi-line-string)
- [Comments](#comments)
- [Syntax Consistency](#syntax-consistency)
Expand Down Expand Up @@ -658,6 +662,224 @@ When multiple partials define the same field, setting or index, DBML resolves co
1. Local Table Definition: Fields, settings and indexes defined directly in the table override those from partials.
2. Last Injected Partial: If a conflict exists between partials, the definition from the last-injected partial (in source order) takes precedence.

## Data Sample

`Records` allow you to define sample data for your tables directly in DBML. This is useful for documentation, testing, and providing example data for your database schema.

Records can be defined either outside or inside a table definition.

```text
// Outside table definition
Table users {
id int [pk]
name varchar
email varchar
}

records users(id, name, email) {
1, 'Alice', 'alice@example.com'
2, 'Bob', 'bob@example.com'
}

// Inside table definition
Table posts {
id int [pk]
title varchar
published boolean

records (id, title, published) {
1, 'First Post', true
2, 'Second Post', false
}
}
```

:::note
Each table can have only one records block. You cannot define duplicate records block for the same table.
:::

### Explicit Column List

You can specify which columns to populate by listing them in parentheses. This works for both inside and outside table records.

```text
Table users {
id int [pk]
name varchar
email varchar
created_at timestamp
}

// Only populate id and name, other columns will use default values or NULL
records users(id, name) {
1, 'Alice'
2, 'Bob'
3, 'Charlie'
}
```

### Implicit Column List

When the column list is omitted, records will automatically use all table columns in their definition order. **Implicit column lists are only supported for records defined inside a table.**

```text
Table users {
id int [pk]
name varchar
active boolean

// Implicitly uses all columns in order: id, name, active
records {
1, 'Alice', true
2, 'Bob', false
}
}
```

:::tip
When using implicit columns with tables that inject partials using `~partial_name`, the column order follows the same precedence rules as [TablePartial](#tablepartial) injection.
:::

**Column Order with Table Partials**

When a table injects partials, the final column order for implicit records is determined by:

1. Fields from injected partials appear in their injection order
2. Local table fields appear in their definition order
3. Later partial injections override earlier ones for duplicate fields

Example,

```text
TablePartial base_template {
id int [pk]
created_at timestamp
}

TablePartial metadata {
updated_at timestamp
}

Table users {
~base_template // id, created_at injected first
name varchar // local field
email varchar // local field
~metadata // updated_at injected last

// Implicit column order: id, created_at, name, email, updated_at
records {
1, '2024-01-15 10:00:00', 'Alice', 'alice@example.com', '2024-01-15 10:00:00'
2, '2024-01-16 11:00:00', 'Bob', 'bob@example.com', '2024-01-16 11:00:00'
}
}
```

### Data Types

Records use CSV-style syntax. Each value is interpreted and type-checked according to the target column's SQL type.

**Strings**

Wrapped in single quotes. Escape single quotes using `\'`.

```text
'Hello World'
'Escape\'s sequence'
```

**Numbers**

Integer or decimal values with or without quotes.

```text
42
3.14
-100
1.5e10
```

**Booleans**

Use `true` or `false` literals, or various boolean-like representations:

```text
true, false // Boolean literals (case-insensitive)
'Y', 'N' // Yes/No (case-insensitive)
'T', 'F' // True/False (case-insensitive)
'TRUE', 'FALSE' // String forms (case-insensitive)
1, 0 // Numeric forms
'1', '0'
```

**Null Values**

Multiple ways to represent NULL:

```text
null // Explicit NULL literal
'' // Empty string (for non-string types)
// Empty field between commas
```

Example,

```text
Table users {
id int
name varchar
age int
}

records users(id, name, age) {
1, 'Alice', null // explicit NULL
2, 'Bob', '' // empty string treated as NULL
3, , 25 // empty field treated as NULL
}
```

**Timestamps/Dates**

Wrapped in single quotes. Supports ISO 8601 and other sensible formats.

```text
'2024-01-15 10:30:00'
'2024-01-15T10:30:00.000+07:00'
'2024-01-15'
'10:30:00'
```

**Enum Values**

Reference enum members using the enum constant or string literal:

```text
enum Status {
active
inactive
pending
}

Table orders {
id int
status Status
}

records orders(id, status) {
1, Status.active // Using enum constant
2, 'inactive' // Using string literal
}
```

**Expressions**

Wrapped in backticks for database functions and expressions. When using expressions, static type checking is disabled for that value.

```text
`now()`
`uuid_generate_v4()`
`1 + 2 * 3`
```

## Multi-line String

Multiline string will be defined between triple single quote `'''`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ describe('@dbml/core - exporter', () => {
const output = readFileSync(path.resolve(__dirname, `./${testDir}/output/${fileName}.out.${fileExtension}`), { encoding: 'utf8' });
const res = exporter.export(input, format);

expect(res).toBe(output);
// Exclude meaningless spaces from failing the tests
expect(res.trim()).toBe(output.trim());
};

test.each(scanTestNames(__dirname, 'mysql_exporter/input'))('mysql_exporter/%s', (name) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Table users {
id integer [pk]
name varchar
email varchar
active boolean
created_at timestamp
}

Table posts {
id integer [pk]
user_id integer
title varchar
content text
}

Ref: users.id < posts.user_id

Records users(id, name, email, active, created_at) {
1, "Alice", "alice@example.com", true, "2024-01-15 10:30:00+07:00"
2, "Bob", "bob@example.com", false, "2024-01-16 14:20:00+07:00"
3, "Charlie", null, true, "2024-01-17 09:15:00+07:00"
}

Records posts(id, user_id, title, content) {
1, 1, "First Post", "Hello World"
2, 1, "Second Post", "It's a beautiful day"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
CREATE TABLE [users] (
[id] integer PRIMARY KEY,
[name] nvarchar(255),
[email] nvarchar(255),
[active] boolean,
[created_at] timestamp
)
GO

CREATE TABLE [posts] (
[id] integer PRIMARY KEY,
[user_id] integer,
[title] nvarchar(255),
[content] text
)
GO

ALTER TABLE [posts] ADD FOREIGN KEY ([user_id]) REFERENCES [users] ([id])
GO

-- Disable constraint checks for INSERT
EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all";
GO

INSERT INTO [users] ([id], [name], [email], [active], [created_at])
VALUES
(1, 'Alice', 'alice@example.com', 1, '2024-01-15 10:30:00+07:00'),
(2, 'Bob', 'bob@example.com', 1, '2024-01-16 14:20:00+07:00'),
(3, 'Charlie', NULL, 1, '2024-01-17 09:15:00+07:00');
GO
INSERT INTO [posts] ([id], [user_id], [title], [content])
VALUES
(1, 1, 'First Post', 'Hello World'),
(2, 1, 'Second Post', 'It''s a beautiful day');
GO

-- Re-enable constraint checks
EXEC sp_MSforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all";
GO
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Table users {
id integer [pk]
name varchar
email varchar
active boolean
created_at timestamp
}

Table posts {
id integer [pk]
user_id integer
title varchar
content text
}

Ref: users.id < posts.user_id

Records users(id, name, email, active, created_at) {
1, "Alice", "alice@example.com", true, "2024-01-15 10:30:00+07:00"
2, "Bob", "bob@example.com", false, "2024-01-16 14:20:00+07:00"
3, "Charlie", null, true, "2024-01-17 09:15:00+07:00"
}

Records posts(id, user_id, title, content) {
1, 1, "First Post", "Hello World"
2, 1, "Second Post", "It's a beautiful day"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Table edge_cases {
id integer [pk]
scientific_notation_pos float
scientific_notation_neg float
signed_positive integer
signed_negative integer
sql_function_default varchar
dbml_expr_default integer
datetime_value timestamp
string_with_newline text
string_with_backslash varchar
string_with_escape_seq varchar
string_with_quotes varchar
null_value varchar
}

Records edge_cases(id, scientific_notation_pos, scientific_notation_neg, signed_positive, signed_negative, sql_function_default, dbml_expr_default, datetime_value, string_with_newline, string_with_backslash, string_with_escape_seq, string_with_quotes, null_value) {
1, 1.23e5, -4.56e-3, +42, -100, `NOW()`, `1 + 2 * 3`, "2024-01-15 10:30:00.123456+07:00", "Line 1\nLine 2\nLine 3", "C:\\Users\\path\\file.txt", "Tab:\tNewline:\nCarriage return:\r", "She said \"Hello\" and 'Hi'", null
2, 9.99e10, -1.11e-10, +0, -0, `CURRENT_TIMESTAMP`, `LENGTH('test')`, "2023-12-31 23:59:59+07:00", "First line\n\nThird line", "Escaped backslash: \\\\", "Quote: \" Apostrophe: ' Backslash: \\", "O'Reilly's \"book\"", null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
CREATE TABLE `users` (
`id` integer PRIMARY KEY,
`name` varchar(255),
`email` varchar(255),
`active` boolean,
`created_at` timestamp
);

CREATE TABLE `posts` (
`id` integer PRIMARY KEY,
`user_id` integer,
`title` varchar(255),
`content` text
);

ALTER TABLE `posts` ADD FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

-- Disable foreign key checks for INSERT
SET FOREIGN_KEY_CHECKS = 0;

INSERT INTO `users` (`id`, `name`, `email`, `active`, `created_at`)
VALUES
(1, 'Alice', 'alice@example.com', TRUE, '2024-01-15 10:30:00+07:00'),
(2, 'Bob', 'bob@example.com', FALSE, '2024-01-16 14:20:00+07:00'),
(3, 'Charlie', NULL, TRUE, '2024-01-17 09:15:00+07:00');
INSERT INTO `posts` (`id`, `user_id`, `title`, `content`)
VALUES
(1, 1, 'First Post', 'Hello World'),
(2, 1, 'Second Post', 'It''s a beautiful day');

-- Re-enable foreign key checks
SET FOREIGN_KEY_CHECKS = 1;
Loading
Loading