leafo / pgmoon

A pure Lua Postgres driver for use in OpenResty & more
MIT License
390 stars 93 forks source link

Make application_name pg client init param configurable #110

Closed mecampbellsoup closed 2 years ago

mecampbellsoup commented 2 years ago

Allows client conns to specify a value for application_name instead of just hard-coding to "pgmoon", e.g.:

    pg_settings = {
        host = ip,
        port = '5432',
        database = os.getenv('POSTGRES_DATABASE'),
        user = os.getenv('POSTGRES_USERNAME'),
        password = os.getenv('POSTGRES_PASSWORD'),
        application_name = 'api-gateway'  -- previously this was hardcoded to "pgmoon"
    }

@leafo I should just be able to run make build to generate the *.lua files correct?

Resolves #107.

leafo commented 2 years ago

@mecampbellsoup That's correct, make build will generate lua files from the corresponding moon files. We should check in all generated lua files so luarocks can install the module without any compile step or additional dependencies.