From 0daa1c18d70b9b6b19ec7dc0fb71d1b404417ae5 Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Tue, 21 Jun 2016 12:08:51 -0300 Subject: [PATCH] DRY DB::TYPES and DB::Any --- src/db.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/db.cr b/src/db.cr index b7d1f9b..ecadc3e 100644 --- a/src/db.cr +++ b/src/db.cr @@ -72,8 +72,10 @@ module DB # method to be used as query parameters TYPES = [Nil, String, Int32, Int64, Float32, Float64, Slice(UInt8)] - # See `DB::TYPES` in `DB`. `Any` is a nillable version of the union of all types in `DB::TYPES` - alias Any = Nil | String | Int32 | Int64 | Float32 | Float64 | Slice(UInt8) + # See `DB::TYPES` in `DB`. `Any` is a union of all types in `DB::TYPES` + {% begin %} + alias Any = Union({{*TYPES}}) + {% end %} # Result of a `#exec` statement. record ExecResult, rows_affected : Int32, last_insert_id : Int64