{"id":20143973,"url":"https://github.com/bytemedirk/model-view-controller","last_synced_at":"2026-06-10T05:31:47.197Z","repository":{"id":254611431,"uuid":"846974759","full_name":"ByteMeDirk/model-view-controller","owner":"ByteMeDirk","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-27T06:42:10.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T23:43:35.480Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/ByteMeDirk.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":"2024-08-24T13:45:01.000Z","updated_at":"2024-08-24T21:16:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d9ccebd-343e-4434-95e9-f92a258a3529","html_url":"https://github.com/ByteMeDirk/model-view-controller","commit_stats":null,"previous_names":["bytemedirk/model-view-controller"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ByteMeDirk/model-view-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteMeDirk%2Fmodel-view-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteMeDirk%2Fmodel-view-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteMeDirk%2Fmodel-view-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteMeDirk%2Fmodel-view-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ByteMeDirk","download_url":"https://codeload.github.com/ByteMeDirk/model-view-controller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteMeDirk%2Fmodel-view-controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34139178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-13T22:08:14.661Z","updated_at":"2026-06-10T05:31:47.177Z","avatar_url":"https://github.com/ByteMeDirk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Model View Controller (MVC) Database Schema Manager\n\nThis package provides a flexible and powerful tool for managing database schemas using a Model-View-Controller (MVC)\narchitecture. It allows you to define your database models using YAML configuration files and automatically build,\nupdate, or drop database tables based on these configurations.\n\n## Features\n\n- **YAML-based Model Definition**: Define your database models using simple YAML configuration files.\n- **Automatic Schema Management**: Create, update, or drop database tables based on your model definitions.\n- **Schema Comparison**: Automatically detect and apply changes to existing tables.\n- **Force Mode**: Option to force updates even when data loss might occur.\n- **Flexible Column Types**: Support for a wide range of SQL column types.\n- **Database Agnostic**: Works with any database supported by SQLAlchemy.\n- **CLI Interface**: Easy-to-use command-line interface for managing your database schema.\n- **Logging**: Detailed logging of all operations for easy troubleshooting.\n\n## Installation\n\n```bash\npip install model-view-controller\n```\n\n## Usage\n\n### Directory Structure\n\nCreate a directory for your project with the following structure:\n\n```\nyour_project/\n├── config.yaml\n├── model1.yaml\n├── model2.yaml\n└── ...\n```\n\n### Configuration\n\n1. Create a `config.yaml` file in your project directory:\n\n```yaml\ndatabase:\n  connection: \"postgresql://username:password@localhost:5432/dbname\"\n  schema: \"public\"\n```\n\n2. Define your models in separate YAML files:\n\n```yaml\n# users.yaml\ncolumns:\n  - name: id\n    type: integer\n    primary_key: true\n    auto_increment: true\n  - name: name\n    type: string\n    length: 100\n  - name: email\n    type: string\n    length: 100\ndescription: \"Users table\"\n```\n\n### CLI Commands\n\n#### Build Schema\n\nTo build or update your database schema:\n\n```bash\nmvc build /path/to/your/project\n```\n\nOptions:\n\n- `--force`: Force column deletion even if it contains data\n- `--drop-tables`: Drop tables that exist in the database but not in configs\n\n#### Drop Schema\n\nTo drop all tables from the database schema:\n\n```bash\nmvc drop /path/to/your/project\n```\n\nOptions:\n\n- `--force`: Force drop without confirmation\n\n## Advanced Features\n\n### Column Type Mapping\n\nThe package supports a wide range of SQL column types, including:\n\n- Integer types: `integer`, `bigint`, `smallint`\n- String types: `string`, `text`\n- Floating-point types: `float`, `real`, `double`, `decimal`, `numeric`\n- Date and time types: `datetime`, `timestamp`, `time`, `date`\n- Binary types: `binary`, `large_binary`\n- Boolean type: `boolean`\n- Unicode types: `unicode`, `unicode_text`\n\n### Schema Comparison and Updates\n\nWhen running the `build` command, the tool will:\n\n1. Compare existing table schemas with the defined models\n2. Add new columns as needed\n3. Remove deleted columns (with confirmation or using `--force`)\n4. Update column types if they have changed\n\n### Logging\n\nThe package provides detailed logging of all operations, making it easy to track changes and troubleshoot issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytemedirk%2Fmodel-view-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytemedirk%2Fmodel-view-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytemedirk%2Fmodel-view-controller/lists"}