{"id":13528943,"url":"https://github.com/markuman/mex-mariadb","last_synced_at":"2026-04-11T15:36:51.972Z","repository":{"id":70098347,"uuid":"127146920","full_name":"markuman/mex-mariadb","owner":"markuman","description":"MariaDB Client for GNU Octave (maybe this is compatible for MySQL and Matlab too)","archived":false,"fork":false,"pushed_at":"2022-11-04T07:50:56.000Z","size":29,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-26T05:56:18.351Z","etag":null,"topics":["gnu-octave","mariadb","matlab","mysql","octave"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markuman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-28T13:46:13.000Z","updated_at":"2023-02-15T09:44:30.000Z","dependencies_parsed_at":"2023-03-11T07:58:55.143Z","dependency_job_id":null,"html_url":"https://github.com/markuman/mex-mariadb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/markuman/mex-mariadb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuman%2Fmex-mariadb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuman%2Fmex-mariadb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuman%2Fmex-mariadb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuman%2Fmex-mariadb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markuman","download_url":"https://codeload.github.com/markuman/mex-mariadb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuman%2Fmex-mariadb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31686140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnu-octave","mariadb","matlab","mysql","octave"],"created_at":"2024-08-01T07:00:29.282Z","updated_at":"2026-04-11T15:36:51.938Z","avatar_url":"https://github.com/markuman.png","language":"C","funding_links":[],"categories":["Connectors"],"sub_categories":[],"readme":"# mex mariadb client\n\n[![pipeline status](https://gitlab.com/markuman/mex-mariadb/badges/master/pipeline.svg)](https://gitlab.com/markuman/mex-mariadb/commits/master)\n\n\n* https://git.osuv.de/m/mex-mariadb\n* Pull Mirror: https://gitlab.com/markuman/mex-mariadb\n* Push Mirror: https://github.com/markuman/mex-mariadb\n\n* test compiling\n  * MariaDB 5.5 @ Centos 7 \n  * MariaDB 10.2 @ Alpine Linux\n  * MariaDB 10.3.29 @ macOS Big Sur 11.7.1  \n* run tests against\n  * MariaDB 10.1\n  * MariaDB 10.2\n  * MariaDB 10.3\n  * MySQL 5.7\n\n\n# Build\n\n```\n$ make\nmkoctfile --mex  -L/usr/lib  -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto -I/usr/include/mysql mariadb.c\n```\n\nOn macOS use `make macos_mariadb` or `make macos_mysql` depending on which binaries are installed (MariaDB or MySQL). Use Homebrew to install the binary libraries with `brew install mariadb` or `brew install mysql`.\n\n\n# example\n\nyou can take a look at `gitlabci.m` file too. the classdef file `mariadb.m` and the mex file `mariadb_.mex` are both used for testing.\n\n## class def example\n```\noctave:1\u003e sql = mariadb('hostname', '127.0.0.1', 'password', 'password');\noctave:2\u003e sql.query('create database octave')\nans = [](0x0)\n```\n\nto change a database, you can recreate your class  \nor change the property `sql.database = 'octave'`.\n\n```\noctave:3\u003e sql = mariadb('hostname', '127.0.0.1', 'password', 'password', 'database', 'octave');\noctave:4\u003e sql.query('create table a (idx int)');\noctave:5\u003e sql.query('insert into a (idx) values (1),(2),(3),(4)');\noctave:6\u003e sql.query('select * from a')\nans =\n{\n  [1,1] = idx\n  [2,1] = 1\n  [3,1] = 2\n  [4,1] = 3\n  [5,1] = 4\n}\n```\n\nyou can change the output format to matrix\n\n```\noctave:7\u003e sql.output = 'mat'\nsql =\n\n\u003cobject mariadb\u003e\n\noctave:8\u003e sql.query('select * from a')\nans =\n\n   NaN\n     1\n     2\n     3\n     4\n\noctave:9\u003e\n```\n\n## return structure\n\nthe return structure is always a cell.\n\n```\noctave:1\u003e a = mariadb_('127.0.0.1', 3306, 'root', 'password', 'testdb', 'select * from a')\na =\n{\n  [1,1] = idx\n  [2,1] = 1\n  [3,1] = 2\n  [4,1] = 8\n  [5,1] = 1\n  [6,1] = 2\n  [7,1] = 8\n  [1,2] = b\n  [2,2] = NULL\n  [3,2] = NULL\n  [4,2] = NULL\n  [5,2] = 1\n  [6,2] = 2\n  [7,2] = 3\n}\n```\n\n```\nselect * from a;\n\nidx |b |\n----|--|\n1   |  |\n2   |  |\n8   |  |\n1   |1 |\n2   |2 |\n8   |3 |\n```\n\n# mariadb()\n\n## properties\n\n* `hostname`\n  * char, default `localhost`\n* `port`\n  * number, default `3306`\n* `username`\n  * char, default `root`\n* `password`\n  * char, default `password`\n* `database`\n  * char, default empty string. Connects to no database\n* `command`\n  * char, sql command\n* `is_octave`\n  * boolean, determines if class was init on matlab or octave\n* `output`\n  * char, defines the output format. currently supports only `mat` and `cell`\n\n## methods\n\n* `query(command)`\n  * executes sql command\n* `to_mat()`\n  * only used internally to convert the cell output to matrix format.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkuman%2Fmex-mariadb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkuman%2Fmex-mariadb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkuman%2Fmex-mariadb/lists"}