Dash datatable max page count

I have a sqllite3 database with ~1000 entries. I want to load the entries dynamically.

My layout for the dash datatable is :

layout = html.Div([
            dash_table.DataTable(
                id='datatable-testcaseinfo',
                columns=[
                    {"name": i, "id": i, "selectable": True}
                    for i in self._get_column_names()
                ],
                filter_action="native",
                sort_action="custom",
                sort_mode="multi",
                page_action="native",
                row_selectable="multi",
                selected_columns=[],
                selected_rows=[],
                page_current= 0,
                page_size=20,
                #page_count=50,
                derived_virtual_selected_rows=None
            ),

I load the data dynamically using callbacks :

@app.callback(
            Output('datatable-testcaseinfo', 'data'),
            [Input('datatable-testcaseinfo', "page_current"),
             Input('datatable-testcaseinfo', "page_size")]
        )
        def update_table(page_current, page_size):
            conn = self.connection()
            df = pd.read_sql_query(f"SELECT * from testcaseinfo WHERE rowid >= {page_current*page_size} AND rowid <= {(page_current+1)*page_size}", \
                conn)
            return df.to_dict('records')

How can I set the maximum number of pages to enable the pagination?

I tried using page_count=50 but it doesnt work

See some examples of DataTable pagination here: https://dash.plotly.com/datatable/height

I looked into them. In those example they provide the dataframe while defining the layout.

oh i see. if it’s backend pagination, then i don’t think it’s possible to set the “maximum page number” since we often don’t know it in advance. see examples here: https://dash.plotly.com/datatable/callbacks