What datatypes does Searchligh.jl support?

Viewed 385

Searchlight.jl is a Julia ORM library. I would like to know what datatypes does Searchlight.jl support. Searchlight.jl has no standalone documentation. The only one 'official document' we can refer to is some paragraph from Genie documentation. However, Genie documentation does not have a part of supported datatypes list / table.

Here are some examples from other frameworks / ORMs provided datatypes information:

1 Answers

SearchLight attempts to map all the common DB types for MySQL, PostgreSQL, and SQLite to their native Julia counterparts. They are defined within the specific adapter, as the const TYPE_MAPPINGS Dict.

For example, for MySQL:

const TYPE_MAPPINGS = Dict{Symbol,Symbol}( # Julia => MySQL
  :char       => :CHARACTER,
  :string     => :VARCHAR,
  :text       => :TEXT,
  :integer    => :INTEGER,
  :int        => :INTEGER,
  :float      => :FLOAT,
  :decimal    => :DECIMAL,
  :datetime   => :DATETIME,
  :timestamp  => :TIMESTAMP,
  :time       => :TIME,
  :date       => :DATE,
  :binary     => :BLOB,
  :boolean    => :BOOLEAN,
  :bool       => :BOOLEAN
)

Depending on what RDBMS you use, you can find them here.

MySQL: https://github.com/GenieFramework/SearchLightMySQL.jl/blob/master/src/SearchLightMySQL.jl

PostgreSQL: https://github.com/GenieFramework/SearchLightPostgreSQL.jl/blob/master/src/SearchLightPostgreSQL.jl

SQLite: https://github.com/GenieFramework/SearchLightSQLite.jl/blob/master/src/SearchLightSQLite.jl


Thanks for the question! Adrian here, creator of SearchLight and Genie. Sorry for the lack of documentation, unfortunately a lack of time has caused SearchLight to get less updates and support lately, mostly due to Genie, the more famous sibling, getting most of the user's interest :) Happy to say that I'm working on a massive SearchLight refactoring to simplify the API and improve performance, tests, and docs so hopefully there will be great news soon!

Related