# 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)
db("show search_path", conn.id = cid)
.db("drop table if exists tr;",
"create temp table tr (idx integer,
val double precision);",
"insert into tr values (1, 2.3), (2, 3.4)", conn.id = cid)
db.q("select * from tr", conn.id = cid)
db.disconnect(cid, verbose = FALSE)
# }
Run the code above in your browser using DataLab