Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oracle生成的表,有双引号,在plsql dev里面直接打开表,提示找不到表 #6

Closed
jetydu opened this issue Feb 21, 2019 · 6 comments

Comments

@jetydu
Copy link

jetydu commented Feb 21, 2019

oracle生成的表,有双引号,在plsql dev里面直接打开表,提示找不到表,最好能把双引号去掉,不然用plsql dev比较麻烦
internal override string QuoteSqlName(string name) => $"{name.Trim('"')}";

@2881099
Copy link
Collaborator

2881099 commented Feb 21, 2019

不加双引号使用,其实是转成大写执行。

声明 FreeSql 的时候有一个选项:
.UseSyncStructureToLower(true) //转小写同步结构

@2881099
Copy link
Collaborator

2881099 commented Feb 21, 2019

image

@2881099
Copy link
Collaborator

2881099 commented Feb 21, 2019

哦小写貌似也不行,这个选项是针对 pgsql 加的,看来 oracle 下还是不适合加双引号

@2881099
Copy link
Collaborator

2881099 commented Feb 21, 2019

一类人:加双引号能保留表名、字段名的原型(大小写混用)。
另一类人:不加的话会显示成全大写,其实也比较蛋疼。

刚才去掉双引号,运行单元测试时候出现的错误:

1、自增序列名也找不见了,由于之前是加双引号的;
2、CodeFirst迁移脚本执行出错(这项有些伤,可能是测试的名称与oracle自有的冲突);
。。。后面发现错误再整理进来

@2881099
Copy link
Collaborator

2881099 commented Feb 21, 2019

声明 FreeSql 的时候增加了一个选项:
.UseQuoteSqlName(false) //默认是true,数据库名称使用 [] 或 `` 或 "" 包含起来,取决于数据库类别

@2881099
Copy link
Collaborator

2881099 commented Apr 8, 2019

后来我想到了一个更好的解决办法
UseSyncStructureToUpper(true)

这样迁移后就是大写了,完美解决你的问题。

@2881099 2881099 closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants