-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from tforkmann/extend-docs
work on more docs
- Loading branch information
Showing
14 changed files
with
194 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module Docs.Pages.Execute | ||
|
||
open Feliz | ||
open Feliz.Bulma | ||
open Docs.SharedView | ||
|
||
let ExecuteView = | ||
Html.div [ | ||
Bulma.title.h1 "AzureTackle - Execute" | ||
Html.hr [] | ||
Bulma.content [ | ||
Bulma.title.h4 "Connect to your database" | ||
Html.p [ prop.dangerouslySetInnerHTML "Get the connection from the environment" ] | ||
linedMockupCode """ | ||
open AzureTackle | ||
let connectionString() = Env.getVar "app_db | ||
""" | ||
] | ||
] | ||
|
||
let code = | ||
""" | ||
let tableProps = AzureTable.withConnectionString ("UseDevelopmentStorage=true", TestTable) | ||
let mapper = fun (tableEntity :TableEntity) -> | ||
{ | ||
PartKey = tableEntity.PartitionKey | ||
RowKey = tableEntity.RowKey | ||
ValidFrom = tableEntity.ReadDateTimeOffset("ValidFrom") | ||
ValidTo = tableEntity.ReadOptionalDateTimeOffset("ValidTo") | ||
Exists = tableEntity.ReadBoolean("Exists") | ||
Value = tableEntity.GetDouble("Value").Value | ||
ValueDecimal = tableEntity.ReadDecimal("ValueDecimal") | ||
Text = tableEntity.GetString("Text") | ||
} | ||
let! values = | ||
tableProps | ||
|> AzureTable.execute (fun read -> | ||
{ | ||
PartKey = read.PartitionKey | ||
RowKey = read.RowKey | ||
ValidFrom = read.ReadDateTimeOffset("ValidFrom") | ||
ValidTo = read.ReadOptionalDateTimeOffset "ValidTo" | ||
Exists = read.ReadBoolean "Exists" | ||
Value = read.ReadDouble "Value" | ||
ValueDecimal = read.ReadDecimal "ValueDecimal" | ||
Text = read.ReadString "Text" | ||
}) | ||
""" | ||
|
||
let title = Html.text "AzureTackle" | ||
|
||
[<ReactComponent>] | ||
let Execute () = | ||
Html.div [ | ||
Bulma.content [ | ||
codedView title code ExecuteView | ||
] | ||
fixDocsView "Execute" false | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module Docs.Pages.Upsert | ||
|
||
open Feliz | ||
open Feliz.Bulma | ||
open Docs.SharedView | ||
|
||
let UpsertView = | ||
Html.div [ | ||
Bulma.title.h1 "AzureTackle - Upsert" | ||
Html.hr [] | ||
Bulma.content [ | ||
Bulma.title.h4 "Connect to your database" | ||
Html.p [ prop.dangerouslySetInnerHTML "Get the connection from the environment" ] | ||
linedMockupCode """ | ||
open AzureTackle | ||
let connectionString() = Env.getVar "app_db | ||
""" | ||
] | ||
] | ||
|
||
let code = | ||
""" | ||
let tableProps = AzureTable.withConnectionString ("UseDevelopmentStorage=true", TestTable) | ||
let mapper = fun (tableEntity :TableEntity) -> | ||
{ | ||
PartKey = tableEntity.PartitionKey | ||
RowKey = tableEntity.RowKey | ||
ValidFrom = tableEntity.ReadDateTimeOffset("ValidFrom") | ||
ValidTo = tableEntity.ReadOptionalDateTimeOffset("ValidTo") | ||
Exists = tableEntity.ReadBoolean("Exists") | ||
Value = tableEntity.GetDouble("Value").Value | ||
ValueDecimal = tableEntity.ReadDecimal("ValueDecimal") | ||
Text = tableEntity.GetString("Text") | ||
} | ||
let! values = | ||
tableProps | ||
|> AzureTable.execute (fun read -> | ||
{ | ||
PartKey = read.PartitionKey | ||
RowKey = read.RowKey | ||
ValidFrom = read.ReadDateTimeOffset("ValidFrom") | ||
ValidTo = read.ReadOptionalDateTimeOffset "ValidTo" | ||
Exists = read.ReadBoolean "Exists" | ||
Value = read.ReadDouble "Value" | ||
ValueDecimal = read.ReadDecimal "ValueDecimal" | ||
Text = read.ReadString "Text" | ||
}) | ||
""" | ||
|
||
let title = Html.text "AzureTackle" | ||
|
||
[<ReactComponent>] | ||
let Upsert () = | ||
Html.div [ | ||
Bulma.content [ | ||
codedView title code UpsertView | ||
] | ||
fixDocsView "Upsert" false | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.