numerus/pkg
jordi fita mas 5f7b798eb4 Prefill login form when using the demo database
This is to help up “sell” the service: people can look around the demo
to see whether it fits them.  Of course, everyone should have the same
username in the demo.

We talked about having the username and password displayed above the
form in the template, but i think it makes more sense to give users as
little work as necessary.  Plus, that means i do not have to write them
down while developing.

Whether the database is demo or not is not something that directly
depends on the environment, but rather on which database we are
connected to, thus an environment variable would not make much sense—it
has to be something of the database.

PostgreSQL has no PRAGMA application_id or PRAGMA user_version as with
SQLite to include application-specific values to the database.  The
equivalent would be customized options[0], intended for modules
configuration, but that would require me to execute an ALTER DATABASE
in demo.sql with an specific datbase name, or force the use of psql to
run script the script, because then i can use the :DBNAME placeholder.

I guess that the most “standard” way is to just create a function that
returns a know value if the database is demo.  Sqitch does not add that
function, therefore it is unlikely to be there by change unless it is
the demo database.

https://www.postgresql.org/docs/15/runtime-config-custom.html
2024-01-20 20:23:26 +01:00
..
build.go Add the application’s version on the footer 2024-01-19 20:03:04 +01:00
company.go Add option to switch to another company 2023-11-06 13:52:34 +01:00
contacts.go Return HTTP 404 instead of 500 for invalid UUID values in URL 2023-07-17 12:07:23 +02:00
dashboard.go Compute the total amount, base plus taxes, of all expenses 2023-07-13 20:50:26 +02:00
db.go Allow importing contacts from Holded 2023-07-03 00:05:47 +02:00
expenses.go Avoid panic error when there is no expense to compute the sum of 2023-11-06 13:18:02 +01:00
form.go Add option to export the list of quotes, invoices, and expenses to ODS 2023-07-18 13:29:36 +02:00
htmx.go Use HTMx to add product rows “inline” in the invoice form 2023-04-24 02:00:38 +02:00
invoices.go Do not give “false ID” to invoice products that come from quotations 2023-08-11 19:47:10 +02:00
locale.go Add currency_pattern to language relation 2023-02-23 12:12:33 +01:00
logger.go Reduce the amount of useless data in request’s log 2023-06-13 16:05:40 +02:00
login.go Prefill login form when using the demo database 2024-01-20 20:23:26 +01:00
ods.go Add option to export the list of quotes, invoices, and expenses to ODS 2023-07-18 13:29:36 +02:00
pgtypes.go Add a cache of OID in database to register types 2023-10-27 12:44:24 +02:00
products.go Return HTTP 404 instead of 500 for invalid UUID values in URL 2023-07-17 12:07:23 +02:00
profile.go Create constants for the HTMX request and response headers used 2023-04-06 12:07:20 +02:00
quote.go Add option to export the list of quotes, invoices, and expenses to ODS 2023-07-18 13:29:36 +02:00
recover.go Gofmt recover.go 2023-01-22 20:37:34 +01:00
router.go Prefill login form when using the demo database 2024-01-20 20:23:26 +01:00
slug.go Add the customer name to the invoice’s PDF file name 2023-07-07 11:34:34 +02:00
template.go Add the application’s version on the footer 2024-01-19 20:03:04 +01:00
uuid.go Return HTTP 404 instead of 500 for invalid UUID values in URL 2023-07-17 12:07:23 +02:00
uuid_test.go Return HTTP 404 instead of 500 for invalid UUID values in URL 2023-07-17 12:07:23 +02:00