module Onyx::SQL::Converters::SQLite3::UUIDText

Overview

Converts between the SQLite3 BLOB type and Crystal's UUID. See Field to read about of how to apply converters.

See the comparison of uuid converters at Converters::SQLite3::UUIDBlob.

CREATE TABLE users (
  uuid  TEXT,
  uuids TEXT
);
require "onyx-sql/converters/sqlite3/uuid_text"

class User
  include Onyx::SQL::Model

  schema do
    pkey uuid : UUID = UUID.random, converter: SQLite3::UUIDText
    type uuids : Array(UUID), converter: SQLite3::UUIDText
  end
end

Defined in:

onyx-sql/converters/sqlite3/uuid_text.cr

Class Method Summary

Class Method Detail

def self.from_rs(rs) : UUID? #

[View source]
def self.from_rs_array(rs) : ::Array(UUID)? #

[View source]
def self.to_db(value : UUID) : DB::Any #

[View source]
def self.to_db(values : Enumerable(UUID)) : DB::Any #

[View source]