liveBook · Manning

Database driver

As explained in Data-Oriented Programming: Reduce software complexity

A database driver is software that enables an application to communicate with a particular database system.

A database driver is the communication boundary between an application and a database. It sends queries and returns database state in a collection-friendly form, such as a list of maps. section 10.1

The driver need not dictate the application’s data manipulation. A SQL query retrieves rows, while generic functions can continue to manipulate those rows as data collections. section 10.1

Common ways to cross the database boundary include:

  • Use node-postgres to interface with PostgreSQL from JavaScript. section 10.1
  • Use JDBC in Java, optionally converting a result set into a list of maps. section 10.1
  • Defer detailed type handling until serialization, where a JSON schema can validate the returned structure. section 10.1

Book search

A driver executes a title search against the books table and returns matching rows containing title, ISBN, and publication year. The application can then serialize the result as JSON.

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Explains query execution, result conversion, late binding, and validation, but stops short of driver internals.
Examples
Uses a book search, SQL result tables, list-of-map results, node-postgres, and JDBC conversion.
What it assumes
Assumes basic application data handling and SQL, while demonstrating database access and result conversion directly.
What you can do after
Apply it via node-postgres or JDBC, convert results into data collections, and validate them before JSON serialization.
How it connects
Connects SQL, generic functions, JDBC, PostgreSQL, JSON serialization, and JSON schema.

Also explained in

Compare how 4 books explain database driver →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data-Oriented Programming: Reduce software complexity. The section links point to the parts of the book it draws on.