Summary
@proofkit/fmodata cannot express valid FileMaker OData alternate-key record lookups like:
This is a problem because FileMaker OData supports fetching records by ROWID even when the table has another primary key, and this is a strong generic hydrate path for sparse webhook payloads (ROWID, ROWMODID).
What works in raw OData
Against a table with a primary key (customersTO), this works:
GET /fmi/odata/v4/Foxtail_Demo/customersTO(ROWID=2)?$select=ROWID,nameFirst,nameLast
I verified this both:
- direct against FileMaker OData
- through Otto proxy
This does not require ROWID to be the table's primary key.
What fmodata does today
Using @proofkit/fmodata@0.1.0-beta.38:
const builder = db.from(customersTO).get(2)
emits:
/Foxtail_Demo/customersTO('2')?...
Using:
const builder = db.from(customersTO).get('ROWID=2')
emits:
/Foxtail_Demo/customersTO('ROWID=2')?...
which is not valid alternate-key syntax.
Runtime repro
const builder = db
.from(customersTO)
.get('ROWID=2')
.select({ id: customersTO.id, nameFirst: customersTO.nameFirst }, { ROWID: true })
console.log(builder.getRequestConfig())
Current output:
{
"method": "GET",
"url": "/Foxtail_Demo/customersTO('ROWID=2')?$select=\"id\",nameFirst,ROWID"
}
Source location
The current URL builder hardcodes record URLs as:
/${databaseName}/${tableId}('${recordId}')
in:
src/client/query/url-builder.ts
src/client/record-builder.ts
So there is no way to express:
Requested support
One of:
- Add first-class alternate-key record lookup, e.g.
db.from(customersTO).getByKey({ ROWID: 2 })
or
db.from(customersTO).getByAlternateKey('ROWID', 2)
- Or extend
.get(...) to accept a typed alternate-key object.
Why this matters
For webhook-driven sync, a very good FileMaker pattern is:
- webhook payload only includes
ROWID,ROWMODID
- backend hydrates latest row via
/tableName(ROWID=<n>)
- dedupe on
(table, ROWID, ROWMODID)
Without alternate-key lookup support, fmodata cannot implement that cleanly.
Summary
@proofkit/fmodatacannot express valid FileMaker OData alternate-key record lookups like:This is a problem because FileMaker OData supports fetching records by
ROWIDeven when the table has another primary key, and this is a strong generic hydrate path for sparse webhook payloads (ROWID,ROWMODID).What works in raw OData
Against a table with a primary key (
customersTO), this works:I verified this both:
This does not require
ROWIDto be the table's primary key.What
fmodatadoes todayUsing
@proofkit/fmodata@0.1.0-beta.38:emits:
Using:
emits:
which is not valid alternate-key syntax.
Runtime repro
Current output:
{ "method": "GET", "url": "/Foxtail_Demo/customersTO('ROWID=2')?$select=\"id\",nameFirst,ROWID" }Source location
The current URL builder hardcodes record URLs as:
in:
src/client/query/url-builder.tssrc/client/record-builder.tsSo there is no way to express:
Requested support
One of:
or
.get(...)to accept a typed alternate-key object.Why this matters
For webhook-driven sync, a very good FileMaker pattern is:
ROWID,ROWMODID/tableName(ROWID=<n>)(table, ROWID, ROWMODID)Without alternate-key lookup support,
fmodatacannot implement that cleanly.