Skip to content

Commit 423ff53

Browse files
committed
Use mysql temporary tables for doc tests
1 parent e0d69d9 commit 423ff53

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/doctest_setup.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,31 +106,31 @@ cfg_if::cfg_if! {
106106
}
107107

108108
async fn create_tables(connection: &mut AsyncMysqlConnection) {
109-
diesel::sql_query("CREATE TABLE IF NOT EXISTS users (
109+
diesel::sql_query("CREATE TEMPORARY TABLE IF NOT EXISTS users (
110110
id INTEGER PRIMARY KEY AUTO_INCREMENT,
111111
name TEXT NOT NULL
112112
) CHARACTER SET utf8mb4").execute(connection).await.unwrap();
113113

114114

115-
diesel::sql_query("CREATE TABLE IF NOT EXISTS animals (
115+
diesel::sql_query("CREATE TEMPORARY TABLE IF NOT EXISTS animals (
116116
id INTEGER PRIMARY KEY AUTO_INCREMENT,
117117
species TEXT NOT NULL,
118118
legs INTEGER NOT NULL,
119119
name TEXT
120120
) CHARACTER SET utf8mb4").execute(connection).await.unwrap();
121121

122-
diesel::sql_query("CREATE TABLE IF NOT EXISTS posts (
122+
diesel::sql_query("CREATE TEMPORARY TABLE IF NOT EXISTS posts (
123123
id INTEGER PRIMARY KEY AUTO_INCREMENT,
124124
user_id INTEGER NOT NULL,
125125
title TEXT NOT NULL
126126
) CHARACTER SET utf8mb4").execute(connection).await.unwrap();
127127

128-
diesel::sql_query("CREATE TABLE IF NOT EXISTS comments (
128+
diesel::sql_query("CREATE TEMPORARY TABLE IF NOT EXISTS comments (
129129
id INTEGER PRIMARY KEY AUTO_INCREMENT,
130130
post_id INTEGER NOT NULL,
131131
body TEXT NOT NULL
132132
) CHARACTER SET utf8mb4").execute(connection).await.unwrap();
133-
diesel::sql_query("CREATE TABLE IF NOT EXISTS brands (
133+
diesel::sql_query("CREATE TEMPORARY TABLE IF NOT EXISTS brands (
134134
id INTEGER PRIMARY KEY AUTO_INCREMENT,
135135
color VARCHAR(255) NOT NULL DEFAULT 'Green',
136136
accent VARCHAR(255) DEFAULT 'Blue'

0 commit comments

Comments
 (0)