Skip to content

Commit 9517629

Browse files
committed
docs: updates to README
1 parent fa350c4 commit 9517629

1 file changed

Lines changed: 29 additions & 7 deletions

File tree

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ from UTF-16, report errors in the exact format the standard demands, copy values
3030
into buffers the application supplied, and not crash when the application lies
3131
about how big those buffers are.
3232

33-
`stackable-odbc-core` is that shared part, written once. You supply only what is
34-
actually about your database, which is how to connect, how to run a query and
35-
how to read a row back. One macro then generates the C entry points the standard
36-
requires.
33+
`stackable-odbc-core` is that shared part, written once. What you supply is the
34+
part that really is about your database: how to connect and authenticate, how to
35+
run a query and read rows back, how your database's types map onto ODBC's, and
36+
how to answer its catalog questions. For a networked database that is a complete
37+
client in its own right, so it is a substantial piece of work — but none of it
38+
is ODBC. One macro then generates the C entry points the standard requires.
3739

3840
This is a library rather than a driver you can load on its own. A working driver
3941
is this crate plus a backend, and
@@ -136,6 +138,14 @@ backend supports.
136138
In practice you do not look the list up. Write the four associated types, run
137139
`cargo check`, and the compiler names what is still missing.
138140

141+
Two traits and one macro bound the surface, not the effort. A backend for a
142+
real database is a real client: authentication, sessions, type mapping, catalog
143+
queries and error mapping are all yours, and in both existing drivers that adds
144+
up to a substantial crate. What core takes off your hands is the ODBC half —
145+
the handle table, the UTF-16, the diagnostics format, the buffer copying and
146+
the conversion tables — the half that is identical for every database, and the
147+
half where a mistake is memory corruption rather than a wrong answer.
148+
139149
[AGENTS.md](https://github.com/stackabletech/stackable-odbc-core/blob/main/AGENTS.md)
140150
has the full walkthrough: how a call flows through the layers, what each
141151
capability method means, the catalog and descriptor rules, and the Windows
@@ -150,6 +160,13 @@ five descriptor functions work. Descriptors are the standard's own way of
150160
describing a bound column or parameter, and one can be shared between queries on
151161
a connection.
152162

163+
This is a Unicode driver: every function that takes or returns a string is
164+
exported only in its wide (`W`-suffixed) form, such as `SQLConnectW`, and the
165+
Driver Manager translates for ANSI applications, so those keep working without
166+
the driver carrying a second set of entry points. Functions with no strings in
167+
their signature, such as `SQLFetch`, have one spelling and are exported
168+
unsuffixed.
169+
153170
`CORE_EXPORTED_FUNCTIONS` in `src/function_id.rs` is the authoritative list of
154171
what is exported, and a guard test pins every entry to a symbol that exists. The
155172
deprecated ODBC 2.x functions are left out, because the Driver Manager already
@@ -172,9 +189,14 @@ ignored, so a tool can react instead of trusting a wrong answer.
172189
- **No bookmarks**, which are saved row positions an application can return to
173190
later, and no automatic population of parameter metadata, so
174191
`SQL_ATTR_AUTO_IPD` stays `SQL_FALSE`.
175-
- **No async.** `Backend` is synchronous. A driver built on an async client
176-
library bridges to it internally, for example with a current-thread tokio
177-
runtime and `block_on`.
192+
- **No async.** Every call runs to completion before returning:
193+
`SQL_ASYNC_MODE` is reported as `SQL_AM_NONE`, and turning on
194+
`SQL_ATTR_ASYNC_ENABLE` is refused rather than ignored. This is about the
195+
calling thread, not the shape of the results — rows still arrive one
196+
`SQLFetch` at a time, and the query timeout and `SQLCancel` still bound and
197+
interrupt a slow query. `Backend` is likewise synchronous, so a driver built
198+
on an async client library bridges to it internally, for example with a
199+
current-thread tokio runtime and `block_on`.
178200

179201
## Drivers built on this crate
180202

0 commit comments

Comments
 (0)