{"id":21253922,"url":"https://github.com/courseorchestra/2bass","last_synced_at":"2025-07-11T01:33:31.042Z","repository":{"id":28243602,"uuid":"116288176","full_name":"CourseOrchestra/2bass","owner":"CourseOrchestra","description":"DB schema as code tool","archived":false,"fork":false,"pushed_at":"2024-11-09T15:44:20.000Z","size":558,"stargazers_count":42,"open_issues_count":13,"forks_count":16,"subscribers_count":7,"default_branch":"dev","last_synced_at":"2024-11-09T16:30:42.282Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CourseOrchestra.png","metadata":{"files":{"readme":"README.adoc","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}},"created_at":"2018-01-04T17:27:18.000Z","updated_at":"2024-08-02T16:44:20.000Z","dependencies_parsed_at":"2024-04-13T12:44:43.428Z","dependency_job_id":"fa0c2308-7c58-4d72-afa7-c8be68c7e2b2","html_url":"https://github.com/CourseOrchestra/2bass","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseOrchestra%2F2bass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseOrchestra%2F2bass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseOrchestra%2F2bass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseOrchestra%2F2bass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CourseOrchestra","download_url":"https://codeload.github.com/CourseOrchestra/2bass/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225669588,"owners_count":17505386,"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":[],"created_at":"2024-11-21T03:53:29.022Z","updated_at":"2024-11-21T03:53:29.612Z","avatar_url":"https://github.com/CourseOrchestra.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= 2BASS\n\nimage::https://ci.corchestra.ru/buildStatus/icon?job=2bass/dev[link=https://ci.corchestra.ru/job/2bass/job/dev/]\nimage:https://awesome.re/mentioned-badge.svg[\"Mentioned in Awesome database tools\", link=https://github.com/mgramin/awesome-db-tools]\n\n2bass is a database configuration-as-code tool that utilizes the concept of https://ponomarev.uk/blog/ddl[idempotent DDL scripts].\n\nThis is a derivative of link:https://github.com/CourseOrchestra/celesta[Celesta project], in particular, it uses link:https://courseorchestra.github.io/celesta/en/#CelestaSQL[CelestaSQL] as database definition language.\n\n:toc:\n\nimage::images/bass_duke.png[,200]\n\n== Current status\n\nThis project is in development phase. For binaries see link:https://github.com/CourseOrchestra/2bass/releases[releases], or see \u003c\u003cHow to build\u003e\u003e if you want to build the freshest binary yourself. If you want to contribute (suggestions/feature requests are very welcome!) please feel free to contact any of the contributors.\n\n== How to build from sources\n\nYou will need JDK 8 and Maven in order to build 2bass. If you want to run tests during the build, you will also need Docker to be installed. To build without compiling and running the tests, run\n\n mvn package -Dmaven.test.skip=true\n\n\nThe result of the build will be `target/2bass-\u003cVERSION\u003e-bin.zip` file.\n\n== How to install and run\n\nPrerequisites: JRE 8. Unzip `target/2bass-\u003cVERSION\u003e-bin.zip` file and make `bin` folder availiable on system path.\nRun `bass` command and check its output.\n\n== How to use\n* Usage example is available at https://github.com/inponomarev/2bass-demo.\n\n* Usage:\n\n bass \u003ccommand\u003e \u003coptions\u003e\n\n* Available commands are:\n\n** `validate`         Parse and validate SQL scripts (with no connection to database).\n** `init`             Initialize system `bass` schema.\n** `plan`             Generate and show DDL execution plan for review / manual exectution.\n** `apply`            Build or change database structure.\nSync your actual DB structure with the desired structure described in your SQL files.\nAll the ALTER commands are calculated and executed automatically. You may run `apply` without running `init` previously\n\n* Options are:\n\n [--debug] [--jdbc.password=\u003cpassword\u003e] [--jdbc.url=\u003curl\u003e]\n        [--jdbc.username=\u003cusername\u003e] [--outputFilePath=\u003cpath\u003e]\n        [--propertiesFile=\u003cpath\u003e] [--score.path=\u003cpath\u003e]\n\n**   `--debug`                      Debug mode: show exception stack traces\n**   `--jdbc.password=\u003cpassword\u003e`   Database password\n**   `--jdbc.url=\u003curl\u003e`             JDBC connection URL\n**   `--jdbc.username=\u003cusername\u003e`   Database user name\n**   `--outputFilePath=\u003cpath\u003e`      Path to write scripts to (for `plan` command)\n**   `--propertiesFile=\u003cpath\u003e`      Path to .properties file with options (options set\n                                in command line have higher priority)\n**   `--score.path=\u003cpath\u003e`          Path to SQL scripts\n\n* Write and modify your database schema using CelestaSQL, which is in fact the plain old DDL.\nЕ. g. you may use CREATE TABLE for table definition, and then simply add/modify columns in the script when you need it,\nno 'ALTER' commands in schema definition script. You may also use `EXEC NATIVE` blocks when you need to insert\ndatabase-specific code. See our https://github.com/inponomarev/2bass-demo[demo project] and https://courseorchestra.github.io/celesta/en/#CelestaSQL[CelestaSQL documentation].\n\n* Example outputs for `apply` and `plan` commands:\n\nimage::images/3_update_success.png[,600]\n\nimage::images/2_plan.png[,800]\n\n=== If something goes wrong during database migration\n\nSometimes bass is not able to perform the migration fully automatically. In this case will see the following:\n\nimage::images/3_update_failure.png[,800]\n\nand for further details you should look at the contents of the `bass.schemas` table. In `message`\nfield you will see the error that prevented the automatic migration. The meaning of numbers in `state` column is\nas following:\n\n* **0** -- schema created/migrated successfully, will not attempt to migrate unless the checksum of DDL script is changed.\n* **1** -- schema is currently in process of migration.\n* **2** -- migration error (see `message` column for details).\n* **3** -- force migration, regardless of DDL script checksum. In case of success the status will become **0**.\n* **4** -- never migrate this schema, regardless of DDL script changes.\n\nNormally in case of errors you should:\n\n1. Write and execute an ad hoc migration script.\n2. Change schema status to 3.\n3. Re-run `bass apply`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcourseorchestra%2F2bass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcourseorchestra%2F2bass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcourseorchestra%2F2bass/lists"}