Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbDataType might have an issue with integer64 class in data.frames #277

Open
jd4ds opened this issue Jul 22, 2022 · 1 comment
Open

dbDataType might have an issue with integer64 class in data.frames #277

jd4ds opened this issue Jul 22, 2022 · 1 comment

Comments

@jd4ds
Copy link

jd4ds commented Jul 22, 2022

Hey there,
i might have encountered a small issue with the evaluation of integer64 objects in data.frames to determine their SQL datatype.
It seems everything works fine if integer64 objects get evaluated as a single vector, but as soon as they are part of a data.frame it seems there is problem in finding the correct method.

Here is a reprex;

DBI::dbDataType(
  dbObj = RMariaDB:::mariadb_default(),
  bit64::as.integer64(1L)
)
#> [1] "BIGINT"


DBI::dbDataType(
  dbObj = RMariaDB:::mariadb_default(),
  data.frame(column = 1L)
)
#> column 
#>  "INT"

DBI::dbDataType(
  dbObj = RMariaDB:::mariadb_default(),
  data.frame(column = bit64::as.integer64(1L))
)
#> Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'dbiDataType' for signature '"integer64"'

Created on 2022-07-22 by the reprex package (v2.0.1)

Thanks!
Janis

@krlmlr
Copy link
Member

krlmlr commented Jul 22, 2022

Thanks, good catch! I agree this should work out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants