是否有 Rails 列類型的文檔? - Is there documentation for the Rails column types?

問題:

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章