All Projects → r-dbi → Rmariadb

r-dbi / Rmariadb

Licence: other
An R interface to MariaDB

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Rmariadb

Phpmyfaq
phpMyFAQ - Open Source FAQ web application for PHP and MySQL, PostgreSQL and other databases
Stars: ✭ 494 (+474.42%)
Mutual labels:  database, mariadb
Dbshield
Database firewall written in Go
Stars: ✭ 620 (+620.93%)
Mutual labels:  database, mariadb
Denodb
MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno
Stars: ✭ 498 (+479.07%)
Mutual labels:  database, mariadb
Bitnami Docker Mariadb
Bitnami MariaDB Docker Image
Stars: ✭ 251 (+191.86%)
Mutual labels:  database, mariadb
Mysqldump Php
PHP version of mysqldump cli that comes with MySQL
Stars: ✭ 975 (+1033.72%)
Mutual labels:  database, mariadb
Jet
Type safe SQL builder with code generation and automatic query result data mapping
Stars: ✭ 373 (+333.72%)
Mutual labels:  database, mariadb
Mariadb4j
MariaDB Embedded in Java JAR
Stars: ✭ 579 (+573.26%)
Mutual labels:  database, mariadb
Ocaml Caqti
Cooperative-threaded access to relational data
Stars: ✭ 175 (+103.49%)
Mutual labels:  database, mariadb
Mariadb Container
MariaDB container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
Stars: ✭ 19 (-77.91%)
Mutual labels:  database, mariadb
Ansible Role Mysql
Ansible Role - MySQL
Stars: ✭ 826 (+860.47%)
Mutual labels:  database, mariadb
Liquibase
Main Liquibase Source
Stars: ✭ 2,910 (+3283.72%)
Mutual labels:  database, mariadb
Ebean
Ebean ORM
Stars: ✭ 1,172 (+1262.79%)
Mutual labels:  database, mariadb
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 2,315 (+2591.86%)
Mutual labels:  database, mariadb
Evolve
Database migration tool for .NET and .NET Core projects. Inspired by Flyway.
Stars: ✭ 477 (+454.65%)
Mutual labels:  database, mariadb
Mysql
MySQL driver for Deno
Stars: ✭ 187 (+117.44%)
Mutual labels:  database, mariadb
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 (+30782.56%)
Mutual labels:  database, mariadb
Pomelo.entityframeworkcore.mysql
Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector
Stars: ✭ 2,099 (+2340.7%)
Mutual labels:  database, mariadb
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (+2470.93%)
Mutual labels:  database, mariadb
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 7,712 (+8867.44%)
Mutual labels:  database, mariadb
Dbbench
🏋️ dbbench is a simple database benchmarking tool which supports several databases and own scripts
Stars: ✭ 52 (-39.53%)
Mutual labels:  database, mariadb

RMariaDB

rcc Codecov test coverage CRAN_Status_Badge CRAN RStudio mirror downloads

RMariaDB is a database interface and MariaDB driver for R. This version is aimed at full compliance with the DBI specification, as a replacement for the old RMySQL package.

Hello World

library(DBI)
# Connect to my-db as defined in ~/.my.cnf
con <- dbConnect(RMariaDB::MariaDB(), group = "my-db")

dbListTables(con)
dbWriteTable(con, "mtcars", mtcars)
dbListTables(con)

dbListFields(con, "mtcars")
dbReadTable(con, "mtcars")

# You can fetch all results:
res <- dbSendQuery(con, "SELECT * FROM mtcars WHERE cyl = 4")
dbFetch(res)
dbClearResult(res)

# Or a chunk at a time
res <- dbSendQuery(con, "SELECT * FROM mtcars WHERE cyl = 4")
while(!dbHasCompleted(res)){
  chunk <- dbFetch(res, n = 5)
  print(nrow(chunk))
}
# Clear the result
dbClearResult(res)

# Disconnect from the database
dbDisconnect(con)

Installation

Binary packages for OS X or Windows can be installed directly from CRAN:

install.packages("RMariaDB")

The development version from github:

# install.packages("devtools")
devtools::install_github("r-dbi/DBI")
devtools::install_github("r-dbi/RMariaDB")

Discussions associated with DBI and related database packages take place on R-SIG-DB. The website Databases using R describes the tools and best practices in this ecosystem.

Installation from source on Linux or OS X currently requires Oracle's libmysqlclient or the more modern MariaDB Connector/C. The latter works best in version 2.3.4/3.0.3 or later, with older versions character and blob columns do not work reliably.

MySQL client library

On recent Debian or Ubuntu install libmysqlclient-dev.

sudo apt-get install -y libmysqlclient-dev

On Fedora, CentOS or RHEL we need mysql-devel, see https://apps.fedoraproject.org/packages/mysql-devel:

sudo yum install mysql-devel

Follow instructions to enable the MySQL yum repository if the above command attempts to install MariaDB files.

On OS X use mysql-connector-c from Homebrew:

brew install mysql-connector-c++

Connector/C

On recent Debian or Ubuntu install libmariadbclient-dev.

sudo apt-get install -y libmariadbclient-dev

On Fedora, CentOS or RHEL we need mariadb-devel:

sudo yum install mariadb-devel

On OS X use mariadb-connector-c from Homebrew:

brew install mariadb-connector-c

MariaDB configuration file

Instead of specifying a username and password in calls to dbConnect(), it's better to set up a MariaDB configuration file that names the databases that you connect to most commonly. This file should live in ~/.my.cnf and look like:

[database_name]
option1=value1
option2=value2

If you want to run the examples, you'll need to set the proper options in the [rs-dbi] group of any MariaDB option file, such as /etc/my.cnf or the .my.cnf file in your home directory. For a default single user install of MariaDB, the following code should work:

[rs-dbi]
database=test
user=root
password=

Acknowledgements

Many thanks to Christoph M. Friedrich, John Heuer, Kurt Hornik, Torsten Hothorn, Saikat Debroy, Matthew Kelly, Brian D. Ripley, Mikhail Kondrin, Jake Luciani, Jens Nieschulze, Deepayan Sarkar, Louis Springer, Duncan Temple Lang, Luis Torgo, Arend P. van der Veen, Felix Weninger, J. T. Lindgren, Crespin Miller, and Michal Okonlewski, Seth Falcon and Paul Gilbert for comments, suggestions, bug reports, and patches to the original RMySQL package, and to all contributors (of code and discussions) to this package.


Please note that the 'RMariaDB' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

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].