Created
September 15, 2021 01:14
-
-
Save dfellis/5177bc5f566228f727640baba05fc7af to your computer and use it in GitHub Desktop.
Remote Execution Second Example
This file contains hidden or 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
const userTripsInOrder = await query(` | |
select * from trips | |
where trips.userId == $0 | |
order by trips.startTime desc; | |
`, [userId]); | |
const outputUserTripsInOrder = userTripsInOrder.map((t) => ({ | |
type: t.type, | |
price: t.price, | |
serviceProvider, t.serviceProvider, | |
origin: { | |
lat: t.originLat, | |
lng: t.originLng, | |
time: new Date(t.startTime), | |
}, | |
destination: { | |
lat: t.destLat, | |
lng: t.destLng, | |
time: new Date(t.endTime), | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment