What is a DBAPI ?
DB-API
A DB-API:
- A DB-API provides a standard for one programming language (like python) to talk to a relational database server.
- Is a low-level library for writing SQL statements that connect to a database.
- Also known as database adapters.
- Different DBAPIs exist for every server framework or language + database system.
- Database adapters define a standard for using a database (with SQL) and using the results of database queries as input data in the given language.
-- Turn a selected (SELECT * from some_table;) list of rows into an array of objects in Javascript for say a NodeJS adapter; or a list of tuples in Python for a Python adapter.
Examples across languages and server frameworks:
- For Ruby (e.g. for Sinatra, Ruby on Rails): pg.
- For NodeJS: node-Postgres.
- For Python (e.g. for Flask, Django): pyscopg2.
Comments
Post a Comment