timescale / python-vector

https://timescale.github.io/python-vector/
Apache License 2.0
19 stars 1 forks source link

columns are hard coded. #27

Open srinivas-gurani opened 3 weeks ago

srinivas-gurani commented 3 weeks ago

https://github.com/timescale/python-vector/blob/34e51abff2f401f0e8aea71d5537b193a6fe34cb/timescale_vector/client.py#L768

    query = '''
    SELECT
        id, metadata, contents, embedding, {distance} as distance
    FROM
       {table_name}
    WHERE 
       {where}
    {order_by_clause}
    LIMIT {limit}
    '''.format(distance=distance, order_by_clause=order_by_clause, where=where, table_name=self.table_name, limit=limit)
    return (query, params)

Can we select which column we need? or pass different column names?

cevian commented 3 weeks ago

@srinivas-gurani what's the use-case here? Are all the same columns present and just have different names or is there a different schema altogether?

The library creates the tables as well and assumes a certain layout of the tables. It's easy to make the names configurable but I am wondering if you actually need some deeper changes.