栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

DBAPIs and psycopg2

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

DBAPIs and psycopg2

We will sometimes want to interact with our database and use its results in a specific programming language. E.g. to build web applications or data pipelines in a specific language (Ruby, Python, Javascript, etc.) That’s where DBAPIs come in.

  • A DBAPI
    • provides a standard interface 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
    • is 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.

Example 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
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/460846.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号