-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update release link and rerun examples
- Loading branch information
1 parent
bb34a1a
commit 85117a7
Showing
34 changed files
with
636 additions
and
630 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.wasm | ||
.vscode | ||
.ionide |
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,17 @@ | ||
[*.{fs,fsx}] | ||
fsharp_multiline_bracket_style = aligned | ||
max_line_length=120 | ||
indent_size=2 | ||
fsharp_max_function_binding_width=80 | ||
fsharp_max_array_or_list_width=100 | ||
fsharp_array_or_list_multiline_formatter=character_width | ||
fsharp_max_if_then_else_short_width=120 | ||
fsharp_max_record_width=100 | ||
fsharp_record_multiline_formatter=character_width | ||
fsharp_max_if_then_short_width=100 | ||
fsharp_multiline_block_brackets_on_same_column=true | ||
fsharp_multi_line_lambda_closing_newline=true | ||
fsharp_keep_max_number_of_blank_lines=1 | ||
fsharp_max_dot_get_expression_width=120 | ||
fsharp_max_function_binding_width=120 | ||
fsharp_max_value_binding_width=120 |
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 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
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,84 @@ | ||
// Code generated by sqlc. DO NOT EDIT. | ||
// version: sqlc v1.18.0 | ||
|
||
namespace Authors | ||
|
||
open System | ||
open Npgsql | ||
open Npgsql.FSharp | ||
open Authors.Readers | ||
|
||
module Sqls = | ||
|
||
[<Literal>] | ||
let createAuthor = | ||
""" | ||
INSERT INTO authors ( | ||
name, bio | ||
) VALUES ( | ||
@name, @bio | ||
) | ||
""" | ||
|
||
[<Literal>] | ||
let deleteAuthor = | ||
""" | ||
DELETE FROM authors | ||
WHERE id = @id | ||
""" | ||
|
||
[<Literal>] | ||
let getAuthor = | ||
""" | ||
SELECT id, name, bio FROM authors | ||
WHERE id = @id LIMIT 1 | ||
""" | ||
|
||
[<Literal>] | ||
let listAuthors = | ||
""" | ||
SELECT id, name, bio FROM authors | ||
ORDER BY name | ||
""" | ||
|
||
[<RequireQualifiedAccessAttribute>] | ||
type DB(conn: string) = | ||
// https://www.connectionstrings.com/npgsql | ||
|
||
/// This SQL will insert a single author into the table | ||
member this.createAuthor(name: string, ?bio: string) = | ||
|
||
let parameters = [ ("name", Sql.text name); ("bio", Sql.textOrNone bio) ] | ||
|
||
conn | ||
|> Sql.connect | ||
|> Sql.query Sqls.createAuthor | ||
|> Sql.parameters parameters | ||
|> Sql.executeNonQuery | ||
|
||
/// This SQL will delete a given author | ||
member this.deleteAuthor(id: int64) = | ||
|
||
let parameters = [ ("id", Sql.int64 id) ] | ||
|
||
conn | ||
|> Sql.connect | ||
|> Sql.query Sqls.deleteAuthor | ||
|> Sql.parameters parameters | ||
|> Sql.executeNonQuery | ||
|
||
/// This SQL will select a single author from the table | ||
member this.getAuthor(id: int64) = | ||
|
||
let parameters = [ ("id", Sql.int64 id) ] | ||
|
||
conn | ||
|> Sql.connect | ||
|> Sql.query Sqls.getAuthor | ||
|> Sql.parameters parameters | ||
|> Sql.executeRow authorReader | ||
|
||
/// This SQL will list all authors from the authors table | ||
member this.listAuthors() = | ||
|
||
conn |> Sql.connect |> Sql.query Sqls.listAuthors |> Sql.execute authorReader |
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,13 @@ | ||
// Code generated by sqlc. DO NOT EDIT. | ||
// version: sqlc v1.18.0 | ||
|
||
namespace Authors | ||
|
||
open System | ||
open Npgsql | ||
open Npgsql.FSharp | ||
|
||
module Readers = | ||
|
||
let authorReader (r: RowReader) : Author = | ||
{ Author.Id = r.int64 "id"; Name = r.text "name"; Bio = r.textOrNone "bio" } |
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.