Skip to content

生成符合各个数据库的有序Guid #142

@gmf520

Description

@gmf520

您的功能请求与现有问题有关吗?请描述

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

当前的Guid生成只符合SqlServer的排序规则,需要实现符合MySql,Sqlite,PostgreSql,Oracle等数据库排序规则的有序Guid

参考:https://www.cnblogs.com/CameronWu/p/guids-as-fast-primary-keys-under-multiple-database.html

描述您想要的解决方案

A clear and concise description of what you want to happen.

变更如下:

  • 取消原OSharp.Data.CombGuid的使用,使用新的OSharp.Data.SequentialGuid
  • Guid的生成由原来的EntityBase中变更到Repository执行Insert操作时
  • 判断实体所属的DbContext的数据库类型DatabaseType,根据不同的数据库类型生成不同排序规则的Guid

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions