Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In addition to what Harlan and Stefan said, let me share an example from the ODBC.jl package (<a href="https://github.com/karbarcca/ODBC.jl" rel="nofollow">source here</a>). One of my favorite features of Julia over other languages is how dead simple it is to create custom types (and without performance issues either!). Here's a custom type, Metadata, that simply holds several fields of data that describe an executed query. This doesn't necessarily need its own type, but it makes it more convenient passing all this data between functions as well as allowing custom formatting of its output by overloading the Base.show() function.</p> <pre><code>type Metadata querystring::String cols::Int rows::Int colnames::Array{ASCIIString} coltypes::Array{(String,Int16)} colsizes::Array{Int} coldigits::Array{Int16} colnulls::Array{Int16} end function show(io::IO,meta::Metadata) if meta == null_meta print(io,"No metadata") else println(io,"Resultset metadata for executed query") println(io,"------------------------------------") println(io,"Columns: $(meta.cols)") println(io,"Rows: $(meta.rows)") println(io,"Column Names: $(meta.colnames)") println(io,"Column Types: $(meta.coltypes)") println(io,"Column Sizes: $(meta.colsizes)") println(io,"Column Digits: $(meta.coldigits)") println(io,"Column Nullable: $(meta.colnulls)") print(io,"Query: $(meta.querystring)") end end </code></pre> <p>Again, nothing fancy, but illustrates how easy it really is to define a custom type and produce custom output along with it. </p> <p>Cheers.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload