{"id":15003033,"url":"https://github.com/erudika/para-dao-sql","last_synced_at":"2025-10-30T09:31:21.957Z","repository":{"id":29135752,"uuid":"116611697","full_name":"Erudika/para-dao-sql","owner":"Erudika","description":"A generic SQL DAO plugin for Para (H2, MySQL, MariaDB, ProstgreSQL, MS SQL Server, Oracle, SQLite)","archived":false,"fork":false,"pushed_at":"2024-10-31T09:24:08.000Z","size":308,"stargazers_count":5,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T17:06:50.653Z","etag":null,"topics":["backend","backend-services","h2-database","hikari","hikari-cp","jdbc","jdbc-protocol","ms-sql-server","mssql-database","mysql","oracle-database","oracle-db","para","plugin","postgresql","sql","sql-dao","sqlite"],"latest_commit_sha":null,"homepage":"https://paraio.org","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Erudika.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-08T00:56:32.000Z","updated_at":"2024-10-31T09:24:12.000Z","dependencies_parsed_at":"2024-05-16T11:25:57.655Z","dependency_job_id":"330f6c4c-e90d-415a-afda-64dc3d33429a","html_url":"https://github.com/Erudika/para-dao-sql","commit_stats":null,"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erudika%2Fpara-dao-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erudika%2Fpara-dao-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erudika%2Fpara-dao-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erudika%2Fpara-dao-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Erudika","download_url":"https://codeload.github.com/Erudika/para-dao-sql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238950485,"owners_count":19557533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["backend","backend-services","h2-database","hikari","hikari-cp","jdbc","jdbc-protocol","ms-sql-server","mssql-database","mysql","oracle-database","oracle-db","para","plugin","postgresql","sql","sql-dao","sqlite"],"created_at":"2024-09-24T18:55:17.481Z","updated_at":"2025-10-30T09:31:16.535Z","avatar_url":"https://github.com/Erudika.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://s3-eu-west-1.amazonaws.com/org.paraio/para.png)\n============================\n\n\u003e ### Generic SQL DAO plugin for Para\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.erudika/para-dao-sql/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.erudika/para-dao-sql)\n[![Join the chat at https://gitter.im/Erudika/para](https://badges.gitter.im/Erudika/para.svg)](https://gitter.im/Erudika/para?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n## What is this?\n\n**Para** was designed as a simple and modular back-end framework for object persistence and retrieval.\nIt enables your application to store objects directly to a data store (NoSQL) or any relational database (RDBMS)\nand it also automatically indexes those objects and makes them searchable.\n\nThis plugin allows Para to store data in virtually any SQL database.\n\n## Documentation\n\n### [Read the Docs](https://paraio.org/docs)\n\n## Getting started\n\nThe plugin is on Maven Central. Here's the Maven snippet to include in your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.erudika\u003c/groupId\u003e\n  \u003cartifactId\u003epara-dao-sql\u003c/artifactId\u003e\n  \u003cversion\u003e{see_green_version_badge_above}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAlternatively you can download the JAR from the \"Releases\" tab above put it in a `lib` folder alongside the server\nWAR file `para-x.y.z.war`. Para will look for plugins inside `lib` and pick up the plugin but the plugin itself will\ntry to load the correct driver and needs to know where to look for it. That's why you have to set the system property\n`loader.path=./lib`.\n\n### Supported database engines\n\n- SQL Server\n- PostgreSQL\n- MySQL\n- MariaDB\n- Redshift\n- H2 DB\n- Oracle\n- SQLite\n\n### Configuration\n\nHere are all the configuration properties for this plugin (these go inside your `application.conf`):\n```ini\npara.sql.driver = \"com.mysql.jdbc.Driver\"\npara.sql.url = \"mysql://localhost:3306\"\npara.sql.user = \"user\"\npara.sql.password = \"secret\"\n```\nFinally, set the DAO config property - for H2 DB this must be equal to `H2DAO`, for the other databases it should be:\n```ini\npara.dao = \"SqlDAO\"\n```\nThis could be a Java system property or part of a `application.conf` file on the classpath.\nThis tells Para to use the SqlDAO Data Access Object (DAO) implementation instead of the default.\n\nSQLite, for example, has the simplest configuration:\n```ini\npara.sql.driver = \"org.sqlite.JDBC\"\npara.sql.url = \"sqlite:/home/user/para.db\"\n```\n\nThe environment variable `para.sql.url` is required and provides the URL to connect to the SQL database.\nThe SQL DAO uses JDBC and will prefix your URL with the JDBC protocol, so you don't need to include the JDBC\nprotocol in your URL path. For example, to connect to a MySQL server with URL `mysql://localhost:3306`,\nthe SQL DAO will prefix this URL with the JDBC protocol to form the full URL `jdbc:mysql://localhost:3306`.\n\nThe URL you specify should also include in it's path the database to be used by Para. The SQL DAO will not\nautomatically create a **database** for you (though Para _does_ create **tables** within your database automatically),\nso you must use an existing database. For example, you cannot simply specify the URL to your MySQL cluster/server\n(`mysql://localhost:3306`), but rather you need to specify the path to an existing database\n(`mysql://localhost:3306/para`). Note that the user name and password you provide with `para.sql.user` and\n`para.sql.password` should correspond to the specific database you specify in the URL, and that user should have\ncomplete permissions within that database.\n\n\n### Using a JDBC Driver\n\nThe SQL DAO uses JDBC to connect to your SQL database, which means a SQL driver (java.sql.Driver) will be needed for\nyour chosen flavor of SQL (for example, `com.mysql.jdbc.Driver` is used for MySQL).  You must specify the\nfully-qualified class name for your SQL driver. Upon initialization, the SQL DAO will attempt to load this driver\nand verify that it exists in the classpath. If the driver cannot be found, the SQL DAO will fail to initiailize and\nthe DAO cannot be used.\n\nIn addition to specifying the driver name, you need to ensure the JAR file containing the SQL driver corresponding to\nyour database is on your classpath when launching Para Server. The easiest way to do this is to add your SQL driver's\nJAR file to the `lib/` directory relative to the location of the Para Server WAR file `para-x.y.z.war`.\n\n### Working with Oracle database\n\nTo use Oracle DB you need to create a user (schema) for Para, with `CREATE SESSION` and `CREATE TABLE` privileges.\nYou also need to enable writes on the USERS tablespace if you get an error like\n`ora-01950: no privileges on tablespace 'users'`.\n\n```sql\nCREATE USER para IDENTIFIED BY \u003cpassword\u003e;\nGRANT CREATE SESSION, CREATE TABLE TO para;\nALTER USER para quota unlimited on USERS;\n```\n\nThen the configuration will look something like this:\n```ini\npara.sql.driver = \"oracle.jdbc.OracleDriver\"\npara.sql.url = \"oracle:thin:@127.0.0.1:1521/XE\"\npara.sql.user = \"para\"\npara.sql.password = \"secret\"\n```\n\nIf you are have a `sysdba/sysoper` type of user, you can set `para.sql.user = \"para as sysdba\"`.\nThe plugin has been tested with the Express edition of Oracle 18c database.\n\n### Schema\n\n**BREAKING CHANGE:** The schema has changed in v1.30.0 - columns `timestamp` and `updated` were removed,\ncolumn `json_updates` was added. `H2DAO` attempts to apply these changes automatically or error, but `SqlDAO` does not.\n**Execute the following statements one after another before switching to the new version:**\n```sql\nALTER TABLE {app_identifier} DROP COLUMN timestamp, updated;\nALTER TABLE {app_identifier} ADD json_updates NVARCHAR;\n```\nThis is not required for tables created after v1.30.0.\n\nHere's the schema for each table created by Para:\n```sql\nCREATE TABLE {app_identifier} (\n    id            NVARCHAR NOT NULL,\n    type          NVARCHAR,\n    name          NVARCHAR,\n    parentid      NVARCHAR,\n    creatorid     NVARCHAR,\n    json          NVARCHAR,\n    json_updates  NVARCHAR\n)\n```\n\n### Dependencies\n\n- [HikariCP](https://github.com/brettwooldridge/HikariCP) for JDBC Connection Pooling\n- [Para Core](https://github.com/Erudika/para)\n\n## License\n[Apache 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferudika%2Fpara-dao-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferudika%2Fpara-dao-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferudika%2Fpara-dao-sql/lists"}