Skip to content

Commit eff517d

Browse files
committed
comments mod and unit tests completed
1 parent 739a31c commit eff517d

9 files changed

Lines changed: 327 additions & 96 deletions

File tree

Cargo.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ description = "A crate for parsing comments from sql files and using them for do
66
license = "GNU General Public License v3.0"
77
repository = "https://github.com/rpg-alex/sql-docs"
88
keywords = [
9-
"sql",
10-
"documentation",
11-
"parser",
12-
"sqlparser",
13-
"filesystem",
14-
"cli",
15-
"schema",
16-
"introspection",
17-
"codegen",
18-
"migrations",
9+
"sql",
10+
"documentation",
11+
"parser",
12+
"sqlparser",
13+
"filesystem",
14+
"cli",
15+
"schema",
16+
"introspection",
17+
"codegen",
18+
"migrations",
1919
]
2020

2121
categories = [
22-
"database",
23-
"development-tools",
24-
"parser-implementations",
25-
"text-processing",
26-
"filesystem",
22+
"database",
23+
"development-tools",
24+
"parser-implementations",
25+
"text-processing",
26+
"filesystem",
2727
]
2828

2929

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ force_multiline_blocks = true
1414
fn_single_line = false
1515
where_single_line = false
1616
format_strings = true
17-
reorder_impl_items = true
17+
reorder_impl_items = true

sql_files/with_mixed_comments.sql

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* Users table stores user account information */
2+
CREATE TABLE users (
3+
-- Primary key
4+
id INTEGER PRIMARY KEY,
5+
/* Username for login */
6+
username VARCHAR(255) NOT NULL,
7+
-- Email address
8+
email VARCHAR(255) UNIQUE NOT NULL,
9+
/* When the user registered */
10+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
11+
);
12+
13+
/* Posts table stores blog posts */
14+
CREATE TABLE posts (
15+
-- Primary key
16+
id INTEGER PRIMARY KEY,
17+
/* Post title */
18+
title VARCHAR(255) NOT NULL,
19+
-- Foreign key linking to users
20+
user_id INTEGER NOT NULL,
21+
/* Main body text */
22+
body TEXT NOT NULL,
23+
-- When the post was created
24+
published_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
25+
);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* Users table stores user account information
2+
multiline */
3+
CREATE TABLE users (
4+
/* Primary key
5+
multiline */
6+
id INTEGER PRIMARY KEY,
7+
/* Username for login
8+
multiline */
9+
username VARCHAR(255) NOT NULL,
10+
/* Email address
11+
multiline */
12+
email VARCHAR(255) UNIQUE NOT NULL,
13+
/* When the user registered
14+
multiline */
15+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
16+
);
17+
18+
/* Posts table stores blog posts
19+
multiline */
20+
CREATE TABLE posts (
21+
/* Primary key
22+
multiline */
23+
id INTEGER PRIMARY KEY,
24+
/* Post title
25+
multiline */
26+
title VARCHAR(255) NOT NULL,
27+
/* Foreign key linking to users
28+
multiline */
29+
user_id INTEGER NOT NULL,
30+
/* Main body text
31+
multiline */
32+
body TEXT NOT NULL,
33+
/* When the post was created
34+
multiline */
35+
published_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
36+
);

0 commit comments

Comments
 (0)