Add index create w/arbitrary expression

This commit is contained in:
Daniel J. Summers 2022-04-27 10:10:13 -04:00
parent 91febe04f4
commit 562ffb5d10
3 changed files with 18 additions and 2 deletions

View File

@ -118,6 +118,14 @@ type RethinkBuilder<'T> () =
[<CustomOperation "indexCreate">]
member _.IndexCreate (tbl, index, js, opts) = indexCreateJSWithOptArgs index js opts tbl
/// Create an index for a table, using an object expression
[<CustomOperation "indexCreate">]
member _.IndexCreate (tbl, index, expr : obj) = indexCreateObj index expr tbl
/// Create an index for a table, using an object expression and optional arguments
[<CustomOperation "indexCreate">]
member _.IndexCreate (tbl, index, expr : obj, opts) = indexCreateObjWithOptArgs index expr opts tbl
/// Drop an index for a table
[<CustomOperation "indexDrop">]
member _.IndexDrop (tbl, index) = indexDrop index tbl

View File

@ -260,7 +260,7 @@ let indexCreate (indexName : string) (table : Table) =
table.IndexCreate indexName
/// Create an index on the given table, including optional arguments
let indexCreateWithOptArgs (indexName : string) args (table : Table) =
let indexCreateWithOptArgs indexName args table =
indexCreate indexName table |> IndexCreateOptArg.apply args
/// Create an index on the given table using a function
@ -279,6 +279,14 @@ let indexCreateJS (indexName : string) js (table : Table) =
let indexCreateJSWithOptArgs indexName js args table =
indexCreateJS indexName js table |> IndexCreateOptArg.apply args
/// Create an index on the given table using the give expression
let indexCreateObj (indexName : string) (expr : obj) (table : Table) =
table.IndexCreate (indexName, expr)
/// Create an index on the given table using the give expression, including optional arguments
let indexCreateObjWithOptArgs indexName (expr : obj) args table =
indexCreateObj indexName expr table |> IndexCreateOptArg.apply args
/// Drop an index
let indexDrop (indexName : string) (table : Table) =
table.IndexDrop indexName

View File

@ -11,7 +11,7 @@
<Copyright>See LICENSE</Copyright>
<PackageTags>RethinkDB document F#</PackageTags>
<VersionPrefix>0.8.0</VersionPrefix>
<VersionSuffix>alpha-0007</VersionSuffix>
<VersionSuffix>alpha-0008</VersionSuffix>
<PackageReleaseNotes>Alpha; use at your own risk</PackageReleaseNotes>
</PropertyGroup>