@@ -34,7 +34,8 @@ setMethod("show", "DBIConnection", function(object) {
34
34
# RPostgreSQL)
35
35
tryCatch(
36
36
show_connection(object ),
37
- error = function (e ) NULL )
37
+ error = function (e ) NULL
38
+ )
38
39
invisible (NULL )
39
40
})
40
41
@@ -50,6 +51,9 @@ show_connection <- function(object) {
50
51
# ' This closes the connection, discards all pending work, and frees
51
52
# ' resources (e.g., memory, sockets).
52
53
# '
54
+ # ' @template methods
55
+ # ' @templateVar method_name dbDisconnect
56
+ # '
53
57
# ' @inherit DBItest::spec_connection_disconnect return
54
58
# ' @inheritSection DBItest::spec_connection_disconnect Specification
55
59
# '
@@ -83,6 +87,10 @@ setGeneric("dbDisconnect",
83
87
# ' and transfer them piecemeal to R, others may transfer all the data to the
84
88
# ' client -- but not necessarily to the memory that R manages. See individual
85
89
# ' drivers' `dbSendQuery()` documentation for details.
90
+ # '
91
+ # ' @template methods
92
+ # ' @templateVar method_name dbSendQuery
93
+ # '
86
94
# ' @inherit DBItest::spec_result_send_query return
87
95
# ' @inheritSection DBItest::spec_result_send_query Specification
88
96
# '
@@ -120,6 +128,9 @@ setGeneric("dbSendQuery",
120
128
# ' forwards to [dbSendQuery()], to support backends that only
121
129
# ' implement the latter.
122
130
# '
131
+ # ' @template methods
132
+ # ' @templateVar method_name dbSendStatement
133
+ # '
123
134
# ' @inherit DBItest::spec_result_send_statement return
124
135
# ' @inheritSection DBItest::spec_result_send_statement Specification
125
136
# '
@@ -168,6 +179,9 @@ setMethod(
168
179
# ' reasons. However, callers are strongly advised to use
169
180
# ' [dbExecute()] for data manipulation statements.
170
181
# '
182
+ # ' @template methods
183
+ # ' @templateVar method_name dbGetQuery
184
+ # '
171
185
# ' @inherit DBItest::spec_result_get_query return
172
186
# ' @inheritSection DBItest::spec_result_get_query Specification
173
187
# '
@@ -213,6 +227,9 @@ setMethod("dbGetQuery", signature("DBIConnection", "character"),
213
227
# ' [dbSendStatement()], then [dbGetRowsAffected()], ensuring that
214
228
# ' the result is always free-d by [dbClearResult()].
215
229
# '
230
+ # ' @template methods
231
+ # ' @templateVar method_name dbExecute
232
+ # '
216
233
# ' @section Implementation notes:
217
234
# ' Subclasses should override this method only if they provide some sort of
218
235
# ' performance optimization.
@@ -251,6 +268,9 @@ setMethod(
251
268
252
269
# ' Get DBMS exceptions
253
270
# '
271
+ # ' DEPRECATED. Backends should use R's condition system to signal errors and
272
+ # ' warnings.
273
+ # '
254
274
# ' @inheritParams dbGetQuery
255
275
# ' @family DBIConnection generics
256
276
# ' @return a list with elements `errorNum` (an integer error number) and
@@ -263,7 +283,9 @@ setGeneric("dbGetException",
263
283
264
284
# ' A list of all pending results
265
285
# '
266
- # ' List of [DBIResult-class] objects currently active on the connection.
286
+ # ' DEPRECATED. DBI currenty supports only one open result set per connection,
287
+ # ' you need to keep track of the result sets you open if you need this
288
+ # ' functionality.
267
289
# '
268
290
# ' @inheritParams dbGetQuery
269
291
# ' @family DBIConnection generics
@@ -296,10 +318,16 @@ setGeneric("dbListFields",
296
318
297
319
# ' @rdname hidden_aliases
298
320
# ' @export
299
- setMethod ("dbListFields ", c ("DBIConnection", "character"),
321
+ setMethod ("dbListFields ", signature ("DBIConnection", "character"),
300
322
function (conn , name , ... ) {
301
- rs <- dbSendQuery(conn , paste(" SELECT * FROM " ,
302
- dbQuoteIdentifier(conn , name ), " LIMIT 0" ))
323
+ rs <- dbSendQuery(
324
+ conn ,
325
+ paste(
326
+ " SELECT * FROM " ,
327
+ dbQuoteIdentifier(conn , name ),
328
+ " LIMIT 0"
329
+ )
330
+ )
303
331
on.exit(dbClearResult(rs ))
304
332
305
333
names(dbFetch(rs , n = 0 , row.names = FALSE ))
@@ -312,6 +340,9 @@ setMethod("dbListFields", c("DBIConnection", "character"),
312
340
# ' connection.
313
341
# ' This should, where possible, include temporary tables, and views.
314
342
# '
343
+ # ' @template methods
344
+ # ' @templateVar method_name dbListTables
345
+ # '
315
346
# ' @inherit DBItest::spec_sql_list_tables return
316
347
# ' @inheritSection DBItest::spec_sql_list_tables Additional arguments
317
348
# '
@@ -337,6 +368,9 @@ setGeneric("dbListTables",
337
368
# ' a column to row names and converting the column names to valid
338
369
# ' R identifiers.
339
370
# '
371
+ # ' @template methods
372
+ # ' @templateVar method_name dbReadTable
373
+ # '
340
374
# ' @inherit DBItest::spec_sql_read_table return
341
375
# ' @inheritSection DBItest::spec_sql_read_table Additional arguments
342
376
# ' @inheritSection DBItest::spec_sql_read_table Specification
@@ -388,6 +422,9 @@ setMethod("dbReadTable", c("DBIConnection", "character"),
388
422
# ' Writes, overwrites or appends a data frame to a database table, optionally
389
423
# ' converting row names to a column and specifying SQL data types for fields.
390
424
# '
425
+ # ' @template methods
426
+ # ' @templateVar method_name dbWriteTable
427
+ # '
391
428
# ' @inherit DBItest::spec_sql_write_table return
392
429
# ' @inheritSection DBItest::spec_sql_write_table Additional arguments
393
430
# ' @inheritSection DBItest::spec_sql_write_table Specification
@@ -422,6 +459,9 @@ setGeneric("dbWriteTable",
422
459
# '
423
460
# ' Returns if a table given by name exists in the database.
424
461
# '
462
+ # ' @template methods
463
+ # ' @templateVar method_name dbExistsTable
464
+ # '
425
465
# ' @inherit DBItest::spec_sql_exists_table return
426
466
# ' @inheritSection DBItest::spec_sql_exists_table Additional arguments
427
467
# ' @inheritSection DBItest::spec_sql_exists_table Specification
@@ -448,6 +488,9 @@ setGeneric("dbExistsTable",
448
488
# ' Remove a remote table (e.g., created by [dbWriteTable()])
449
489
# ' from the database.
450
490
# '
491
+ # ' @template methods
492
+ # ' @templateVar method_name dbRemoveTable
493
+ # '
451
494
# ' @inherit DBItest::spec_sql_remove_table return
452
495
# ' @inheritSection DBItest::spec_sql_remove_table Specification
453
496
# '
0 commit comments