是否可以将自定义元数据添加到 SQLite 列? [英] Is it possible to add custom metadata to an SQLite column?

查看:60
本文介绍了是否可以将自定义元数据添加到 SQLite 列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以向 SQLite 列添加自定义元数据?还是我需要将其存储在单独的列或表中?

Is it possible to add custom metadata to an SQLite column? Or will I need to store it in a separate column or table?

我正在开发一个数据库,我想以某种形式存储列的单位,即以开尔文为单位的温度列.是否可以将其存储为附加到列的字符串或某种形式的自定义元数据?

I'm working on a database where I'd like to store the units of a column in some form, i.e. a Temperature column being in units of Kelvin. Is it possible to store this as a string or some form of custom metadata attached to the column?

推荐答案

我相信不会.您可以添加另一列.您还可以以某种方式将元数据编码为值([fruit:apple"、fruit:pear"、mineral:bauxite"、...]),但这会使大量数据变得更难处理且效率更低.

I believe no. You could add another column. You could also encode the metadata into the value somehow (["fruit:apple", "fruit:pear", "mineral:bauxite", ...]), but that makes a lot of data harder and less efficient to handle.

通常,您可能只需要一列中的一种数据.

Generally, you probably want only one type of data in a column anyway.

这篇关于是否可以将自定义元数据添加到 SQLite 列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆