org.My.eg_dbconn.Rd 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. \name{org.My.eg_dbconn}
  2. \alias{org.My.eg_dbconn}
  3. \alias{org.My.eg_dbfile}
  4. \alias{org.My.eg_dbschema}
  5. \alias{org.My.eg_dbInfo}
  6. \title{Collect information about the package annotation DB}
  7. \description{
  8. Some convenience functions for getting a connection object to (or collecting
  9. information about) the package annotation DB.
  10. }
  11. \usage{
  12. org.My.eg_dbconn()
  13. org.My.eg_dbfile()
  14. org.My.eg_dbschema(file="", show.indices=FALSE)
  15. org.My.eg_dbInfo()
  16. }
  17. \arguments{
  18. \item{file}{
  19. A connection, or a character string naming the file to print to (see
  20. the \code{file} argument of the \code{\link[base]{cat}} function for
  21. the details).
  22. }
  23. \item{show.indices}{
  24. The CREATE INDEX statements are not shown by default.
  25. Use \code{show.indices=TRUE} to get them.
  26. }
  27. }
  28. \details{
  29. \code{org.My.eg_dbconn} returns a connection object to the
  30. package annotation DB. IMPORTANT: Don't call
  31. \code{\link[DBI:dbConnect]{dbDisconnect}} on the connection object
  32. returned by \code{org.My.eg_dbconn} or you will break all the
  33. \code{\link[AnnotationDbi:AnnDbObj-class]{AnnDbObj}} objects defined
  34. in this package!
  35. \code{org.My.eg_dbfile} returns the path (character string) to the
  36. package annotation DB (this is an SQLite file).
  37. \code{org.My.eg_dbschema} prints the schema definition of the
  38. package annotation DB.
  39. \code{org.My.eg_dbInfo} prints other information about the package
  40. annotation DB.
  41. }
  42. \value{
  43. \code{org.My.eg_dbconn}: a DBIConnection object representing an
  44. open connection to the package annotation DB.
  45. \code{org.My.eg_dbfile}: a character string with the path to the
  46. package annotation DB.
  47. \code{org.My.eg_dbschema}: none (invisible \code{NULL}).
  48. \code{org.My.eg_dbInfo}: none (invisible \code{NULL}).
  49. }
  50. \seealso{
  51. \code{\link[DBI:dbSendQuery]{dbGetQuery}},
  52. \code{\link[DBI:dbConnect]{dbConnect}},
  53. \code{\link[AnnotationDbi:AnnDbObj-class]{dbconn}},
  54. \code{\link[AnnotationDbi:AnnDbObj-class]{dbfile}},
  55. \code{\link[AnnotationDbi:AnnDbObj-class]{dbschema}},
  56. \code{\link[AnnotationDbi:AnnDbObj-class]{dbInfo}}
  57. }
  58. \examples{
  59. library(DBI)
  60. ## Count the number of rows in the "genes" table:
  61. dbGetQuery(org.My.eg_dbconn(), "SELECT COUNT(*) FROM genes")
  62. org.My.eg_dbschema()
  63. org.My.eg_dbInfo()
  64. }
  65. \keyword{utilities}
  66. \keyword{datasets}