camper/pkg/database
jordi fita mas 007f401d33 Add a cache of OID in database to register types
It makes no sense to retrieve the same OIDs each and every connection,
because they are not going to change unless the database is reset,
something it is very unlikely to happen in production.

Thus, it is best to query them the first time the application connects
to the database, that it is done at startup to query the available
languages, and then reuse the OIDs.

I can get away of using an “unprotected” map, instead of sync.Map or a
map in tandem with sync.RWMutex, because the application establishes a
connection at startup from a single goroutine and it registers _all_
types we will need to register within the application’s lifespan, hence
it there will be no more writes to that map once the web server is
listening for incomming connections.

This is risky, however, and i hope i do not have to regret it.
2023-10-27 12:30:05 +02:00
..
RecordArray.go Copy RecordArray from pgtype to database 2023-09-12 21:58:30 +02:00
db.go Implement Redsys request signature in PostgreSQL 2023-10-27 01:52:04 +02:00
funcs.go Add the list of features for campsite type 2023-10-13 20:30:31 +02:00
tx.go Add the campsite type cost per season 2023-10-01 21:14:39 +02:00
types.go Add a cache of OID in database to register types 2023-10-27 12:30:05 +02:00