FSharp.ORM
Documentation
PM> Install-Package FSharp.ORM
Example
This example demonstrates setting up a database connection and using it to insert, edit, query, and delete records.
Schema
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: |
|
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: |
|
Some more info
Samples & documentation
The library comes with comprehensible documentation.
It can include tutorials automatically generated from *.fsx
files in the content folder.
The API reference is automatically generated from Markdown comments in the library implementation.
Tutorial contains a further explanation of this sample library.
API Reference contains automatically generated documentation for all types, modules and functions in the library. This includes additional brief samples on using most of the functions.
Contributing and copyright
The project is hosted on GitHub where you can report issues, fork the project and submit pull requests. If you're adding a new public API, please also consider adding samples that can be turned into a documentation. You might also want to read the library design notes to understand how it works.
The library is available under Public Domain license, which allows modification and redistribution for both commercial and non-commercial purposes. For more information see the License file in the GitHub repository.
namespace FSharp
--------------------
namespace Microsoft.FSharp
Full name: Index.MyDb.config
type MsSqlConfig =
inherit DbConfigBase
new : unit -> MsSqlConfig
override QueryTranslator : QueryType -> IDbConnection -> Expression -> IDbCommand * ConstructionInfo option
override Dialect : IDialect
Full name: FSharp.ORM.MsSqlConfig
--------------------
new : unit -> MsSqlConfig
Full name: Index.MyDb.query
module Db
from FSharp.ORM
--------------------
type Db =
interface IDb
new : config:IDbConfig -> Db
abstract member Call : procedure:'T -> unit (requires reference type)
abstract member Delete : entity:'T * opt:DeleteOpt -> unit (requires reference type)
abstract member Delete : entity:'T -> unit (requires reference type)
abstract member Execute : sql:string * condition:obj -> int
abstract member Execute : sql:string -> int
abstract member ExecuteReader : handler:Func<DbDataReader,'T> * sql:string * condition:obj -> 'T
abstract member ExecuteReader : handler:Func<DbDataReader,'T> * sql:string -> 'T
abstract member Find : id:obj -> 'T (requires reference type and default constructor)
...
Full name: FSharp.ORM.Db
--------------------
new : config:IDbConfig -> Db
Full name: FSharp.ORM.Db.query
Full name: Index.MyDb.queryOnDemand
Full name: FSharp.ORM.Db.queryOnDemand
Full name: Index.MyDb.queryable
Full name: Microsoft.FSharp.Core.Operators.not
Full name: FSharp.ORM.Db.queryable
Full name: Index.MyDb.queryableDirectSql
Full name: FSharp.ORM.Db.queryableDirectSql
Full name: Index.MyDb.queryableDelete
namespace System.Linq
--------------------
namespace Microsoft.FSharp.Linq
type IQueryable =
member ElementType : Type
member Expression : Expression
member Provider : IQueryProvider
Full name: System.Linq.IQueryable
--------------------
type IQueryable<'T> =
Full name: System.Linq.IQueryable<_>
Full name: Microsoft.FSharp.Core.unit
Full name: FSharp.ORM.Db.queryableDelete
Full name: Index.MyDb.execute
Full name: FSharp.ORM.Db.execute
Full name: Index.MyDb.find
Full name: FSharp.ORM.Db.find
Full name: Index.MyDb.tryFind
Full name: FSharp.ORM.Db.tryFind
Full name: Index.MyDb.insert
Full name: FSharp.ORM.Db.insert
Full name: Index.MyDb.update
Full name: FSharp.ORM.Db.update
Full name: Index.MyDb.delete
Full name: FSharp.ORM.Db.delete
Full name: Index.MyDb.call
Full name: FSharp.ORM.Db.call
Full name: Index.DepartmentId
val int : value:'T -> int (requires member op_Explicit)
Full name: Microsoft.FSharp.Core.Operators.int
--------------------
type int = int32
Full name: Microsoft.FSharp.Core.int
--------------------
type int<'Measure> = int
Full name: Microsoft.FSharp.Core.int<_>
{DepartmentId: DepartmentId;
DepartmentName: string;
VersionNo: int option;}
Full name: Index.Department
type IdAttribute =
inherit Attribute
new : unit -> IdAttribute
new : IdKind -> IdAttribute
member Kind : IdKind
Full name: FSharp.ORM.IdAttribute
--------------------
new : unit -> IdAttribute
new : IdKind -> IdAttribute
Department.DepartmentId: DepartmentId
--------------------
type DepartmentId = int
Full name: Index.DepartmentId
val string : value:'T -> string
Full name: Microsoft.FSharp.Core.Operators.string
--------------------
type string = String
Full name: Microsoft.FSharp.Core.string
type Version =
new : unit -> Version + 4 overloads
member Build : int
member Clone : unit -> obj
member CompareTo : version:obj -> int + 1 overload
member Equals : obj:obj -> bool + 1 overload
member GetHashCode : unit -> int
member Major : int
member MajorRevision : int16
member Minor : int
member MinorRevision : int16
...
Full name: System.Version
--------------------
type VersionAttribute =
inherit Attribute
new : unit -> VersionAttribute
new : VersionKind -> VersionAttribute
member Kind : VersionKind
Full name: FSharp.ORM.VersionAttribute
--------------------
Version() : unit
Version(version: string) : unit
Version(major: int, minor: int) : unit
Version(major: int, minor: int, build: int) : unit
Version(major: int, minor: int, build: int, revision: int) : unit
--------------------
new : unit -> VersionAttribute
new : VersionKind -> VersionAttribute
Full name: Microsoft.FSharp.Core.option<_>
Full name: Index.createDepartment
{EmployeeId: int option;
EmployeeName: string option;
DepartmentId: DepartmentId option;
VersionNo: int option;}
Full name: Index.Employee
| Assigned = 0
| Identity = 1
| Sequence = 2
Full name: FSharp.ORM.IdKind
Employee.DepartmentId: DepartmentId option
--------------------
type DepartmentId = int
Full name: Index.DepartmentId
Full name: Index.salesDepartmentId
Full name: Index.salesDepartment
from Index
Full name: Index.salesDepartmentLoaded
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.query
Calls Linq.QueryBuilder.Where
Calls Linq.QueryBuilder.ExactlyOne
Full name: Index.searchDepartments
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
from Microsoft.FSharp.Collections
Full name: Microsoft.FSharp.Collections.Seq.toList
Full name: Index.updatedSalesDepartment
Full name: Index.rows