Git Product home page Git Product logo

dotnetgen_mysql's Introduction

.NETCore 2.1 + Mysql generator

The author has been oriented to web application development for 13 years. In the project practice and learning, he replaced the old with the new, absorbed the advantages, accumulated from the direction of high quality, strong specification, and rapid development, and formed a generator tool to reduce the difficulty of project back-end development.

The navicat model tool creates and manages ER diagrams, imports/synchronizes structures from the database to the database, and then uses this generator to synchronize c# entities with one click, as well as various standardized styles and grammars that you can't imagine, supports caching, and supports databases 99% type, mining database characteristics, avoiding excessive duplication of labor and non-standard and unrobust codes.

Advantage:

    1. Generate a feature-rich database SDK based on primary key, unique key, and foreign key (1-to-1, 1-to-many, many-to-many);
    1. Strictly control the database, avoid creating tables or fields at will, and have standard ER diagram database specifications;
    1. Unify and standardize database operation classes and methods (compared with EF's too casual usage, which is much easier to manage), and concentrate on business;
    1. Optimize every detail, and never allow low-level errors to interfere with our business logic (compared to ORM, the generated code is more focused);

Suitable for the occasion:

    1. For new project development, only design data ER diagrams, without considering db related codes;
    1. The old project database access method is unsightly, the more tables, the greater the benefits;

Download the winform client of the generator, it is recommended to install the command tool dotnet tool install -g GenMy

Learning QQ group: 8578575


build on existing project

dotnet new mvc
GenMy database ip[:3306] -U login name -P password -D database1[,database2] -N namespace

Generate a complete modular solution

GenMy database ip[:3306] -U login name -P password -D database1[,database2] -N namespace -R -S -A

dotnetGen maintains the same development and usage habits, and realizes rapid development for three databases including mysql, SQLServer, and PostgreSQL, and can also be used in combination.

| Function comparison | dotnetGen_mysql | dotnetGen_sqlserver | dotnetGen_postgresql | | ----------------: | --------------: | --------------- ----: | -------------------: | | windows | √ | √ | √ | | linux | √ | √ | √ | | Connection Pool | √ | √ | √ | | Affairs | √ | √ | √ | | Multiple databases | √ | - | - | | Read-write separation | √ | √ | √ | | table | √ | √ | √ | | Table relationship (1 to 1) | √ | √ | √ | | Table relationship (1 to many) | √ | √ | √ | | Table relationship (many to many) | √ | √ | √ | | table primary key | √ | √ | √ | | table unique key | √ | √ | √ | | stored procedure | - | √ | - | | View | √ | √ | √ | | soft delete | √ | √ | √ | | Type Mapping | √ | √ | √ | | Enum | √ | - | √ | | Custom Type | - | - | √ | | gis | √ | - | √ | | array | - | - | √ | | Dictionary | - | - | √ | |xml|-|-|-| | json | - | - | √ | | Cache | √ | √ | √ | | Command line generation | √ | √ | √ | | RESTful | √ | √ | √ | | Background management function | √ | √ | √ |

Test database

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for song
-- ----------------------------
DROP TABLE IF EXISTS `song`;
CREATE TABLE `song` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `title` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'title',
   `url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'address',
   `create_time` datetime DEFAULT NULL COMMENT 'create time',
   PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Table structure for song_tag
-- ----------------------------
DROP TABLE IF EXISTS `song_tag`;
CREATE TABLE `song_tag` (
   `song_id` int(11) NOT NULL COMMENT 'song',
   `tag_id` int(11) NOT NULL COMMENT 'tag',
   PRIMARY KEY (`song_id`, `tag_id`),
   KEY `fk_song_tag_tag_1` (`tag_id`),
   CONSTRAINT `fk_song_tag_song_1` FOREIGN KEY (`song_id`) REFERENCES `song` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
   CONSTRAINT `fk_song_tag_tag_1` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Table structure for tags
-- ----------------------------
DROP TABLE IF EXISTS `tag`;
CREATE TABLE `tag` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `parent_id` int(11) DEFAULT NULL COMMENT 'parent label',
   `name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'name',
   PRIMARY KEY (`id`),
   KEY `fk_tag_tag_1` (`parent_id`),
   CONSTRAINT `fk_tag_tag_1` FOREIGN KEY (`parent_id`) REFERENCES `tag` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Table structure for topic
-- ----------------------------
DROP TABLE IF EXISTS `topic`;
CREATE TABLE `topic` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `title` varchar(255) DEFAULT NULL COMMENT 'title',
   `cardtype` enum('video','text 01','text 02','link') DEFAULT NULL COMMENT 'card type',
   `carddata` text COMMENT 'Card rendering data',
   `content` text COMMENT 'content',
   `clicks` bigint(20) unsigned DEFAULT NULL COMMENT 'clicks',
   `create_time` datetime DEFAULT NULL COMMENT 'create time',
   `update_time` datetime DEFAULT NULL COMMENT 'modified time',
   `order_time` datetime DEFAULT NULL COMMENT 'order time',
   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Introduction to the modular framework directory structure

Module

All business interface agreements are divided into modules and developed in parallel, independent of each other

Module/Admin The generated background management module can be accessed at http://localhost:5001/module/Admin

Module/Test Generated test module

WebHost

When compiling WebHost, the compilation result of Module/* will be copied to the current directory WebHost is only loaded on demand when running as the main engine

dotnetgen_mysql's People

Contributors

2881099 avatar fasteddys avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.