Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Use [Ibis](https://ibis-project.org/) to create on-demand databases, upload data, and query with Python expressions — get pandas or Arrow results back without writing SQL.

**Requirements:** Python 3.10+, **ibis-framework** ≥12,<13, **hotdata** ≥0.7,<0.9.
**Requirements:** Python 3.10+, **ibis-framework** ≥12,<13, **hotdata** ≥0.9,<0.10.

## Install

Expand Down Expand Up @@ -112,7 +112,7 @@ con.create_table(
)
```

Table names must be declared when the database is created — you cannot upload to a table name that was not listed in `tables=`.
Declaring table names in `tables=` is optional — loading into a table that was not declared creates it automatically as part of the load.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

super nit: the section intro still states the old requirement. Line 88 says "Declare a database and its tables", and the code comment on line 93 says "Declare the database and all table names up front". A reader meets a requirement at the top of the section and an optional rule at the bottom. Consider rewording line 93 to "Declare the database; table names are optional." (not blocking)


### Query

Expand Down Expand Up @@ -241,19 +241,21 @@ con = ibis.hotdata.connect(
api_url="https://api.hotdata.dev",
token="YOUR_API_KEY",
workspace_id="ws_...",
default_connection="my_postgres",
default_connection="<connection_id>", # a connection id, from con.list_catalogs()
default_schema="public",
)

t = con.table("orders") # resolves to my_postgres.public.orders
t = con.table("orders") # resolves to <connection_id>.public.orders
```

Discover what's available:
Discover what's available. Catalogs are connection **ids** — the `id` field of the
workspace's connections, as returned by `list_catalogs()` — not display names:

```python
con.list_catalogs() # connection IDs
con.list_databases(catalog="my_postgres") # schemas
con.list_tables(database=("my_postgres", "public")) # tables
con.list_catalogs() # connection ids
conn_id = con.list_catalogs()[0]
con.list_databases(catalog=conn_id) # schemas
con.list_tables(database=(conn_id, "public")) # tables
```

## What's supported
Expand Down
5 changes: 4 additions & 1 deletion src/ibis_hotdata/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,10 @@ def create_table(
temp: bool = False,
overwrite: bool = False,
) -> ir.Table:
"""Upload local data into a declared managed table.
"""Upload local data into a managed table.

The table does not have to be declared in advance: loading into an
undeclared table creates it automatically as part of the load.

``database``'s first element must be the instant database id returned
by ``create_database``, not its display name — Hotdata database names
Expand Down
Loading