-
Notifications
You must be signed in to change notification settings - Fork 0
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
in-place modification for gpkg_connect()
#8
Comments
brownag
added a commit
that referenced
this issue
Jun 16, 2023
brownag
added a commit
that referenced
this issue
Jun 16, 2023
brownag
added a commit
that referenced
this issue
Jun 16, 2023
Now w/ dfd755f I get: library(gpkg)
g <- geopackage()
g
#> <geopackage>
#> --------------------------------------------------------------------------------
#> # of Tables: 0
#>
#>
#> --------------------------------------------------------------------------------
# works
gpkg_connect(g)
#> <geopackage>
#> --------------------------------------------------------------------------------
#> # of Tables: 0
#>
#>
#> --------------------------------------------------------------------------------
#> <SQLiteConnection>
#> Path: /tmp/RtmpKe9spX/Rgpkg2ea944417fc85.gpkg
#> Extensions: TRUE
g
#> <geopackage>
#> --------------------------------------------------------------------------------
#> # of Tables: 0
#>
#>
#> --------------------------------------------------------------------------------
#> <SQLiteConnection>
#> Path: /tmp/RtmpKe9spX/Rgpkg2ea944417fc85.gpkg
#> Extensions: TRUE
# works
g <- gpkg_connect(g)
g
#> <geopackage>
#> --------------------------------------------------------------------------------
#> # of Tables: 0
#>
#>
#> --------------------------------------------------------------------------------
#> <SQLiteConnection>
#> Path: /tmp/RtmpKe9spX/Rgpkg2ea944417fc85.gpkg
#> Extensions: TRUE
# works
gpkg_disconnect(g)
g
#> <geopackage>
#> --------------------------------------------------------------------------------
#> # of Tables: 0
#>
#>
#> --------------------------------------------------------------------------------
#> <SQLiteConnection>
#> DISCONNECTED |
Reopening, may be closed by #11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Often there isn't a need to manually connect a
geopackage
object because connections are created and destroyed on the fly. However, when performing many database operations it may be beneficial to make use of a persistent connection to avoid the extra overhead of repeatedly closing and re-opening.Currently, you need to overwrite the object to connect to the database and have that connection "stick".
Connecting to a database and not saving the result prevents from being able to reference the pointer in the future to be disconnected (which causes warnings:
Warning message: call dbDisconnect() when finished working with a connection
).It would be nice to come up with a way that in-place modification of a geopackage object could be used to update the connection field.
The text was updated successfully, but these errors were encountered: