Skip to content

using AS OF SYSTEM TIME #281

@luto

Description

@luto

Is there an any support for AS OF SYSTEM TIME in either the transaction variant:

BEGIN AS OF SYSTEM TIME '2019-04-09 18:02:52.0+00:00';

or the query variant:

SELECT * FROM t, u, v AS OF SYSTEM TIME '-4h';

?

It seems to me that there is currently no way to use this cockroach feature from within django. The code emitting BEGIN statements seems to be berried 3 dependencies down the line within psycopg.BaseConnection._get_tx_start_command, so I am not sure how to approach this elegantly.

The API could like like this for transactions (extended django.db.transaction.Atomic/.atomic):

from django_cockroachdb.transaction import atomic

with atomic(as_of_system_time="-4h"):
    pass

or like this for queries (modified QuerySet class):

Poll.objects.all().as_of_system_time("-4h")

Are there any plans to add this?

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