Skip to content

Variable context support #48

Description

@mskyttner

The httpserver not seems to be aware of variables that were set (in the session?), returning NULLs.

An example use case where this would be handy is when you'd like to run a cronjob (using that extension) inside a running httpserver instance regularly (for example to update a table daily which is then served over the httpserver API.

The goal would to be able to have a statement like running:

select cron('create or replace table hr_today as (from read_csv_auto(getvariable(''hr_today_filepath'')))', '0 0 0 8 * *');

Could it be that when httpserver starts, some process or thread is forked and the variables set when the server starts (in an init.sql script) is not "brought along" and therefore lost? Currently it seems variables that are set are blanked out when the server is running and just return NULL.

Perhaps some change similar to Query-farm/cronjob@5eed5fd might be able to alleviate this?

Activity

  1. lmangani commented on Oct 23, 2025

    @lmangani
    Collaborator

    Thanks @mskyttner you're right about both limitation and solution. Feel free to submit a PR and take credit 😉 if that's not possible we'll add this to the list and patch as soon as time allows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions