courseorchestra / 2bass Goto Github PK
View Code? Open in Web Editor NEWDB schema as code tool
License: GNU General Public License v3.0
DB schema as code tool
License: GNU General Public License v3.0
suggested foreign key instruction: /BASS IRRELEVANT VALUE IS {value}/
sets ERRONEOUS VALUES to {value}. All updated values are put to log along with key field values
suggested index instruction: /*DB AKA {comma delimieted names}*/
if 2bass sees that index with AKA name exists, then it considers it OK and doesn't make any changes to db
this enables us to use live index rebuilding in PostgreSQL, when we create the same index with new name and then drop the previous one
suggested instruction:
/* BASS CONTENTS {table name} [DELIMITER COMMA | TAB | COLON | SEMICOLON | 'USER DELIMITER' ] UPDATE METHOD [REPLACE | UPDATE] [KEEP TRIGGERS [ALL | FOR MATERIALIZED VIEWS | selected trigger] ENABLED] [VERSION {version number}
FILENAME |
INLINE CONTENTS
field1, field2
field1, field2
*/
The idea is to keep checksum for every defined table contents. If checksum (or version) has changed then the contents of table is updated.
Replace method assumes truncating table and inserting new values. Update methods assume inserting new, deleting excess, updating changed.
Operation assumes that indexed and triggers are turned off, but we can explicitly say to leave triggers on. It is necessary, for example, for materialized views.
Indempotent approach may seem resource consuming. But putting table contents to vcs is useful in a limited number of cases. And in most of this cases we need modest tables. That would be good alternative for option field, for example.
Suggested bass field instruction: /BASS NULL IS {value}/
unlike DEFAULT it doesn't set field DEFAULT property, just sets value if field value is null. IF field's property NOT NULL is set then the instruction is ignored.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.