# NOT RUN {
<!-- %% @test .port Database port number -->
<!-- %% @test .dbname Database name -->
## set up the database connection
## Assume that .port is port number and .dbname is the database name
cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE)
delete("abalone", conn.id = cid)
as.db.data.frame(abalone, "abalone", conn.id = cid, verbose = FALSE)
x <- db.data.frame('abalone', conn.id = cid, key = 'id') # use default connection 1
y <- db.data.frame('abalone', conn.id = cid)
## Check for equality
eql(x,y) # This returns true
## create a db.Rquery object
z <- x[,] # x is a db.data.frame object, but z is not
eql(x,z) # This returns false
db.disconnect(cid, verbose = FALSE)
# }
Run the code above in your browser using DataLab