maca / postgrest-admin-preview / PostgRestAdmin.Record

Record


type alias Record =
Internal.Record.Record

A Record.

fromTable : Internal.Schema.Table -> Record

Create a blank record from a Table.

Record Values


type Value
    = RFloat Basics.Float
    | RInt Basics.Int
    | RString String
    | RBool Basics.Bool
    | RPosix Time.Posix
    | RValue Json.Decode.Value

value : String -> Record -> Maybe Value

Properties

id : Record -> Maybe String

Get the Record id.

location : Record -> Maybe String

Obtain the location for a record

tableName record == "posts"
-- True
id record == Just 1
-- True
location record == Just "/posts?id=eq.1"
-- True

label : Record -> Maybe String

Obtain a label identifying the record, could be the title or name attribute.

Errors

errors : Record -> Dict String (Maybe String)

Get the Record errors after saving.

hasErrors : Record -> Basics.Bool

Check if the Record has errors after saving.

Decode/Encode

decoder : Internal.Schema.Table -> Json.Decode.Decoder Record

A decoder for a Record.

encode : Record -> Json.Encode.Value

Encode a Record.

Table

getTable : Record -> Internal.Schema.Table

Get the Table for the Record.

tableName : Record -> String

Get the Record Table name.