Skip to content

Conversation

@guzman-raphael
Copy link
Collaborator

@guzman-raphael guzman-raphael commented Feb 11, 2021

Example Request

GET /api/fetch_tuples?limit=1000&page=1&order=KEY+ASC&restriction=W3siYXR0cmlidXRlTmFtZSI6ICJzdHVkZW50X2Vucm9sbF9kYXRlIiwgIm9wZXJhdGlvbiI6ICI+IiwgInZhbHVlIjogIjIwMjEtMDEtMDcifSwgeyJhdHRyaWJ1dGVOYW1lIjogInN0dWRlbnRfZW5yb2xsX2RhdGUiLCAib3BlcmF0aW9uIjogIjwiLCAidmFsdWUiOiAiMjAyMS0wMS0xNyJ9XQo=

Decoded base64 restriction:

[
    {
        "attributeName": "student_enroll_date",
        "operation": ">",
        "value": "2021-01-07"
    },
    {
        "attributeName": "student_enroll_date",
        "operation": "<",
        "value": "2021-01-17"
    }
]

All query parameters are optional. Defaults are as shown above with the exception of restriction; it is simply no restriction.

Example Response

total_count is also sent back now for the benefit of determining how many total pages to render on frontside.

{
    "total_count": 25,
    "tuples": [
        [
            58,
            "Shelly Daniels",
            "225-02-5575",
            1610755200.0,
            1543.0,
            "LotC",
            1
        ],
        [
            29,
            "Ian Arroyo",
            "649-80-2169",
            1610755200.0,
            2859.0,
            "LotC",
            1
        ],
        [
            70,
            "Richard Smith",
            "613-80-2175",
            1610755200.0,
            2970.0,
            "LotC",
            1
        ],
        [
            72,
            "Julie Chen",
            "346-84-2037",
            1610668800.0,
            1642.0,
            "LotA",
            0
        ],
        [
            83,
            "Michael Mays",
            "127-96-0118",
            1610668800.0,
            2753.0,
            "LotB",
            0
        ],
        [
            88,
            "Regina Stewart",
            "249-31-3014",
            1610668800.0,
            2208.0,
            "LotA",
            0
        ],
        [
            75,
            "Richard Jones",
            "046-06-7966",
            1610496000.0,
            2616.0,
            "LotA",
            1
        ],
        [
            52,
            "Michelle Robinson",
            "086-48-3607",
            1610496000.0,
            1512.0,
            "LotB",
            1
        ],
        [
            6,
            "Rachel Garrett",
            "627-64-5459",
            1610409600.0,
            2555.0,
            "LotA",
            0
        ],
        [
            45,
            "Mrs. Jennifer Kelley",
            "301-15-7833",
            1610409600.0,
            2849.0,
            "LotC",
            1
        ]
    ]
}

Fix #48
Fix #52

@guzman-raphael guzman-raphael marked this pull request as ready for review February 11, 2021 05:45
Copy link
Contributor

@Synicix Synicix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few quick concerns, but otherwise looks good

Synicix
Synicix previously approved these changes Feb 11, 2021
Synicix
Synicix previously approved these changes Feb 11, 2021
@Synicix Synicix self-requested a review February 11, 2021 20:04
@Synicix Synicix merged commit e66e1c5 into datajoint:master Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for filtering fetch of records Add a proper pagination design

2 participants