Rerouted (regenerated, verified). Same repository and tag, but GitHub now builds the zip with different bytes, so it no longer matches the SHA-1 package.elm-lang.org recorded. The Lamdera package server serves a copy recovered from https://github.com/maca/postgrest-admin-preview.
What we checked: Rebuilt with git archive from commit 05a9080dde8f of https://github.com/maca/postgrest-admin-preview (zip prefix maca-postgrest-admin-preview-05a9080/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 e28b04e03a8607d7299af65bbf18822d06f58d59.
The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.
Details · package.elm-lang.org's zip: https://github.com/maca/postgrest-admin-preview/zipball/1.0.0/
Obtain the PostgREST instance url.
Represents a PostgREST table.
Obtain a table from the table name.
Note that the request functions do not produce a vanilla Elm Cmd but a PostgRestAdmin.Cmd.
Fetches a record for a given table.
expect param requires a function that returns a Msg.
You can use expectRecord to interpret the result as a Record.
import PostgRestAdmin.Cmd as AppCmd
fetch : String -> Client -> AppCmd.Cmd Msg
fetch tableName client =
case getTable tableName client of
Just table ->
fetchRecordList
{ client = client
, table = table
, params = []
, expect = Client.expectRecord MyFetchedMsg table
}
Nothing ->
AppCmd.noneFetches a list of records for a given table.
expect param requires a function that returns a Msg.
You can use expectRecordList to interpret the result as a list of Records.
import PostgRestAdmin.Cmd as AppCmd
fetchList : String -> Client -> AppCmd.Cmd Msg
fetchList tableName client =
case getTable tableName client of
Just table ->
fetchRecordList
{ client = client
, table = table
, params = []
, expect = Client.expectRecordList MyListFetchedMsg table
}
Nothing ->
AppCmd.noneSaves a record.
expect param requires a function that returns a Msg.
You can use expectRecord to interpret the result as a Record.
import PostgRestAdmin.Cmd as AppCmd
save : Record -> Maybe String -> Client -> AppCmd.Cmd Msg
save record id client =
saveRecord
{ client = client
, record = record
, id = id
, expect =
Client.expectRecord MySavedMsg
(Record.getTable record)
}Deletes a record.
expect param requires a function that returns a Msg.
You can use expectRecord to interpret the result as a Record.
import PostgRestAdmin.Cmd as AppCmd
save : Record -> Client -> AppCmd.Cmd Msg
save record client =
deleteRecord
{ client = client
, record = record
, expect =
Client.expectRecord MyDeletedMsg
(Record.getTable record)
}POST to a PostgREST resource url.
See fetchRecord.
Request error.
Transform Error to an error explanation.
Decode the Value for successful Result as a record, decode as such and map the success of the Result to a msg.
Decode the Value for successful Result as a list of records, decode as such and map the success of the Result to a msg.
See fetchRecordList.
Does the client has a valid JWT?
Obtain the JWT as a string.
Represents a client for a PostgREST instance, including authentication params.
See Config and Config.FormAuth for authentication configuration options.