All Projects → davidski → database_connections

davidski / database_connections

Licence: other
⚙️Demonstration code to connect R on MacOS to various database flavors.

Projects that are alternatives of or similar to database connections

Rom Sql
SQL support for rom-rb
Stars: ✭ 169 (+838.89%)
Mutual labels:  oracle, mariadb, mssql
json-sql-builder2
Level Up Your SQL-Queries
Stars: ✭ 59 (+227.78%)
Mutual labels:  oracle, mariadb, mssql
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (+12183.33%)
Mutual labels:  oracle, mariadb, mssql
Tadpolefordbtools
Stars: ✭ 523 (+2805.56%)
Mutual labels:  oracle, mariadb, mssql
laravel-adminer
Adminer database management tool for your Laravel application.
Stars: ✭ 45 (+150%)
Mutual labels:  oracle, mariadb, mssql
dbclient
데이터배이스 관리 / 자동 메일링 / Admin 자동화 / Database IDE Tool. SQL Development Helper. Support DBMS Oracle/Mysql/MS-SQL
Stars: ✭ 35 (+94.44%)
Mutual labels:  oracle, mariadb, mssql
Ebean
Ebean ORM
Stars: ✭ 1,172 (+6411.11%)
Mutual labels:  oracle, mariadb
Sqlinjectionwiki
A wiki focusing on aggregating and documenting various SQL injection methods
Stars: ✭ 623 (+3361.11%)
Mutual labels:  oracle, mssql
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+73177.78%)
Mutual labels:  oracle, mssql
Liquibase
Main Liquibase Source
Stars: ✭ 2,910 (+16066.67%)
Mutual labels:  oracle, mariadb
Dbshield
Database firewall written in Go
Stars: ✭ 620 (+3344.44%)
Mutual labels:  oracle, mariadb
Qxorm
QxOrm library - C++ Qt ORM (Object Relational Mapping) and ODM (Object Document Mapper) library - Official repository
Stars: ✭ 176 (+877.78%)
Mutual labels:  oracle, mariadb
swaggerql
Easily and simply convert SQL database into a REST API with Swagger documentation
Stars: ✭ 40 (+122.22%)
Mutual labels:  oracle, mariadb
Experdb Db2pg
eXperDB-DB2PG is a data migration solution that transfers data extracted from various DBMSs to eXperDB or PostgreSQL. Currently, Oracle and Oracle Spatial, MySQL, SQL Server(MS-SQL) and Sybase data can be transferred.
Stars: ✭ 24 (+33.33%)
Mutual labels:  oracle, mssql
K8cscan
K8Cscan大型内网渗透自定义插件化扫描神器,包含信息收集、网络资产、漏洞扫描、密码爆破、漏洞利用,程序采用多线程批量扫描大型内网多个IP段C段主机,目前插件包含: C段旁注扫描、子域名扫描、Ftp密码爆破、Mysql密码爆破、Oracle密码爆破、MSSQL密码爆破、Windows/Linux系统密码爆破、存活主机扫描、端口扫描、Web信息探测、操作系统版本探测、Cisco思科设备扫描等,支持调用任意外部程序或脚本,支持Cobalt Strike联动
Stars: ✭ 693 (+3750%)
Mutual labels:  oracle, mssql
Sharding Method
分表分库的新思路——服务层Sharding框架,全SQL、全数据库兼容,ACID特性与原生数据库一致,能实现RR级别读写分离,无SQL解析性能更高
Stars: ✭ 188 (+944.44%)
Mutual labels:  oracle, mariadb
sqle
SQLE is a SQL audit platform | SQLE 是一个支持多场景,原生支持 MySQL 审核且数据库类型可扩展的 SQL 审核工具
Stars: ✭ 731 (+3961.11%)
Mutual labels:  oracle, mssql
linkifier
Database reverse engineering
Stars: ✭ 32 (+77.78%)
Mutual labels:  oracle, mssql
Typeorm
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
Stars: ✭ 26,559 (+147450%)
Mutual labels:  oracle, mariadb
matador
Take your appclication by the horns
Stars: ✭ 59 (+227.78%)
Mutual labels:  mariadb, mssql

Database Connections

Connecting to Databases from R

Patterned after http://db.rstudio.com/

This walkthrough is for MacOS X users. Windows users may be able to achieve similar results through the use of Chocolatey, though research into the specific packages under Windows that match what homebrew installs is required.

These connectivity examples use DBI-compatible interfaces. DBI is a database interface specification that allows any compliant tool to communicate with databases without knowledge of the underlying database technology. Using DBI tooling allows both direct SQL queries through raw connections as well as tight integration with the tidyverse through the spiffy dbplyr package.

Database drivers must be written with DBI interfaces. Both native drivers and the generic (DBI-compliant) odbc connections are demonstrated. For Oracle and MS SQL Server, odbc is the only (free) connectivity option.

If you are only connecting to a single database type, the driver you choose is largely a matter of personal preference. If connecting to multiple different database types, using odbc will provide a more consistent interface. Connections made using odbc will appear in the connections tab of the RStudio IDE.

Install ODBC and Database Drivers

# install base odbc framework
brew install unixodbc

# Microsoft SQL Server, enabling it for use with odbc
brew install freetds --with-unixodbc
  
# PostgreSQL ODBC Drivers
brew install psqlodbc

# Maria/MySQL ODBC drivers
brew install mariadb-connector-c
brew install mariadb-connector-odbc

# SQLite ODBC Drivers
brew install sqliteodbc

Oracle Client Install

The Oracle client install is complicated. 😦

Download the Basic client and the ODBC drivers via
http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html. A (free) Oracle account is required. Place both ZIP files in your ~/Downloads directory.

sudo unzip -o ~/Downloads/instantclient-basic-macos.x64-12.2.0.1.0-2.zip -d /opt/ora12
sudo unzip -o ~/Downloads/instantclient-odbc-macos.x64-12.2.0.1.0-2.zip -d /opt/ora12

# patch the Oracle ODBC install script to fix an incorrectly specified library
# extension (.so -> .dylib)
sudo patch ./oracle_odbc_update.patch /opt/ora12/instantclient_12_2/odbc_update_ini.sh > patch.diff
sudo /opt/ora12/instantclient_12_2/odbc_update_ini.sh /usr/local

ln -s `pwd`/libclntsh.dylib.12.1 /usr/local/lib
ln -s `pwd`/libclntshcore.dylib.12.1 /usr/local/lib

Configure ODBC Drivers

Set /usr/local/etc/odbcinst.ini to the following to allow easy reference to the database drivers by name rather than by full file path:

[SQLite]
Driver = /usr/local/lib/libsqlite3odbc.dylib

[PostgreSQL]
Driver = /usr/local/lib/psqlodbcw.so

[MySQL]
Driver = /usr/local/lib/libmysqlclient.dylib

[MariaSQL]
Driver = /usr/local/lib/libmaodbc.dylib

[SQL Server]
Driver = /usr/local/lib/libtdsodbc.so

[Oracle 12c]
Description     = Oracle ODBC driver for Oracle 12c
Driver          = /usr/local/lib/libsqora.dylib.12.2
Setup           =
FileUsage       =
CPTimeout       =
CPReuse         =

Configure R packages

Install all the relevant R packages. We use DBI as the primary database interface, with odbc for ODBC connectivity. Native drivers for PostgreSQL, MariaDB/MySQL, and SQLite are also installed. In production, you can choose either native or ODBC drivers as you see fit.

install.packages("DBI")         # DBI framework
install.packages("odbc")        # odbc framework

# Native drivers
install.packages("RPostgres")
install.packages("RMariaDB")    # covers MariaDB and MySQL
install.packages("RSQLite")
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].