DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: monica9612
今日帖子: 0
在线用户: 8
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 sxqwhxq (步惊云) ★☆☆☆☆ -
普通会员
2023/3/28 9:04:29
标题:
有办法改变sqlite3不支持修改主键定义吗? 浏览:1391
加入我的收藏
楼主: 感觉sqlite3是一个庵割了的数据库。表定义好后,如果想增加一列主键没办法。
----------------------------------------------
-
作者:
男 tuesdays (Tuesday) ▲▲▲▲△ -
普通会员
2023/3/28 14:15:02
1楼: 不然, 它为什么会半生不死呢?
----------------------------------------------
delphi界写python最强, python界写delphi最强. 写自己的代码, 让别人去运行.
作者:
男 wac1104 (火鸟) ★☆☆☆☆ -
普通会员
2023/3/29 9:15:22
2楼: 人家活得好好的,怎么就半生不死了。苹果、andorod  很多手机 嵌入式  里面用sqlite 应用场景主要是嵌入式,你非要和数据库服务器比?
----------------------------------------------
火鸟
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/3/29 10:23:03
3楼: SQLite Expert tools Slite3.dll v3.39.2
此帖子包含附件:
GIF 图像
大小:612.3K
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 sxqwhxq (步惊云) ★☆☆☆☆ -
普通会员
2023/3/29 12:00:18
4楼: 巴西大师,我的sqlite3是用C++加密的,在sqlite expert打不开,只能在sqlitestudio里打开。
----------------------------------------------
-
作者:
男 hardnut (麦轲数据管家) ★☆☆☆☆ -
普通会员
2023/3/29 19:44:15
5楼: sqlite比所有其它数据库活得都好。但它不是为database server准备的
----------------------------------------------
UniKeeper V10.40 -- 您最贴心的个人数据管理助手
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/3/30 0:26:30
6楼: Observation:

IF the ID have "data", then, maybe IS NOT POSSIBLE changing because it can be used in a "Foregner Key" relationship... 

Maybe you can create a new column, copy all ID data, delete any FK relationship, and try change the type... after this, try copy old data for it

---------- Solution 2

create a new DB with NO-Encryptation  and change the column type...
after, you can encrypt it as you need!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 sail2000 (小帆工作室) ★☆☆☆☆ -
盒子活跃会员
2023/3/30 18:46:09
7楼: https://sqlitebrowser.org/

这个呢?
此帖子包含附件:
PNG 图像
大小:73.7K
----------------------------------------------
delphi 是兴趣,和工作无关,即使它倒闭。又不靠它 delphi 吃饭,怕甚?
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/3/30 21:42:21
8楼: I think that, if the fields involved contain data already registered, then the type change cannot be done, as there would be loss of data.
In this way, to try a type change, for any of the fields involved, it would be necessary to do the following:

1) create new columns to receive the copy of the old data;
2) copy the old data to the new columns, respecting the data conversion;
3) if everything goes as expected, delete the old columns.

In case there is a relationship between tables (PK -> FK), it will be even more difficult for everything to end well, because there are many other factors involved...
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 sxqwhxq (步惊云) ★☆☆☆☆ -
普通会员
2023/3/31 12:33:25
9楼: @sail2000 (小帆工作室):
我是在lazarus里使用sqlite3,lazarus里没有firedac,不能对sqlite3加密。我现在用C自己编译了一段加密的dll/so,加密后只能用sqlite studio打开了,其它工具都不识别。
----------------------------------------------
-
作者:
男 blueflag (昆了) ★☆☆☆☆ -
盒子活跃会员
2023/3/31 17:34:10
10楼: 没有什么是不能用sql语言搞定的,直接用SQL语言就搞定了
----------------------------------------------
-
作者:
男 sxqwhxq (步惊云) ★☆☆☆☆ -
普通会员
2023/3/31 21:00:20
11楼: sql语句也搞不定
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/4/1 0:39:28
12楼: in Firebird you can create a UDF (DLL) and use it into database as a function...

question: in SQLite DB is not possible use UDF?

SQLite C Interface - Create Or Redefine SQL Functions
https://www.sqlite.org/c3ref/create_function.html

https://stackoverflow.com/questions/2108870/how-to-create-custom-functions-in-sqlite

https://github.com/pawelsalawa/sqlitestudio/wiki/Official_plugins#sql-built-in
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 sxqwhxq (步惊云) ★☆☆☆☆ -
普通会员
2023/4/2 19:59:36
13楼: 只能先建临时表,然后从原表中导入数据,再设置主键,最后删除原表。
----------------------------------------------
-
作者:
男 hardnut (麦轲数据管家) ★☆☆☆☆ -
普通会员
2023/4/4 8:26:07
14楼: sqlite 的schema变更功能不算强, 终极的做法就是楼上所述的办法.
https://www.sqlite.org/lang_altertable.html#otheralter
----------------------------------------------
UniKeeper V10.40 -- 您最贴心的个人数据管理助手
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行109.375毫秒 RSS