defaultDb didn't work as expected
removed it, and added [from/in]Default to functions that would support operations normally preceded by r.Db()
This commit is contained in:
parent
402f66f5fa
commit
a55d6806eb
@ -59,10 +59,6 @@ let dbList conn =
|
|||||||
r.DbList ()
|
r.DbList ()
|
||||||
|> asyncResult<string list> conn
|
|> asyncResult<string list> conn
|
||||||
|
|
||||||
/// Reference the default database
|
|
||||||
let defaultDb =
|
|
||||||
(fun () -> r.Db ()) ()
|
|
||||||
|
|
||||||
/// Delete documents
|
/// Delete documents
|
||||||
let delete (expr : ReqlExpr) =
|
let delete (expr : ReqlExpr) =
|
||||||
expr.Delete ()
|
expr.Delete ()
|
||||||
@ -266,23 +262,38 @@ let table tableName (db : Db) =
|
|||||||
|
|
||||||
/// Return all documents in a table from the default database (may be further refined)
|
/// Return all documents in a table from the default database (may be further refined)
|
||||||
let fromTable tableName =
|
let fromTable tableName =
|
||||||
table tableName defaultDb
|
r.Table tableName
|
||||||
|
|
||||||
/// Create a table in the given database
|
/// Create a table in the given database
|
||||||
let tableCreate tableName conn (db : Db) =
|
let tableCreate tableName conn (db : Db) =
|
||||||
db.TableCreate tableName
|
db.TableCreate tableName
|
||||||
|> asyncReqlResult conn
|
|> asyncReqlResult conn
|
||||||
|
|
||||||
/// Drop a table
|
/// Create a table in the connection-default database
|
||||||
|
let tableCreateInDefault tableName conn =
|
||||||
|
r.TableCreate tableName
|
||||||
|
|> asyncReqlResult conn
|
||||||
|
|
||||||
|
/// Drop a table in the given database
|
||||||
let tableDrop tableName conn (db : Db) =
|
let tableDrop tableName conn (db : Db) =
|
||||||
db.TableDrop tableName
|
db.TableDrop tableName
|
||||||
|> asyncReqlResult conn
|
|> asyncReqlResult conn
|
||||||
|
|
||||||
|
/// Drop a table from the connection-default database
|
||||||
|
let tableDropFromDefault tableName conn =
|
||||||
|
r.TableDrop tableName
|
||||||
|
|> asyncReqlResult conn
|
||||||
|
|
||||||
/// Get a list of tables for the given database
|
/// Get a list of tables for the given database
|
||||||
let tableList conn (db : Db) =
|
let tableList conn (db : Db) =
|
||||||
db.TableList ()
|
db.TableList ()
|
||||||
|> asyncResult<string list> conn
|
|> asyncResult<string list> conn
|
||||||
|
|
||||||
|
/// Get a list of tables from the connection-default database
|
||||||
|
let tableListFromDefault conn =
|
||||||
|
r.TableList ()
|
||||||
|
|> asyncResult<string list> conn
|
||||||
|
|
||||||
/// Update documents
|
/// Update documents
|
||||||
let update updateSpec (expr : ReqlExpr) =
|
let update updateSpec (expr : ReqlExpr) =
|
||||||
expr.Update (updateSpec :> obj)
|
expr.Update (updateSpec :> obj)
|
||||||
|
Loading…
Reference in New Issue
Block a user