From a55d6806eb1acaac243a0fdfa656f1434ef1110c Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sun, 13 Aug 2017 21:52:37 -0500 Subject: [PATCH] defaultDb didn't work as expected removed it, and added [from/in]Default to functions that would support operations normally preceded by r.Db() --- src/RethinkDb.Driver.FSharp/Functions.fs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/RethinkDb.Driver.FSharp/Functions.fs b/src/RethinkDb.Driver.FSharp/Functions.fs index 0f62457..3bd0eb1 100644 --- a/src/RethinkDb.Driver.FSharp/Functions.fs +++ b/src/RethinkDb.Driver.FSharp/Functions.fs @@ -59,10 +59,6 @@ let dbList conn = r.DbList () |> asyncResult conn -/// Reference the default database -let defaultDb = - (fun () -> r.Db ()) () - /// Delete documents let delete (expr : ReqlExpr) = 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) let fromTable tableName = - table tableName defaultDb + r.Table tableName /// Create a table in the given database let tableCreate tableName conn (db : Db) = db.TableCreate tableName |> 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) = db.TableDrop tableName |> 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 let tableList conn (db : Db) = db.TableList () |> asyncResult conn +/// Get a list of tables from the connection-default database +let tableListFromDefault conn = + r.TableList () + |> asyncResult conn + /// Update documents let update updateSpec (expr : ReqlExpr) = expr.Update (updateSpec :> obj)