@@ -92,14 +92,22 @@ More info can be found in [here](https://docs.sqlc.dev/en/stable/reference/query
92
92
93
93
More info can be found in [here](https://docs.sqlc.dev/en/stable/reference/macros.html#macros).
94
94
# PostgresSQL
95
- # # :execlastid - Implementation
95
+ <details>
96
+ <summary>:execlastid - Implementation</summary>
97
+
96
98
Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id, which can be of any
97
99
data type that can have a unique constraint.
100
+ </details>
101
+
102
+ <details>
103
+ <summary>:copyfrom - Implementation</summary>
98
104
99
- # # :copyfrom - Implementation
100
105
Implemented via the `COPY FROM` command which can load binary data directly from `stdin`.
106
+ </details>
107
+
108
+ <details>
109
+ <summary>Supported Data Types</summary>
101
110
102
- # # Data Types
103
111
Since in batch insert the data is not validated by the SQL itself but written in a binary format,
104
112
we consider support for the different data types separately for batch inserts and everything else.
105
113
@@ -141,9 +149,11 @@ we consider support for the different data types separately for batch inserts an
141
149
| json | ❌ | ❌ |
142
150
| jsonb | ❌ | ❌ |
143
151
| jsonpath | ❌ | ❌ |
144
- # MySQL
145
152
146
- # # :execlastid - Implementation
153
+ </details># MySQL
154
+ <details>
155
+ <summary>:execlastid - Implementation</summary>
156
+
147
157
The implementation differs if we're using `Dapper` or not.
148
158
149
159
# ## Driver - MySqlConnector
@@ -165,14 +175,20 @@ appended to the original query like this:
165
175
INSERT INTO tab1 (field1, field2) VALUES ('a', 1);
166
176
SELECT LAST_INSERT_ID();
167
177
` ` `
168
-
169
178
The generated method will return `int` & `long` for `serial` & `bigserial` respectively.
170
179
171
- # # :copyfrom - Implementation
180
+ </details>
181
+
182
+ <details>
183
+ <summary>:copyfrom - Implementation</summary>
172
184
Implemented via the `LOAD DATA` command which can load data from a `CSV` file to a table.
173
185
Requires us to first save the input batch as a CSV, and then load it via the driver.
174
186
175
- # # Data Types
187
+ </details>
188
+
189
+ <details>
190
+ <summary>Supported Data Types</summary>
191
+
176
192
Since in batch insert the data is not validated by the SQL itself but written and read from a CSV,
177
193
we consider support for the different data types separately for batch inserts and everything else.
178
194
@@ -216,7 +232,10 @@ we consider support for the different data types separately for batch inserts an
216
232
| multilinestring | ❌ | ❌ |
217
233
| multipolygon | ❌ | ❌ |
218
234
| geometrycollection | ❌ | ❌ |
219
- # SQLite3
235
+
236
+ </details># SQLite3
237
+ <details>
238
+ <summary>:execlastid - Implementation</summary>
220
239
221
240
# # :execlastid - Implementation
222
241
Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id, which can be of any
@@ -226,7 +245,10 @@ data type that can have a unique constraint.
226
245
INSERT INTO tab1 (field1, field2) VALUES ('a', 1) RETURNING id_field;
227
246
` ` `
228
247
229
- # # :copyfrom - Implementation
248
+ </details>
249
+
250
+ <details>
251
+ <summary>:copyfrom - Implementation</summary>
230
252
Implemented via a multi `VALUES` clause, like this :
231
253
232
254
` ` ` sql
@@ -236,14 +258,19 @@ INSERT INTO tab1 (field1, field2) VALUES
236
258
('c', 3);
237
259
` ` `
238
260
239
- # # Data Types
261
+ </details>
262
+
263
+ <details>
264
+ <summary>Supported Data Types</summary>
240
265
241
266
| DB Type | Supported? |
242
267
|---------|------------|
243
268
| integer | ✅ |
244
269
| real | ✅ |
245
270
| text | ✅ |
246
- | blob | ✅ |# Contributing
271
+ | blob | ✅ |
272
+
273
+ </details># Contributing
247
274
# # Local plugin development
248
275
# ## Prerequisites
249
276
Make sure that the following applications are installed and added to your path.
0 commit comments