问题:
I'm looking for more than the simple type listing that is found on this page :我正在寻找的不仅仅是此页面上的简单类型列表:
:primary_key, :string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean :primary_key, :string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean
But is there any documentation that actually defines these fields?但是是否有任何文档实际定义了这些字段?
Specifically:具体来说:
- What's the difference between
:string
and:text
?:string
和:text
什么区别? - Between
:float
and:decimal
?在:float
和:decimal
? - What are the distinguishing features of
:time
,:timestamp
, and:datetime
?:time
,:timestamp
和:datetime
的显着特征是什么?
Are the nuances of these types documented anywhere?这些类型的细微差别是否记录在任何地方?
EDIT: Points of DB-platform implementations are irrelevant to the question I'm trying to ask.编辑: DB 平台实现的要点与我要问的问题无关。 If, say, :datetime
does not have a defined intended meaning in Rails documentation, then what do db-adapter-writers go by when choosing a corresponding column type?例如,如果:datetime
在 Rails 文档中没有定义的预期含义,那么 db-adapter-writers 在选择相应的列类型时会怎么做?
解决方案:
参考一: https://en.stackoom.com/question/nssq参考二: https://stackoom.com/question/nssq