問題:
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