- 关于postgresql几个高级用法
-- 查询某个表的字段信息列表
select a.attnum,a.attname,concat_ws('',t.typname,SUBSTRING(format_type(a.atttypid,a.atttypmod) from '(.*)')) as type,d.description from pg_class c, pg_attribute a , pg_type t, pg_description d
where c.relname = 'User' and a.attnum>0 and a.attrelid = c.oid and a.atttypid = t.oid and d.objoid=a.attrelid and d.objsubid=a.attnum
-- 查询表名
select tablename from pg_tables where schemaname='public' order by tablename
-- 查询当前表名 及 表名注释
select relname as tablename,cast(obj_description(relfilenode,'pg_class') as varchar) as comment from pg_class c
where relname in (select tablename from pg_tables where schemaname='public' and position('_2' in tablename)=0);
-- pg_class记录表、索引、序列、视图等对象的信息。
select * from pg_class;
-- 删除表sql - postgresql
DROP TABLE "CraftCategory"
- 待解决问题
vite在ubuntu上build失败问题,
vite + ts 时的报错,信息如下,
> bionic-web@0.0.1 build
> vue-tsc --noEmit && vite build --mode production
src/layout/Header/components/Avatar.vue:27:37 - error TS2307: Cannot find module '@/api/api/api.Account' or its corresponding type declarations.
27 import { Logout as logoutApi } from "@/api/api/api.Account";
~~~~~~~~~~~~~~~~~~~~~~~
--------------------- 省略很多
Found 25 errors in 14 files.
Errors Files
1 src/layout/Header/components/Avatar.vue:27
2 src/views/system/menu/index.vue:40
4 src/views/system/role/components/PermissionDrawer.vue:35
3 src/views/login/components/LoginForm.vue:63
2 src/views/system/department/index.vue:45
1 src/views/bionic/craftCategory/index.vue:45
2 src/views/system/role/index.vue:47
1 src/views/bionic/productModel/index.vue:48
1 src/views/bionic/energy/index.vue:49
1 src/views/bionic/graph/index.vue:49
2 src/views/bionic/device/index.vue:48
1 src/views/bionic/craft/index.vue:49
2 src/views/bionic/productCategory/index.vue:52
2 src/views/system/user/index.vue:57
疑似ts的类型严格检查错误, 尝试将tsconfig.json中的校验改为false后不起作用
/* Strict Type-Checking Options */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
- 思考: 多个service独立操作数据库表,如何做到事务
网友评论