@@ -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,13 @@ we consider support for the different data types separately for batch inserts an
141
149
| json | ❌ | ❌ |
142
150
| jsonb | ❌ | ❌ |
143
151
| jsonpath | ❌ | ❌ |
152
+
153
+ </details>
154
+
144
155
# MySQL
156
+ <details>
157
+ <summary>:execlastid - Implementation</summary>
145
158
146
- # # :execlastid - Implementation
147
159
The implementation differs if we're using `Dapper` or not.
148
160
149
161
# ## Driver - MySqlConnector
@@ -165,14 +177,20 @@ appended to the original query like this:
165
177
INSERT INTO tab1 (field1, field2) VALUES ('a', 1);
166
178
SELECT LAST_INSERT_ID();
167
179
` ` `
168
-
169
180
The generated method will return `int` & `long` for `serial` & `bigserial` respectively.
170
181
171
- # # :copyfrom - Implementation
182
+ </details>
183
+
184
+ <details>
185
+ <summary>:copyfrom - Implementation</summary>
172
186
Implemented via the `LOAD DATA` command which can load data from a `CSV` file to a table.
173
187
Requires us to first save the input batch as a CSV, and then load it via the driver.
174
188
175
- # # Data Types
189
+ </details>
190
+
191
+ <details>
192
+ <summary>Supported Data Types</summary>
193
+
176
194
Since in batch insert the data is not validated by the SQL itself but written and read from a CSV,
177
195
we consider support for the different data types separately for batch inserts and everything else.
178
196
@@ -216,7 +234,12 @@ we consider support for the different data types separately for batch inserts an
216
234
| multilinestring | ❌ | ❌ |
217
235
| multipolygon | ❌ | ❌ |
218
236
| geometrycollection | ❌ | ❌ |
237
+
238
+ </details>
239
+
219
240
# SQLite3
241
+ <details>
242
+ <summary>:execlastid - Implementation</summary>
220
243
221
244
# # :execlastid - Implementation
222
245
Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id, which can be of any
@@ -226,7 +249,10 @@ data type that can have a unique constraint.
226
249
INSERT INTO tab1 (field1, field2) VALUES ('a', 1) RETURNING id_field;
227
250
` ` `
228
251
229
- # # :copyfrom - Implementation
252
+ </details>
253
+
254
+ <details>
255
+ <summary>:copyfrom - Implementation</summary>
230
256
Implemented via a multi `VALUES` clause, like this :
231
257
232
258
` ` ` sql
@@ -236,14 +262,21 @@ INSERT INTO tab1 (field1, field2) VALUES
236
262
('c', 3);
237
263
` ` `
238
264
239
- # # Data Types
265
+ </details>
266
+
267
+ <details>
268
+ <summary>Supported Data Types</summary>
240
269
241
270
| DB Type | Supported? |
242
271
|---------|------------|
243
272
| integer | ✅ |
244
273
| real | ✅ |
245
274
| text | ✅ |
246
- | blob | ✅ |# Contributing
275
+ | blob | ✅ |
276
+
277
+ </details>
278
+
279
+ # Contributing
247
280
# # Local plugin development
248
281
# ## Prerequisites
249
282
Make sure that the following applications are installed and added to your path.
@@ -286,135 +319,171 @@ By default, the release script will bump the patch version. Adding `[release]` t
286
319
### Release structure
287
320
The new created tag will create a draft release with it, in the release there will be the wasm plugin embedded in the release. <br/>
288
321
# Examples
289
- ## Engine `postgresql`: [NpgsqlExample](examples/NpgsqlExample)
322
+ <details>
323
+ <summary>Npgsql</summary>
290
324
325
+ ## Engine `postgresql`: [NpgsqlExample](examples/NpgsqlExample)
291
326
### [Schema](examples/config/postgresql/schema.sql) | [Queries](examples/config/postgresql/query.sql) | [End2End Test](end2end/EndToEndTests/NpgsqlTester.cs)
292
-
293
327
### Config
294
328
```yaml
295
329
useDapper: false
296
330
targetFramework: net8.0
297
331
generateCsproj: true
298
332
namespaceName: NpgsqlExampleGen
299
- ```
300
- ## Engine ` postgresql ` : [ NpgsqlDapperExample] ( examples/NpgsqlDapperExample )
333
+ ```
301
334
302
- ### [ Schema] ( examples/config/postgresql/schema.sql ) | [ Queries] ( examples/config/postgresql/query.sql ) | [ End2End Test] ( end2end/EndToEndTests/NpgsqlDapperTester.cs )
335
+ </details >
336
+ <details >
337
+ <summary >NpgsqlDapper</summary >
303
338
339
+ ## Engine ` postgresql ` : [ NpgsqlDapperExample] ( examples/NpgsqlDapperExample )
340
+ ### [ Schema] ( examples/config/postgresql/schema.sql ) | [ Queries] ( examples/config/postgresql/query.sql ) | [ End2End Test] ( end2end/EndToEndTests/NpgsqlDapperTester.cs )
304
341
### Config
305
342
``` yaml
306
343
useDapper : true
307
344
targetFramework : net8.0
308
345
generateCsproj : true
309
346
namespaceName : NpgsqlDapperExampleGen
310
- ` ` `
311
- ## Engine ` postgresql`: [NpgsqlLegacyExample](examples/NpgsqlLegacyExample)
347
+ ` ` `
312
348
313
- # ## [Schema](examples/config/postgresql/schema.sql) | [Queries](examples/config/postgresql/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/NpgsqlTester.cs)
349
+ </details>
350
+ <details>
351
+ <summary>NpgsqlLegacy</summary>
314
352
353
+ ## Engine ` postgresql`: [NpgsqlLegacyExample](examples/NpgsqlLegacyExample)
354
+ # ## [Schema](examples/config/postgresql/schema.sql) | [Queries](examples/config/postgresql/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/NpgsqlTester.cs)
315
355
# ## Config
316
356
` ` ` yaml
317
357
useDapper: false
318
358
targetFramework: netstandard2.0
319
359
generateCsproj: true
320
360
namespaceName: NpgsqlLegacyExampleGen
321
- ` ` `
322
- # # Engine `postgresql`: [NpgsqlDapperLegacyExample](examples/NpgsqlDapperLegacyExample)
361
+ ` ` `
323
362
324
- # ## [Schema](examples/config/postgresql/schema.sql) | [Queries](examples/config/postgresql/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/NpgsqlDapperTester.cs)
363
+ </details>
364
+ <details>
365
+ <summary>NpgsqlDapperLegacy</summary>
325
366
367
+ # # Engine `postgresql`: [NpgsqlDapperLegacyExample](examples/NpgsqlDapperLegacyExample)
368
+ # ## [Schema](examples/config/postgresql/schema.sql) | [Queries](examples/config/postgresql/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/NpgsqlDapperTester.cs)
326
369
# ## Config
327
370
` ` ` yaml
328
371
useDapper: true
329
372
targetFramework: netstandard2.0
330
373
generateCsproj: true
331
374
namespaceName: NpgsqlDapperLegacyExampleGen
332
- ` ` `
333
- # # Engine `mysql`: [MySqlConnectorExample](examples/MySqlConnectorExample)
375
+ ` ` `
334
376
335
- # ## [Schema](examples/config/mysql/schema.sql) | [Queries](examples/config/mysql/query.sql) | [End2End Test](end2end/EndToEndTests/MySqlConnectorTester.cs)
377
+ </details>
378
+ <details>
379
+ <summary>MySqlConnector</summary>
336
380
381
+ # # Engine `mysql`: [MySqlConnectorExample](examples/MySqlConnectorExample)
382
+ # ## [Schema](examples/config/mysql/schema.sql) | [Queries](examples/config/mysql/query.sql) | [End2End Test](end2end/EndToEndTests/MySqlConnectorTester.cs)
337
383
# ## Config
338
384
` ` ` yaml
339
385
useDapper: false
340
386
targetFramework: net8.0
341
387
generateCsproj: true
342
388
namespaceName: MySqlConnectorExampleGen
343
- ` ` `
344
- # # Engine `mysql`: [MySqlConnectorDapperExample](examples/MySqlConnectorDapperExample)
389
+ ` ` `
345
390
346
- # ## [Schema](examples/config/mysql/schema.sql) | [Queries](examples/config/mysql/query.sql) | [End2End Test](end2end/EndToEndTests/MySqlConnectorDapperTester.cs)
391
+ </details>
392
+ <details>
393
+ <summary>MySqlConnectorDapper</summary>
347
394
395
+ # # Engine `mysql`: [MySqlConnectorDapperExample](examples/MySqlConnectorDapperExample)
396
+ # ## [Schema](examples/config/mysql/schema.sql) | [Queries](examples/config/mysql/query.sql) | [End2End Test](end2end/EndToEndTests/MySqlConnectorDapperTester.cs)
348
397
# ## Config
349
398
` ` ` yaml
350
399
useDapper: true
351
400
targetFramework: net8.0
352
401
generateCsproj: true
353
402
namespaceName: MySqlConnectorDapperExampleGen
354
- ` ` `
355
- # # Engine `mysql`: [MySqlConnectorLegacyExample](examples/MySqlConnectorLegacyExample)
403
+ ` ` `
356
404
357
- # ## [Schema](examples/config/mysql/schema.sql) | [Queries](examples/config/mysql/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/MySqlConnectorTester.cs)
405
+ </details>
406
+ <details>
407
+ <summary>MySqlConnectorLegacy</summary>
358
408
409
+ # # Engine `mysql`: [MySqlConnectorLegacyExample](examples/MySqlConnectorLegacyExample)
410
+ # ## [Schema](examples/config/mysql/schema.sql) | [Queries](examples/config/mysql/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/MySqlConnectorTester.cs)
359
411
# ## Config
360
412
` ` ` yaml
361
413
useDapper: false
362
414
targetFramework: netstandard2.0
363
415
generateCsproj: true
364
416
namespaceName: MySqlConnectorLegacyExampleGen
365
- ` ` `
366
- # # Engine `mysql`: [MySqlConnectorDapperLegacyExample](examples/MySqlConnectorDapperLegacyExample)
417
+ ` ` `
367
418
368
- # ## [Schema](examples/config/mysql/schema.sql) | [Queries](examples/config/mysql/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/MySqlConnectorDapperTester.cs)
419
+ </details>
420
+ <details>
421
+ <summary>MySqlConnectorDapperLegacy</summary>
369
422
423
+ # # Engine `mysql`: [MySqlConnectorDapperLegacyExample](examples/MySqlConnectorDapperLegacyExample)
424
+ # ## [Schema](examples/config/mysql/schema.sql) | [Queries](examples/config/mysql/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/MySqlConnectorDapperTester.cs)
370
425
# ## Config
371
426
` ` ` yaml
372
427
useDapper: true
373
428
targetFramework: netstandard2.0
374
429
generateCsproj: true
375
430
namespaceName: MySqlConnectorDapperLegacyExampleGen
376
- ` ` `
377
- # # Engine `sqlite`: [SqliteExample](examples/SqliteExample)
431
+ ` ` `
378
432
379
- # ## [Schema](examples/config/sqlite/schema.sql) | [Queries](examples/config/sqlite/query.sql) | [End2End Test](end2end/EndToEndTests/SqliteTester.cs)
433
+ </details>
434
+ <details>
435
+ <summary>Sqlite</summary>
380
436
437
+ # # Engine `sqlite`: [SqliteExample](examples/SqliteExample)
438
+ # ## [Schema](examples/config/sqlite/schema.sql) | [Queries](examples/config/sqlite/query.sql) | [End2End Test](end2end/EndToEndTests/SqliteTester.cs)
381
439
# ## Config
382
440
` ` ` yaml
383
441
useDapper: false
384
442
targetFramework: net8.0
385
443
generateCsproj: true
386
444
namespaceName: SqliteExampleGen
387
- ` ` `
388
- # # Engine `sqlite`: [SqliteDapperExample](examples/SqliteDapperExample)
445
+ ` ` `
389
446
390
- # ## [Schema](examples/config/sqlite/schema.sql) | [Queries](examples/config/sqlite/query.sql) | [End2End Test](end2end/EndToEndTests/SqliteDapperTester.cs)
447
+ </details>
448
+ <details>
449
+ <summary>SqliteDapper</summary>
391
450
451
+ # # Engine `sqlite`: [SqliteDapperExample](examples/SqliteDapperExample)
452
+ # ## [Schema](examples/config/sqlite/schema.sql) | [Queries](examples/config/sqlite/query.sql) | [End2End Test](end2end/EndToEndTests/SqliteDapperTester.cs)
392
453
# ## Config
393
454
` ` ` yaml
394
455
useDapper: true
395
456
targetFramework: net8.0
396
457
generateCsproj: true
397
458
namespaceName: SqliteDapperExampleGen
398
- ` ` `
399
- # # Engine `sqlite`: [SqliteLegacyExample](examples/SqliteLegacyExample)
459
+ ` ` `
400
460
401
- # ## [Schema](examples/config/sqlite/schema.sql) | [Queries](examples/config/sqlite/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/SqliteTester.cs)
461
+ </details>
462
+ <details>
463
+ <summary>SqliteLegacy</summary>
402
464
465
+ # # Engine `sqlite`: [SqliteLegacyExample](examples/SqliteLegacyExample)
466
+ # ## [Schema](examples/config/sqlite/schema.sql) | [Queries](examples/config/sqlite/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/SqliteTester.cs)
403
467
# ## Config
404
468
` ` ` yaml
405
469
useDapper: false
406
470
targetFramework: netstandard2.0
407
471
generateCsproj: true
408
472
namespaceName: SqliteLegacyExampleGen
409
- ` ` `
410
- # # Engine `sqlite`: [SqliteDapperLegacyExample](examples/SqliteDapperLegacyExample)
473
+ ` ` `
411
474
412
- # ## [Schema](examples/config/sqlite/schema.sql) | [Queries](examples/config/sqlite/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/SqliteDapperTester.cs)
475
+ </details>
476
+ <details>
477
+ <summary>SqliteDapperLegacy</summary>
413
478
479
+ # # Engine `sqlite`: [SqliteDapperLegacyExample](examples/SqliteDapperLegacyExample)
480
+ # ## [Schema](examples/config/sqlite/schema.sql) | [Queries](examples/config/sqlite/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/SqliteDapperTester.cs)
414
481
# ## Config
415
482
` ` ` yaml
416
483
useDapper: true
417
484
targetFramework: netstandard2.0
418
485
generateCsproj: true
419
486
namespaceName: SqliteDapperLegacyExampleGen
420
- ` ` `
487
+ ` ` `
488
+
489
+ </details>
0 commit comments