Skip to content

stored procedures? #276

Open
Open
@ear7h

Description

@ear7h

Hi, again! I'm messing around with cozo again and came up with an interesting problem. I've created a web of named queries like:

allowed_users[principal, email] := ...

allowed_channels[principal, channel_id] :=
    *channel{author, ...},
    allowed_users[principal, author], ...

allowed_threads[principal, channel_id, thread_id] :=
    *threads{channel_id, thread_id, author, ...},
    allowed_users[principal, author],
    allowed_channels[principal, channel_id], ...

I'd like to use these as part of implementing GET /users, GET /channels, GET /threads, etc. That is, these queries will just be filters for a queries against *user, *channel, and *thread. As far as I can tell, I'll just have to duplicate this text for each query. But, is there a way to save these queries like function/stored procedure?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions