From 607472c3cba5999adf35dd1e8824b3859d5f81ac Mon Sep 17 00:00:00 2001 From: jwoertink Date: Fri, 29 Dec 2023 22:12:03 +0000 Subject: [PATCH] deploy: 9ad64b90928458e07e35b6a02a404aa6fb90de33 --- Array.html | 12 +- Avram.html | 32 +++--- Avram/AddColumnAttributes.html | 2 +- Avram/Associations.html | 4 +- Avram/Associations/BelongsTo.html | 4 +- Avram/Associations/HasMany.html | 4 +- Avram/Associations/HasOne.html | 4 +- Avram/Attribute.html | 56 +++++----- Avram/Attribute/ErrorMessage.html | 2 +- Avram/AvramError.html | 2 +- Avram/BaseQueryTemplate.html | 4 +- Avram/BetweenCriteria.html | 2 +- Avram/CallableErrorMessage.html | 4 +- Avram/Callbacks.html | 32 +++--- Avram/ChronoUnits.html | 46 ++++---- Avram/Connection.html | 12 +- Avram/ConnectionError.html | 8 +- Avram/Credentials.html | 28 ++--- Avram/Criteria.html | 50 ++++----- Avram/Database.html | 82 +++++++------- Avram/Database/ColumnInfo.html | 42 +++---- Avram/Database/DatabaseCleaner.html | 8 +- Avram/Database/DatabaseInfo.html | 16 +-- Avram/Database/FiberId.html | 2 +- Avram/Database/TableInfo.html | 24 ++-- Avram/DatabaseValidations.html | 2 +- Avram/DefineAttribute.html | 12 +- Avram/DeleteOperation.html | 20 ++-- Avram/DeleteOperation/OperationStatus.html | 8 +- Avram/DeleteOperationTemplate.html | 4 +- Avram/Events.html | 2 +- Avram/Events/DeleteFailedEvent.html | 10 +- Avram/Events/DeleteSuccessEvent.html | 6 +- Avram/Events/FailedQueryEvent.html | 12 +- Avram/Events/QueryEvent.html | 10 +- Avram/Events/SaveFailedEvent.html | 12 +- Avram/Events/SaveSuccessEvent.html | 8 +- Avram/ExtractCriteria.html | 2 +- Avram/Factory.html | 26 ++--- Avram/FailedMigration.html | 8 +- Avram/FailedOperation.html | 2 +- Avram/GenericAttribute.html | 18 +-- Avram/HabitatSettings.html | 2 +- Avram/I18n.html | 4 +- Avram/I18nBackend.html | 8 +- Avram/ImpossibleValidation.html | 6 +- Avram/IncludesCriteria.html | 2 +- Avram/InheritColumnAttributes.html | 4 +- Avram/Insert.html | 8 +- Avram/Insert/Params.html | 2 +- Avram/InvalidDatabaseNameError.html | 2 +- Avram/InvalidOperationError.html | 16 +-- Avram/InvalidQueryError.html | 2 +- Avram/Join.html | 2 +- Avram/Join/Full.html | 4 +- Avram/Join/Inner.html | 4 +- Avram/Join/Left.html | 4 +- Avram/Join/Right.html | 4 +- Avram/Join/SqlClause.html | 20 ++-- Avram/LazyLoadError.html | 8 +- Avram/MarkAsFailed.html | 4 +- Avram/Migrator.html | 6 +- Avram/Migrator/AlterExtensionStatement.html | 8 +- Avram/Migrator/AlterTableStatement.html | 46 ++++---- Avram/Migrator/BuildReferenceFragment.html | 6 +- Avram/Migrator/ChangeNullStatement.html | 6 +- Avram/Migrator/Columns.html | 20 ++-- Avram/Migrator/Columns/Base.html | 30 ++--- Avram/Migrator/Columns/BoolColumn.html | 6 +- Avram/Migrator/Columns/BytesColumn.html | 6 +- Avram/Migrator/Columns/Float32Column.html | 6 +- Avram/Migrator/Columns/Float64Column.html | 6 +- Avram/Migrator/Columns/FloatColumn.html | 8 +- Avram/Migrator/Columns/Int16Column.html | 6 +- Avram/Migrator/Columns/Int32Column.html | 6 +- Avram/Migrator/Columns/Int64Column.html | 6 +- Avram/Migrator/Columns/JSON.html | 2 +- Avram/Migrator/Columns/JSON/AnyColumn.html | 8 +- Avram/Migrator/Columns/PrimaryKeys.html | 10 +- Avram/Migrator/Columns/PrimaryKeys/Base.html | 6 +- .../Columns/PrimaryKeys/Int16PrimaryKey.html | 6 +- .../Columns/PrimaryKeys/Int32PrimaryKey.html | 6 +- .../Columns/PrimaryKeys/Int64PrimaryKey.html | 6 +- .../Columns/PrimaryKeys/UUIDPrimaryKey.html | 8 +- Avram/Migrator/Columns/StringColumn.html | 6 +- Avram/Migrator/Columns/TimeColumn.html | 8 +- Avram/Migrator/Columns/UUIDColumn.html | 6 +- Avram/Migrator/CreateExtensionStatement.html | 6 +- Avram/Migrator/CreateForeignKeyStatement.html | 6 +- Avram/Migrator/CreateFunctionStatement.html | 8 +- Avram/Migrator/CreateIndexStatement.html | 6 +- .../CreateIndexStatement/IndexTypes.html | 12 +- Avram/Migrator/CreateTableStatement.html | 20 ++-- Avram/Migrator/CreateTriggerStatement.html | 6 +- Avram/Migrator/DropExtensionStatement.html | 6 +- Avram/Migrator/DropForeignKeyStatement.html | 6 +- Avram/Migrator/DropFunctionStatement.html | 6 +- Avram/Migrator/DropIndexStatement.html | 8 +- Avram/Migrator/DropTableStatement.html | 6 +- Avram/Migrator/DropTriggerStatement.html | 6 +- Avram/Migrator/IndexStatementHelpers.html | 6 +- .../IndexStatementHelpers/Columns.html | 2 +- Avram/Migrator/Migration.html | 2 +- Avram/Migrator/Migration/V1.html | 18 +-- Avram/Migrator/Migration/V1/MigrationId.html | 2 +- Avram/Migrator/MigrationGenerator.html | 16 +-- .../MissingOnDeleteWithBelongsToError.html | 4 +- Avram/Migrator/Runner.html | 44 ++++---- Avram/Migrator/StatementHelpers.html | 34 +++--- Avram/MissingRequiredAssociationError.html | 8 +- Avram/Model.html | 52 ++++----- Avram/Model/JSONConverter.html | 4 +- Avram/NeedyInitializer.html | 10 +- Avram/NeedyInitializerAndDeleteMethods.html | 16 +-- Avram/NeedyInitializerAndSaveMethods.html | 18 +-- Avram/NestedSaveOperation.html | 8 +- Avram/Nothing.html | 2 +- Avram/Operation.html | 26 ++--- Avram/OperationErrors.html | 6 +- Avram/OrderBy.html | 16 +-- Avram/OrderBy/Direction.html | 6 +- Avram/OrderBy/NullSorting.html | 10 +- Avram/OrderByClause.html | 8 +- Avram/OrderByRandom.html | 10 +- Avram/PGClientNotInstalledError.html | 4 +- Avram/PGNotRunningError.html | 4 +- Avram/ParamKeyOverride.html | 4 +- Avram/Paramable.html | 24 ++-- Avram/Params.html | 32 +++--- Avram/PermittedAttribute.html | 4 +- Avram/Polymorphic.html | 4 +- Avram/PrimaryKeyMethods.html | 14 +-- Avram/PrimaryKeyQueryable.html | 2 +- Avram/PrimaryKeyType.html | 6 +- Avram/QueryBuilder.html | 104 +++++++++--------- Avram/QueryBuilder/ColumnName.html | 2 +- Avram/Queryable.html | 102 ++++++++--------- Avram/Queryable/PGValue.html | 2 +- Avram/RecordNotFoundError.html | 12 +- Avram/Rollback.html | 2 +- Avram/SaveOperation.html | 70 ++++++------ Avram/SaveOperation/OperationStatus.html | 8 +- Avram/SaveOperationTemplate.html | 4 +- Avram/SchemaEnforcer.html | 10 +- Avram/SchemaEnforcer/EnsureExistingTable.html | 4 +- .../SchemaEnforcer/EnsureMatchingColumns.html | 8 +- .../EnsureUUIDPrimaryKeyHasDefault.html | 12 +- Avram/SchemaEnforcer/Validation.html | 6 +- Avram/SchemaMismatchError.html | 2 +- Avram/Slugify.html | 10 +- Avram/SoftDelete.html | 2 +- Avram/SoftDelete/Model.html | 12 +- Avram/SoftDelete/Query.html | 14 +-- Avram/SpecHelper.html | 6 +- Avram/TableFor.html | 4 +- Avram/TableName.html | 2 +- Avram/Type.html | 14 +-- Avram/Type/FailedCast.html | 4 +- Avram/Type/SuccessfulCast.html | 6 +- Avram/UnsupportedQueryError.html | 4 +- Avram/Uploadable.html | 12 +- Avram/Uploadable/Lucky.html | 10 +- Avram/Upsert.html | 4 +- Avram/Validations.html | 26 ++--- Avram/Where.html | 2 +- Avram/Where/Condition.html | 10 +- Avram/Where/Conjunction.html | 10 +- Avram/Where/Equal.html | 6 +- Avram/Where/Excludes.html | 8 +- Avram/Where/GreaterThan.html | 6 +- Avram/Where/GreaterThanOrEqualTo.html | 6 +- Avram/Where/Ilike.html | 6 +- Avram/Where/In.html | 8 +- Avram/Where/Includes.html | 8 +- Avram/Where/LessThan.html | 6 +- Avram/Where/LessThanOrEqualTo.html | 6 +- Avram/Where/Like.html | 6 +- Avram/Where/NotEqual.html | 6 +- Avram/Where/NotIlike.html | 6 +- Avram/Where/NotIn.html | 8 +- Avram/Where/NotLike.html | 6 +- Avram/Where/NotNull.html | 6 +- Avram/Where/Null.html | 6 +- Avram/Where/NullSqlClause.html | 4 +- Avram/Where/PrecedenceEnd.html | 4 +- Avram/Where/PrecedenceStart.html | 6 +- Avram/Where/Raw.html | 8 +- Avram/Where/SqlClause.html | 12 +- Avram/Where/ValueHoldingSqlClause.html | 6 +- BaseTask.html | 14 +-- Bool.html | 14 +-- Bool/Lucky.html | 14 +-- Bool/Lucky/ColumnType.html | 2 +- Bool/Lucky/Criteria.html | 4 +- Char.html | 6 +- DB.html | 48 ++++---- DB/Connection.html | 6 +- DB/SavePointTransaction.html | 6 +- DB/TopLevelTransaction.html | 6 +- DB/Transaction.html | 4 +- Db.html | 2 +- Db/Console.html | 12 +- Db/Create.html | 14 +-- Db/Create/Migrator.html | 2 +- Db/Drop.html | 14 +-- Db/Migrate.html | 14 +-- Db/Migrate/One.html | 12 +- Db/Migrations.html | 2 +- Db/Migrations/Status.html | 12 +- Db/Redo.html | 12 +- Db/Reset.html | 14 +-- Db/Rollback.html | 12 +- Db/RollbackAll.html | 12 +- Db/RollbackTo.html | 12 +- Db/Schema.html | 2 +- Db/Schema/Dump.html | 18 +-- Db/Schema/Restore.html | 14 +-- Db/Setup.html | 14 +-- Db/VerifyConnection.html | 16 +-- Enum.html | 6 +- Enum/Lucky.html | 12 +- Enum/Lucky/ColumnType.html | 2 +- Enum/Lucky/Criteria.html | 8 +- Fiber.html | 6 +- Float64.html | 8 +- Float64/Lucky.html | 26 ++--- Float64/Lucky/ColumnType.html | 2 +- Float64/Lucky/Criteria.html | 10 +- Gen.html | 2 +- Gen/Migration.html | 20 ++-- Gen/Migration/HabitatSettings.html | 2 +- Gen/Mixins.html | 2 +- Gen/Mixins/MigrationWithColumns.html | 4 +- Gen/Model.html | 16 +-- Gen/Resource.html | 2 +- Gen/Resource/Browser.html | 16 +-- Gen/Resource/Browser/InvalidOption.html | 4 +- Int16.html | 10 +- Int16/Lucky.html | 18 +-- Int16/Lucky/ColumnType.html | 2 +- Int16/Lucky/Criteria.html | 10 +- Int32.html | 10 +- Int32/Lucky.html | 18 +-- Int32/Lucky/ColumnType.html | 2 +- Int32/Lucky/Criteria.html | 12 +- Int64.html | 10 +- Int64/Lucky.html | 18 +-- Int64/Lucky/ColumnType.html | 2 +- Int64/Lucky/Criteria.html | 12 +- Nil.html | 8 +- Object.html | 6 +- Slice.html | 8 +- Slice/Lucky.html | 14 +-- Slice/Lucky/ColumnType.html | 2 +- Slice/Lucky/Criteria.html | 4 +- String.html | 6 +- String/Lucky.html | 12 +- String/Lucky/ColumnType.html | 2 +- String/Lucky/Criteria.html | 16 +-- Time.html | 8 +- Time/Lucky.html | 18 +-- Time/Lucky/ColumnType.html | 2 +- Time/Lucky/Criteria.html | 56 +++++----- UUID.html | 10 +- UUID/Lucky.html | 14 +-- UUID/Lucky/ColumnType.html | 2 +- UUID/Lucky/Criteria.html | 6 +- index.json | 2 +- search-index.js | 2 +- 269 files changed, 1485 insertions(+), 1485 deletions(-) diff --git a/Array.html b/Array.html index 9754f2bee..46269c9dd 100644 --- a/Array.html +++ b/Array.html @@ -1772,21 +1772,21 @@

- + avram/blank_extensions.cr
- + avram/charms/array_extensions.cr
- + avram/object_extensions.cr @@ -1960,7 +1960,7 @@


- [View source] + [View source]
@@ -1988,7 +1988,7 @@


- [View source] + [View source]
@@ -2009,7 +2009,7 @@


- [View source] + [View source]
diff --git a/Avram.html b/Avram.html index 8f2145702..c9e5fea24 100644 --- a/Avram.html +++ b/Avram.html @@ -1733,84 +1733,84 @@

- + avram.cr
- + avram/chrono_units.cr
- + avram/criteria.cr
- + avram/database/column_info.cr
- + avram/database/database_info.cr
- + avram/database/table_info.cr
- + avram/errors.cr
- + avram/order_by_clause.cr
- + avram/order_by_clause/order_by.cr
- + avram/order_by_clause/order_by_random.cr
- + avram/version.cr
- + lucky/ext/avram/errors.cr @@ -1966,7 +1966,7 @@


- [View source] + [View source]
@@ -1989,7 +1989,7 @@


- [View source] + [View source]
@@ -2005,7 +2005,7 @@


- [View source] + [View source]
@@ -2033,7 +2033,7 @@


- [View source] + [View source]
diff --git a/Avram/AddColumnAttributes.html b/Avram/AddColumnAttributes.html index 265715282..f2c5c784e 100644 --- a/Avram/AddColumnAttributes.html +++ b/Avram/AddColumnAttributes.html @@ -1746,7 +1746,7 @@

- + avram/add_column_attributes.cr diff --git a/Avram/Associations.html b/Avram/Associations.html index 81b885ca7..6e57d987f 100644 --- a/Avram/Associations.html +++ b/Avram/Associations.html @@ -1749,14 +1749,14 @@

- + avram/associations.cr
- + avram/associations/belongs_to.cr diff --git a/Avram/Associations/BelongsTo.html b/Avram/Associations/BelongsTo.html index 82d6002b2..acf4566fc 100644 --- a/Avram/Associations/BelongsTo.html +++ b/Avram/Associations/BelongsTo.html @@ -1731,7 +1731,7 @@

- + avram/associations/belongs_to.cr @@ -1798,7 +1798,7 @@


- [View source] + [View source]
diff --git a/Avram/Associations/HasMany.html b/Avram/Associations/HasMany.html index 9c6d235ba..b76e504fe 100644 --- a/Avram/Associations/HasMany.html +++ b/Avram/Associations/HasMany.html @@ -1731,7 +1731,7 @@

- + avram/associations/has_many.cr @@ -1798,7 +1798,7 @@


- [View source] + [View source]
diff --git a/Avram/Associations/HasOne.html b/Avram/Associations/HasOne.html index 75d99e92f..cc547c7dc 100644 --- a/Avram/Associations/HasOne.html +++ b/Avram/Associations/HasOne.html @@ -1731,7 +1731,7 @@

- + avram/associations/has_one.cr @@ -1798,7 +1798,7 @@


- [View source] + [View source]
diff --git a/Avram/Attribute.html b/Avram/Attribute.html index c652397c8..962875f68 100644 --- a/Avram/Attribute.html +++ b/Avram/Attribute.html @@ -1733,7 +1733,7 @@

- + avram/attribute.cr @@ -1985,7 +1985,7 @@


- [View source] + [View source]
@@ -2015,7 +2015,7 @@


- [View source] + [View source]
@@ -2031,7 +2031,7 @@


- [View source] + [View source]
@@ -2047,7 +2047,7 @@


- [View source] + [View source]
@@ -2063,7 +2063,7 @@


- [View source] + [View source]
@@ -2085,7 +2085,7 @@


- [View source] + [View source]
@@ -2107,7 +2107,7 @@


- [View source] + [View source]
@@ -2123,7 +2123,7 @@


- [View source] + [View source]
@@ -2139,7 +2139,7 @@


- [View source] + [View source]
@@ -2155,7 +2155,7 @@


- [View source] + [View source]
@@ -2171,7 +2171,7 @@


- [View source] + [View source]
@@ -2187,7 +2187,7 @@


- [View source] + [View source]
@@ -2203,7 +2203,7 @@


- [View source] + [View source]
@@ -2219,7 +2219,7 @@


- [View source] + [View source]
@@ -2235,7 +2235,7 @@


- [View source] + [View source]
@@ -2251,7 +2251,7 @@


- [View source] + [View source]
@@ -2267,7 +2267,7 @@


- [View source] + [View source]
@@ -2283,7 +2283,7 @@


- [View source] + [View source]
@@ -2299,7 +2299,7 @@


- [View source] + [View source]
@@ -2315,7 +2315,7 @@


- [View source] + [View source]
@@ -2331,7 +2331,7 @@


- [View source] + [View source]
@@ -2353,7 +2353,7 @@


- [View source] + [View source]
@@ -2379,7 +2379,7 @@


- [View source] + [View source]
@@ -2395,7 +2395,7 @@


- [View source] + [View source]
@@ -2411,7 +2411,7 @@


- [View source] + [View source]
@@ -2427,7 +2427,7 @@


- [View source] + [View source]
@@ -2455,7 +2455,7 @@


- [View source] + [View source]
diff --git a/Avram/Attribute/ErrorMessage.html b/Avram/Attribute/ErrorMessage.html index fe3e535ff..1894c4cbd 100644 --- a/Avram/Attribute/ErrorMessage.html +++ b/Avram/Attribute/ErrorMessage.html @@ -1727,7 +1727,7 @@

- + avram/attribute.cr diff --git a/Avram/AvramError.html b/Avram/AvramError.html index 63ce9ef5e..be41e0d53 100644 --- a/Avram/AvramError.html +++ b/Avram/AvramError.html @@ -1772,7 +1772,7 @@

- + avram/errors.cr diff --git a/Avram/BaseQueryTemplate.html b/Avram/BaseQueryTemplate.html index 647790e53..ec43ec696 100644 --- a/Avram/BaseQueryTemplate.html +++ b/Avram/BaseQueryTemplate.html @@ -1719,7 +1719,7 @@

- + avram/base_query_template.cr @@ -1815,7 +1815,7 @@


- [View source] + [View source]
diff --git a/Avram/BetweenCriteria.html b/Avram/BetweenCriteria.html index 859915f0d..c192eb63f 100644 --- a/Avram/BetweenCriteria.html +++ b/Avram/BetweenCriteria.html @@ -1739,7 +1739,7 @@

- + avram/criteria_extensions/between_criteria.cr diff --git a/Avram/CallableErrorMessage.html b/Avram/CallableErrorMessage.html index 9118eeedf..de549469f 100644 --- a/Avram/CallableErrorMessage.html +++ b/Avram/CallableErrorMessage.html @@ -1717,7 +1717,7 @@

- + avram/validations/callable_error_message.cr @@ -1782,7 +1782,7 @@


- [View source] + [View source]
diff --git a/Avram/Callbacks.html b/Avram/Callbacks.html index 64b42134b..70f1272fd 100644 --- a/Avram/Callbacks.html +++ b/Avram/Callbacks.html @@ -1735,7 +1735,7 @@

- + avram/callbacks.cr @@ -1912,7 +1912,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
@@ -1960,7 +1960,7 @@


- [View source] + [View source]
@@ -1976,7 +1976,7 @@


- [View source] + [View source]
@@ -2003,7 +2003,7 @@


- [View source] + [View source]
@@ -2034,7 +2034,7 @@


- [View source] + [View source]
@@ -2074,7 +2074,7 @@


- [View source] + [View source]
@@ -2112,7 +2112,7 @@


- [View source] + [View source]
@@ -2133,7 +2133,7 @@


- [View source] + [View source]
@@ -2149,7 +2149,7 @@


- [View source] + [View source]
@@ -2175,7 +2175,7 @@


- [View source] + [View source]
@@ -2199,7 +2199,7 @@


- [View source] + [View source]
@@ -2240,7 +2240,7 @@


- [View source] + [View source]
@@ -2274,7 +2274,7 @@


- [View source] + [View source]
@@ -2290,7 +2290,7 @@


- [View source] + [View source]
diff --git a/Avram/ChronoUnits.html b/Avram/ChronoUnits.html index c534f2044..8804f11e9 100644 --- a/Avram/ChronoUnits.html +++ b/Avram/ChronoUnits.html @@ -1717,7 +1717,7 @@

- + avram/chrono_units.cr @@ -2069,7 +2069,7 @@


- [View source] + [View source]
@@ -2085,7 +2085,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
@@ -2133,7 +2133,7 @@


- [View source] + [View source]
@@ -2149,7 +2149,7 @@


- [View source] + [View source]
@@ -2165,7 +2165,7 @@


- [View source] + [View source]
@@ -2181,7 +2181,7 @@


- [View source] + [View source]
@@ -2197,7 +2197,7 @@


- [View source] + [View source]
@@ -2213,7 +2213,7 @@


- [View source] + [View source]
@@ -2229,7 +2229,7 @@


- [View source] + [View source]
@@ -2245,7 +2245,7 @@


- [View source] + [View source]
@@ -2261,7 +2261,7 @@


- [View source] + [View source]
@@ -2277,7 +2277,7 @@


- [View source] + [View source]
@@ -2293,7 +2293,7 @@


- [View source] + [View source]
@@ -2309,7 +2309,7 @@


- [View source] + [View source]
@@ -2325,7 +2325,7 @@


- [View source] + [View source]
@@ -2341,7 +2341,7 @@


- [View source] + [View source]
@@ -2357,7 +2357,7 @@


- [View source] + [View source]
@@ -2373,7 +2373,7 @@


- [View source] + [View source]
@@ -2389,7 +2389,7 @@


- [View source] + [View source]
@@ -2405,7 +2405,7 @@


- [View source] + [View source]
diff --git a/Avram/Connection.html b/Avram/Connection.html index 55d65d14b..7e05db63a 100644 --- a/Avram/Connection.html +++ b/Avram/Connection.html @@ -1730,7 +1730,7 @@

- + avram/connection.cr @@ -1852,7 +1852,7 @@


- [View source] + [View source]
@@ -1882,7 +1882,7 @@


- [View source] + [View source]
@@ -1898,7 +1898,7 @@


- [View source] + [View source]
@@ -1914,7 +1914,7 @@


- [View source] + [View source]
@@ -1930,7 +1930,7 @@


- [View source] + [View source]
diff --git a/Avram/ConnectionError.html b/Avram/ConnectionError.html index 2e89b70ca..2f22ad16b 100644 --- a/Avram/ConnectionError.html +++ b/Avram/ConnectionError.html @@ -1719,7 +1719,7 @@

- + avram/errors.cr @@ -1870,7 +1870,7 @@


- [View source] + [View source]
@@ -1900,7 +1900,7 @@


- [View source] + [View source]
@@ -1916,7 +1916,7 @@


- [View source] + [View source]
diff --git a/Avram/Credentials.html b/Avram/Credentials.html index bc745c727..530e01ecf 100644 --- a/Avram/Credentials.html +++ b/Avram/Credentials.html @@ -1719,7 +1719,7 @@

- + avram/credentials.cr @@ -1905,7 +1905,7 @@


- [View source] + [View source]
@@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1950,7 +1950,7 @@


- [View source] + [View source]
@@ -1986,7 +1986,7 @@


- [View source] + [View source]
@@ -2020,7 +2020,7 @@


- [View source] + [View source]
@@ -2041,7 +2041,7 @@


- [View source] + [View source]
@@ -2057,7 +2057,7 @@


- [View source] + [View source]
@@ -2073,7 +2073,7 @@


- [View source] + [View source]
@@ -2089,7 +2089,7 @@


- [View source] + [View source]
@@ -2105,7 +2105,7 @@


- [View source] + [View source]
@@ -2121,7 +2121,7 @@


- [View source] + [View source]
@@ -2143,7 +2143,7 @@


- [View source] + [View source]
@@ -2159,7 +2159,7 @@


- [View source] + [View source]
diff --git a/Avram/Criteria.html b/Avram/Criteria.html index b4689e63f..47790145d 100644 --- a/Avram/Criteria.html +++ b/Avram/Criteria.html @@ -1753,7 +1753,7 @@

- + avram/criteria.cr @@ -1982,7 +1982,7 @@


- [View source] + [View source]
@@ -2012,7 +2012,7 @@


- [View source] + [View source]
@@ -2028,7 +2028,7 @@


- [View source] + [View source]
@@ -2044,7 +2044,7 @@


- [View source] + [View source]
@@ -2060,7 +2060,7 @@


- [View source] + [View source]
@@ -2076,7 +2076,7 @@


- [View source] + [View source]
@@ -2092,7 +2092,7 @@


- [View source] + [View source]
@@ -2108,7 +2108,7 @@


- [View source] + [View source]
@@ -2124,7 +2124,7 @@


- [View source] + [View source]
@@ -2140,7 +2140,7 @@


- [View source] + [View source]
@@ -2156,7 +2156,7 @@


- [View source] + [View source]
@@ -2172,7 +2172,7 @@


- [View source] + [View source]
@@ -2188,7 +2188,7 @@


- [View source] + [View source]
@@ -2204,7 +2204,7 @@


- [View source] + [View source]
@@ -2220,7 +2220,7 @@


- [View source] + [View source]
@@ -2236,7 +2236,7 @@


- [View source] + [View source]
@@ -2252,7 +2252,7 @@


- [View source] + [View source]
@@ -2268,7 +2268,7 @@


- [View source] + [View source]
@@ -2284,7 +2284,7 @@


- [View source] + [View source]
@@ -2300,7 +2300,7 @@


- [View source] + [View source]
@@ -2316,7 +2316,7 @@


- [View source] + [View source]
@@ -2332,7 +2332,7 @@


- [View source] + [View source]
@@ -2348,7 +2348,7 @@


- [View source] + [View source]
@@ -2376,7 +2376,7 @@


- [View source] + [View source]
diff --git a/Avram/Database.html b/Avram/Database.html index a21bbc10e..a79bcc6b2 100644 --- a/Avram/Database.html +++ b/Avram/Database.html @@ -1719,28 +1719,28 @@

- + avram/database.cr
- + avram/database/column_info.cr
- + avram/database/database_info.cr
- + avram/database/table_info.cr @@ -2085,7 +2085,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
@@ -2133,7 +2133,7 @@


- [View source] + [View source]
@@ -2154,7 +2154,7 @@


- [View source] + [View source]
@@ -2175,7 +2175,7 @@


- [View source] + [View source]
@@ -2202,7 +2202,7 @@


- [View source] + [View source]
@@ -2218,7 +2218,7 @@


- [View source] + [View source]
@@ -2234,7 +2234,7 @@


- [View source] + [View source]
@@ -2255,7 +2255,7 @@


- [View source] + [View source]
@@ -2276,7 +2276,7 @@


- [View source] + [View source]
@@ -2297,7 +2297,7 @@


- [View source] + [View source]
@@ -2318,7 +2318,7 @@


- [View source] + [View source]
@@ -2339,7 +2339,7 @@


- [View source] + [View source]
@@ -2360,7 +2360,7 @@


- [View source] + [View source]
@@ -2381,7 +2381,7 @@


- [View source] + [View source]
@@ -2402,7 +2402,7 @@


- [View source] + [View source]
@@ -2423,7 +2423,7 @@


- [View source] + [View source]
@@ -2444,7 +2444,7 @@


- [View source] + [View source]
@@ -2460,7 +2460,7 @@


- [View source] + [View source]
@@ -2481,7 +2481,7 @@


- [View source] + [View source]
@@ -2497,7 +2497,7 @@


- [View source] + [View source]
@@ -2522,7 +2522,7 @@


- [View source] + [View source]
@@ -2543,7 +2543,7 @@


- [View source] + [View source]
@@ -2559,7 +2559,7 @@


- [View source] + [View source]
@@ -2592,7 +2592,7 @@


- [View source] + [View source]
@@ -2608,7 +2608,7 @@


- [View source] + [View source]
@@ -2629,7 +2629,7 @@


- [View source] + [View source]
@@ -2650,7 +2650,7 @@


- [View source] + [View source]
@@ -2671,7 +2671,7 @@


- [View source] + [View source]
@@ -2692,7 +2692,7 @@


- [View source] + [View source]
@@ -2713,7 +2713,7 @@


- [View source] + [View source]
@@ -2734,7 +2734,7 @@


- [View source] + [View source]
@@ -2755,7 +2755,7 @@


- [View source] + [View source]
@@ -2776,7 +2776,7 @@


- [View source] + [View source]
@@ -2797,7 +2797,7 @@


- [View source] + [View source]
@@ -2818,7 +2818,7 @@


- [View source] + [View source]
diff --git a/Avram/Database/ColumnInfo.html b/Avram/Database/ColumnInfo.html index 035fb93d4..4d6ff1278 100644 --- a/Avram/Database/ColumnInfo.html +++ b/Avram/Database/ColumnInfo.html @@ -1735,7 +1735,7 @@

- + avram/database/column_info.cr @@ -1974,7 +1974,7 @@


- [View source] + [View source]
@@ -2002,7 +2002,7 @@


- [View source] + [View source]
@@ -2030,7 +2030,7 @@


- [View source] + [View source]
@@ -2046,7 +2046,7 @@


- [View source] + [View source]
@@ -2062,7 +2062,7 @@


- [View source] + [View source]
@@ -2078,7 +2078,7 @@


- [View source] + [View source]
@@ -2094,7 +2094,7 @@


- [View source] + [View source]
@@ -2110,7 +2110,7 @@


- [View source] + [View source]
@@ -2126,7 +2126,7 @@


- [View source] + [View source]
@@ -2142,7 +2142,7 @@


- [View source] + [View source]
@@ -2158,7 +2158,7 @@


- [View source] + [View source]
@@ -2174,7 +2174,7 @@


- [View source] + [View source]
@@ -2190,7 +2190,7 @@


- [View source] + [View source]
@@ -2206,7 +2206,7 @@


- [View source] + [View source]
@@ -2222,7 +2222,7 @@


- [View source] + [View source]
@@ -2238,7 +2238,7 @@


- [View source] + [View source]
@@ -2254,7 +2254,7 @@


- [View source] + [View source]
@@ -2270,7 +2270,7 @@


- [View source] + [View source]
@@ -2286,7 +2286,7 @@


- [View source] + [View source]
@@ -2302,7 +2302,7 @@


- [View source] + [View source]
diff --git a/Avram/Database/DatabaseCleaner.html b/Avram/Database/DatabaseCleaner.html index 4e824ddb3..3981bea03 100644 --- a/Avram/Database/DatabaseCleaner.html +++ b/Avram/Database/DatabaseCleaner.html @@ -1719,7 +1719,7 @@

- + avram/database.cr @@ -1831,7 +1831,7 @@


- [View source] + [View source]
@@ -1861,7 +1861,7 @@


- [View source] + [View source]
@@ -1877,7 +1877,7 @@


- [View source] + [View source]
diff --git a/Avram/Database/DatabaseInfo.html b/Avram/Database/DatabaseInfo.html index 66e3dfd35..09368ad3d 100644 --- a/Avram/Database/DatabaseInfo.html +++ b/Avram/Database/DatabaseInfo.html @@ -1719,7 +1719,7 @@

- + avram/database/database_info.cr @@ -1880,7 +1880,7 @@


- [View source] + [View source]
@@ -1896,7 +1896,7 @@


- [View source] + [View source]
@@ -1926,7 +1926,7 @@


- [View source] + [View source]
@@ -1942,7 +1942,7 @@


- [View source] + [View source]
@@ -1958,7 +1958,7 @@


- [View source] + [View source]
@@ -1974,7 +1974,7 @@


- [View source] + [View source]
@@ -1990,7 +1990,7 @@


- [View source] + [View source]
diff --git a/Avram/Database/FiberId.html b/Avram/Database/FiberId.html index 43ca86d96..fda66a90a 100644 --- a/Avram/Database/FiberId.html +++ b/Avram/Database/FiberId.html @@ -1727,7 +1727,7 @@

- + avram/database.cr diff --git a/Avram/Database/TableInfo.html b/Avram/Database/TableInfo.html index 6403f8512..4cd57124f 100644 --- a/Avram/Database/TableInfo.html +++ b/Avram/Database/TableInfo.html @@ -1719,7 +1719,7 @@

- + avram/database/table_info.cr @@ -1881,7 +1881,7 @@


- [View source] + [View source]
@@ -1911,7 +1911,7 @@


- [View source] + [View source]
@@ -1927,7 +1927,7 @@


- [View source] + [View source]
@@ -1943,7 +1943,7 @@


- [View source] + [View source]
@@ -1959,7 +1959,7 @@


- [View source] + [View source]
@@ -1975,7 +1975,7 @@


- [View source] + [View source]
@@ -1991,7 +1991,7 @@


- [View source] + [View source]
@@ -2007,7 +2007,7 @@


- [View source] + [View source]
@@ -2023,7 +2023,7 @@


- [View source] + [View source]
@@ -2039,7 +2039,7 @@


- [View source] + [View source]
@@ -2055,7 +2055,7 @@


- [View source] + [View source]
diff --git a/Avram/DatabaseValidations.html b/Avram/DatabaseValidations.html index 689afb86d..b25b8f453 100644 --- a/Avram/DatabaseValidations.html +++ b/Avram/DatabaseValidations.html @@ -1731,7 +1731,7 @@

- + avram/database_validations.cr diff --git a/Avram/DefineAttribute.html b/Avram/DefineAttribute.html index 89f7c4bf8..dedceb406 100644 --- a/Avram/DefineAttribute.html +++ b/Avram/DefineAttribute.html @@ -1735,7 +1735,7 @@

- + avram/define_attribute.cr @@ -1832,7 +1832,7 @@


- [View source] + [View source]
@@ -1860,7 +1860,7 @@


- [View source] + [View source]
@@ -1876,7 +1876,7 @@


- [View source] + [View source]
@@ -1892,7 +1892,7 @@


- [View source] + [View source]
@@ -1908,7 +1908,7 @@


- [View source] + [View source]
diff --git a/Avram/DeleteOperation.html b/Avram/DeleteOperation.html index b9ce71a2f..230b3609d 100644 --- a/Avram/DeleteOperation.html +++ b/Avram/DeleteOperation.html @@ -1747,7 +1747,7 @@

- + avram/delete_operation.cr @@ -2093,7 +2093,7 @@


- [View source] + [View source]
@@ -2121,7 +2121,7 @@


- [View source] + [View source]
@@ -2137,7 +2137,7 @@


- [View source] + [View source]
@@ -2167,7 +2167,7 @@


- [View source] + [View source]
@@ -2183,7 +2183,7 @@


- [View source] + [View source]
@@ -2204,7 +2204,7 @@


- [View source] + [View source]
@@ -2220,7 +2220,7 @@


- [View source] + [View source]
@@ -2236,7 +2236,7 @@


- [View source] + [View source]
@@ -2258,7 +2258,7 @@


- [View source] + [View source]
diff --git a/Avram/DeleteOperation/OperationStatus.html b/Avram/DeleteOperation/OperationStatus.html index 0170bc728..039e34e26 100644 --- a/Avram/DeleteOperation/OperationStatus.html +++ b/Avram/DeleteOperation/OperationStatus.html @@ -1717,7 +1717,7 @@

- + avram/delete_operation.cr @@ -1879,7 +1879,7 @@


- [View source] + [View source]
@@ -1895,7 +1895,7 @@


- [View source] + [View source]
@@ -1911,7 +1911,7 @@


- [View source] + [View source]
diff --git a/Avram/DeleteOperationTemplate.html b/Avram/DeleteOperationTemplate.html index 75ce35254..40ed16278 100644 --- a/Avram/DeleteOperationTemplate.html +++ b/Avram/DeleteOperationTemplate.html @@ -1719,7 +1719,7 @@

- + avram/delete_operation_template.cr @@ -1815,7 +1815,7 @@


- [View source] + [View source]
diff --git a/Avram/Events.html b/Avram/Events.html index 71e91a0ad..304bcaa0f 100644 --- a/Avram/Events.html +++ b/Avram/Events.html @@ -1717,7 +1717,7 @@

- + avram/events/delete_failed_event.cr diff --git a/Avram/Events/DeleteFailedEvent.html b/Avram/Events/DeleteFailedEvent.html index a12b5c87d..bcc44d243 100644 --- a/Avram/Events/DeleteFailedEvent.html +++ b/Avram/Events/DeleteFailedEvent.html @@ -1719,7 +1719,7 @@

- + avram/events/delete_failed_event.cr @@ -1889,7 +1889,7 @@


- [View source] + [View source]
@@ -1967,7 +1967,7 @@


- [View source] + [View source]
@@ -1983,7 +1983,7 @@


- [View source] + [View source]
@@ -1999,7 +1999,7 @@


- [View source] + [View source]
diff --git a/Avram/Events/DeleteSuccessEvent.html b/Avram/Events/DeleteSuccessEvent.html index d3718912b..52d9b71b8 100644 --- a/Avram/Events/DeleteSuccessEvent.html +++ b/Avram/Events/DeleteSuccessEvent.html @@ -1719,7 +1719,7 @@

- + avram/events/delete_success_event.cr @@ -1879,7 +1879,7 @@


- [View source] + [View source]
@@ -1957,7 +1957,7 @@


- [View source] + [View source]
diff --git a/Avram/Events/FailedQueryEvent.html b/Avram/Events/FailedQueryEvent.html index c60baaf85..23d18ae6d 100644 --- a/Avram/Events/FailedQueryEvent.html +++ b/Avram/Events/FailedQueryEvent.html @@ -1719,7 +1719,7 @@

- + avram/events/failed_query_event.cr @@ -1894,7 +1894,7 @@


- [View source] + [View source]
@@ -1972,7 +1972,7 @@


- [View source] + [View source]
@@ -1988,7 +1988,7 @@


- [View source] + [View source]
@@ -2004,7 +2004,7 @@


- [View source] + [View source]
@@ -2020,7 +2020,7 @@


- [View source] + [View source]
diff --git a/Avram/Events/QueryEvent.html b/Avram/Events/QueryEvent.html index 3ba697ce5..2142f2ed7 100644 --- a/Avram/Events/QueryEvent.html +++ b/Avram/Events/QueryEvent.html @@ -1719,7 +1719,7 @@

- + avram/events/query_event.cr @@ -1889,7 +1889,7 @@


- [View source] + [View source]
@@ -1967,7 +1967,7 @@


- [View source] + [View source]
@@ -1983,7 +1983,7 @@


- [View source] + [View source]
@@ -1999,7 +1999,7 @@


- [View source] + [View source]
diff --git a/Avram/Events/SaveFailedEvent.html b/Avram/Events/SaveFailedEvent.html index 30149035e..33ced2602 100644 --- a/Avram/Events/SaveFailedEvent.html +++ b/Avram/Events/SaveFailedEvent.html @@ -1719,7 +1719,7 @@

- + avram/events/save_failed_event.cr @@ -1894,7 +1894,7 @@


- [View source] + [View source]
@@ -1972,7 +1972,7 @@


- [View source] + [View source]
@@ -1988,7 +1988,7 @@


- [View source] + [View source]
@@ -2004,7 +2004,7 @@


- [View source] + [View source]
@@ -2020,7 +2020,7 @@


- [View source] + [View source]
diff --git a/Avram/Events/SaveSuccessEvent.html b/Avram/Events/SaveSuccessEvent.html index b931b912d..5c2e6ddaf 100644 --- a/Avram/Events/SaveSuccessEvent.html +++ b/Avram/Events/SaveSuccessEvent.html @@ -1719,7 +1719,7 @@

- + avram/events/save_success_event.cr @@ -1884,7 +1884,7 @@


- [View source] + [View source]
@@ -1962,7 +1962,7 @@


- [View source] + [View source]
@@ -1978,7 +1978,7 @@


- [View source] + [View source]
diff --git a/Avram/ExtractCriteria.html b/Avram/ExtractCriteria.html index 13ba54a24..79b1e0eaa 100644 --- a/Avram/ExtractCriteria.html +++ b/Avram/ExtractCriteria.html @@ -1731,7 +1731,7 @@

- + avram/criteria_extensions/extract_criteria.cr diff --git a/Avram/Factory.html b/Avram/Factory.html index f282b7927..93f6daad6 100644 --- a/Avram/Factory.html +++ b/Avram/Factory.html @@ -1719,7 +1719,7 @@

- + avram/factory.cr @@ -1915,7 +1915,7 @@


- [View source] + [View source]
@@ -1931,7 +1931,7 @@


- [View source] + [View source]
@@ -1947,7 +1947,7 @@


- [View source] + [View source]
@@ -1963,7 +1963,7 @@


- [View source] + [View source]
@@ -1988,7 +1988,7 @@


- [View source] + [View source]
@@ -2015,7 +2015,7 @@


- [View source] + [View source]
@@ -2043,7 +2043,7 @@


- [View source] + [View source]
@@ -2059,7 +2059,7 @@


- [View source] + [View source]
@@ -2087,7 +2087,7 @@


- [View source] + [View source]
@@ -2115,7 +2115,7 @@


- [View source] + [View source]
@@ -2131,7 +2131,7 @@


- [View source] + [View source]
@@ -2147,7 +2147,7 @@


- [View source] + [View source]
diff --git a/Avram/FailedMigration.html b/Avram/FailedMigration.html index 46879520d..96b468076 100644 --- a/Avram/FailedMigration.html +++ b/Avram/FailedMigration.html @@ -1719,7 +1719,7 @@

- + avram/errors.cr @@ -1851,7 +1851,7 @@


- [View source] + [View source]
@@ -1881,7 +1881,7 @@


- [View source] + [View source]
@@ -1897,7 +1897,7 @@


- [View source] + [View source]
diff --git a/Avram/FailedOperation.html b/Avram/FailedOperation.html index f9a60a01e..18684147f 100644 --- a/Avram/FailedOperation.html +++ b/Avram/FailedOperation.html @@ -1730,7 +1730,7 @@

- + avram/errors.cr diff --git a/Avram/GenericAttribute.html b/Avram/GenericAttribute.html index ce307bea5..fb6aef553 100644 --- a/Avram/GenericAttribute.html +++ b/Avram/GenericAttribute.html @@ -1734,7 +1734,7 @@

- + avram/generic_attribute.cr @@ -1871,7 +1871,7 @@


- [View source] + [View source]
@@ -1901,7 +1901,7 @@


- [View source] + [View source]
@@ -1917,7 +1917,7 @@


- [View source] + [View source]
@@ -1933,7 +1933,7 @@


- [View source] + [View source]
@@ -1949,7 +1949,7 @@


- [View source] + [View source]
@@ -1965,7 +1965,7 @@


- [View source] + [View source]
@@ -1981,7 +1981,7 @@


- [View source] + [View source]
@@ -1997,7 +1997,7 @@


- [View source] + [View source]
diff --git a/Avram/HabitatSettings.html b/Avram/HabitatSettings.html index 2d97850b7..5e31c6287 100644 --- a/Avram/HabitatSettings.html +++ b/Avram/HabitatSettings.html @@ -1719,7 +1719,7 @@

- + avram.cr diff --git a/Avram/I18n.html b/Avram/I18n.html index 8ae36a65c..2f6601e09 100644 --- a/Avram/I18n.html +++ b/Avram/I18n.html @@ -1719,7 +1719,7 @@

- + avram/i18n_backend.cr @@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/I18nBackend.html b/Avram/I18nBackend.html index f2138faff..899a80c2f 100644 --- a/Avram/I18nBackend.html +++ b/Avram/I18nBackend.html @@ -1733,7 +1733,7 @@

- + avram/i18n_backend.cr @@ -1855,7 +1855,7 @@


- [View source] + [View source]
@@ -1885,7 +1885,7 @@


- [View source] + [View source]
@@ -1901,7 +1901,7 @@


- [View source] + [View source]
diff --git a/Avram/ImpossibleValidation.html b/Avram/ImpossibleValidation.html index f39f8803c..86c598f5f 100644 --- a/Avram/ImpossibleValidation.html +++ b/Avram/ImpossibleValidation.html @@ -1730,7 +1730,7 @@

- + avram/errors.cr @@ -1857,7 +1857,7 @@


- [View source] + [View source]
@@ -1887,7 +1887,7 @@


- [View source] + [View source]
diff --git a/Avram/IncludesCriteria.html b/Avram/IncludesCriteria.html index f15760f5b..ee12c5a12 100644 --- a/Avram/IncludesCriteria.html +++ b/Avram/IncludesCriteria.html @@ -1737,7 +1737,7 @@

- + avram/criteria_extensions/includes_criteria.cr diff --git a/Avram/InheritColumnAttributes.html b/Avram/InheritColumnAttributes.html index 394995342..b7c9145fa 100644 --- a/Avram/InheritColumnAttributes.html +++ b/Avram/InheritColumnAttributes.html @@ -1733,7 +1733,7 @@

- + avram/inherit_column_attributes.cr @@ -1800,7 +1800,7 @@


- [View source] + [View source]
diff --git a/Avram/Insert.html b/Avram/Insert.html index de817bc34..522e06561 100644 --- a/Avram/Insert.html +++ b/Avram/Insert.html @@ -1719,7 +1719,7 @@

- + avram/insert.cr @@ -1831,7 +1831,7 @@


- [View source] + [View source]
@@ -1861,7 +1861,7 @@


- [View source] + [View source]
@@ -1877,7 +1877,7 @@


- [View source] + [View source]
diff --git a/Avram/Insert/Params.html b/Avram/Insert/Params.html index 821fc1f46..e04e62cc5 100644 --- a/Avram/Insert/Params.html +++ b/Avram/Insert/Params.html @@ -1727,7 +1727,7 @@

- + avram/insert.cr diff --git a/Avram/InvalidDatabaseNameError.html b/Avram/InvalidDatabaseNameError.html index 54a263e72..a17dae724 100644 --- a/Avram/InvalidDatabaseNameError.html +++ b/Avram/InvalidDatabaseNameError.html @@ -1719,7 +1719,7 @@

- + avram/errors.cr diff --git a/Avram/InvalidOperationError.html b/Avram/InvalidOperationError.html index 68be22ee7..545e53763 100644 --- a/Avram/InvalidOperationError.html +++ b/Avram/InvalidOperationError.html @@ -1744,14 +1744,14 @@

- + avram/errors.cr
- + lucky/ext/avram/errors.cr @@ -1908,7 +1908,7 @@


- [View source] + [View source]
@@ -1938,7 +1938,7 @@


- [View source] + [View source]
@@ -1954,7 +1954,7 @@


- [View source] + [View source]
@@ -1970,7 +1970,7 @@


- [View source] + [View source]
@@ -1986,7 +1986,7 @@


- [View source] + [View source]
@@ -2002,7 +2002,7 @@


- [View source] + [View source]
diff --git a/Avram/InvalidQueryError.html b/Avram/InvalidQueryError.html index c6c4c9ab9..ff1024a67 100644 --- a/Avram/InvalidQueryError.html +++ b/Avram/InvalidQueryError.html @@ -1719,7 +1719,7 @@

- + avram/errors.cr diff --git a/Avram/Join.html b/Avram/Join.html index 17dc5a634..ce0cdeb37 100644 --- a/Avram/Join.html +++ b/Avram/Join.html @@ -1717,7 +1717,7 @@

- + avram/join.cr diff --git a/Avram/Join/Full.html b/Avram/Join/Full.html index 3689ea97e..a490f1a27 100644 --- a/Avram/Join/Full.html +++ b/Avram/Join/Full.html @@ -1719,7 +1719,7 @@

- + avram/join.cr @@ -1876,7 +1876,7 @@


- [View source] + [View source]
diff --git a/Avram/Join/Inner.html b/Avram/Join/Inner.html index 0c84cc7a8..951608241 100644 --- a/Avram/Join/Inner.html +++ b/Avram/Join/Inner.html @@ -1719,7 +1719,7 @@

- + avram/join.cr @@ -1876,7 +1876,7 @@


- [View source] + [View source]
diff --git a/Avram/Join/Left.html b/Avram/Join/Left.html index 9f7e328a5..2a9e06b84 100644 --- a/Avram/Join/Left.html +++ b/Avram/Join/Left.html @@ -1719,7 +1719,7 @@

- + avram/join.cr @@ -1876,7 +1876,7 @@


- [View source] + [View source]
diff --git a/Avram/Join/Right.html b/Avram/Join/Right.html index b0468a16f..a1d646f78 100644 --- a/Avram/Join/Right.html +++ b/Avram/Join/Right.html @@ -1719,7 +1719,7 @@

- + avram/join.cr @@ -1876,7 +1876,7 @@


- [View source] + [View source]
diff --git a/Avram/Join/SqlClause.html b/Avram/Join/SqlClause.html index 3f050ff34..ff1732405 100644 --- a/Avram/Join/SqlClause.html +++ b/Avram/Join/SqlClause.html @@ -1739,7 +1739,7 @@

- + avram/join.cr @@ -1881,7 +1881,7 @@


- [View source] + [View source]
@@ -1911,7 +1911,7 @@


- [View source] + [View source]
@@ -1927,7 +1927,7 @@


- [View source] + [View source]
@@ -1943,7 +1943,7 @@


- [View source] + [View source]
@@ -1959,7 +1959,7 @@


- [View source] + [View source]
@@ -1975,7 +1975,7 @@


- [View source] + [View source]
@@ -1991,7 +1991,7 @@


- [View source] + [View source]
@@ -2007,7 +2007,7 @@


- [View source] + [View source]
@@ -2023,7 +2023,7 @@


- [View source] + [View source]
diff --git a/Avram/LazyLoadError.html b/Avram/LazyLoadError.html index a152060f6..ccb98df3c 100644 --- a/Avram/LazyLoadError.html +++ b/Avram/LazyLoadError.html @@ -1731,7 +1731,7 @@

- + avram/errors.cr @@ -1863,7 +1863,7 @@


- [View source] + [View source]
@@ -1893,7 +1893,7 @@


- [View source] + [View source]
@@ -1909,7 +1909,7 @@


- [View source] + [View source]
diff --git a/Avram/MarkAsFailed.html b/Avram/MarkAsFailed.html index e0ca6dfc6..9f6c9c442 100644 --- a/Avram/MarkAsFailed.html +++ b/Avram/MarkAsFailed.html @@ -1731,7 +1731,7 @@

- + avram/mark_as_failed.cr @@ -1796,7 +1796,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator.html b/Avram/Migrator.html index f15e0391d..041d5e409 100644 --- a/Avram/Migrator.html +++ b/Avram/Migrator.html @@ -1717,14 +1717,14 @@

- + avram/migrator/alter_extension_statement.cr
- + avram/migrator/migrator.cr @@ -1787,7 +1787,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/AlterExtensionStatement.html b/Avram/Migrator/AlterExtensionStatement.html index 3e7eabdc5..b170697d0 100644 --- a/Avram/Migrator/AlterExtensionStatement.html +++ b/Avram/Migrator/AlterExtensionStatement.html @@ -1719,7 +1719,7 @@

- + avram/migrator/alter_extension_statement.cr @@ -1831,7 +1831,7 @@


- [View source] + [View source]
@@ -1861,7 +1861,7 @@


- [View source] + [View source]
@@ -1877,7 +1877,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/AlterTableStatement.html b/Avram/Migrator/AlterTableStatement.html index 073e1fff9..c4e5cc4a8 100644 --- a/Avram/Migrator/AlterTableStatement.html +++ b/Avram/Migrator/AlterTableStatement.html @@ -1735,7 +1735,7 @@

- + avram/migrator/alter_table_statement.cr @@ -1996,7 +1996,7 @@


- [View source] + [View source]
@@ -2026,7 +2026,7 @@


- [View source] + [View source]
@@ -2042,7 +2042,7 @@


- [View source] + [View source]
@@ -2058,7 +2058,7 @@


- [View source] + [View source]
@@ -2074,7 +2074,7 @@


- [View source] + [View source]
@@ -2114,7 +2114,7 @@


- [View source] + [View source]
@@ -2130,7 +2130,7 @@


- [View source] + [View source]
@@ -2146,7 +2146,7 @@


- [View source] + [View source]
@@ -2162,7 +2162,7 @@


- [View source] + [View source]
@@ -2178,7 +2178,7 @@


- [View source] + [View source]
@@ -2194,7 +2194,7 @@


- [View source] + [View source]
@@ -2210,7 +2210,7 @@


- [View source] + [View source]
@@ -2226,7 +2226,7 @@


- [View source] + [View source]
@@ -2254,7 +2254,7 @@


- [View source] + [View source]
@@ -2275,7 +2275,7 @@


- [View source] + [View source]
@@ -2299,7 +2299,7 @@


- [View source] + [View source]
@@ -2326,7 +2326,7 @@


- [View source] + [View source]
@@ -2342,7 +2342,7 @@


- [View source] + [View source]
@@ -2358,7 +2358,7 @@


- [View source] + [View source]
@@ -2374,7 +2374,7 @@


- [View source] + [View source]
@@ -2390,7 +2390,7 @@


- [View source] + [View source]
@@ -2406,7 +2406,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/BuildReferenceFragment.html b/Avram/Migrator/BuildReferenceFragment.html index 4ee019244..d4a65b81a 100644 --- a/Avram/Migrator/BuildReferenceFragment.html +++ b/Avram/Migrator/BuildReferenceFragment.html @@ -1719,7 +1719,7 @@

- + avram/migrator/build_reference_fragment.cr @@ -1826,7 +1826,7 @@


- [View source] + [View source]
@@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/ChangeNullStatement.html b/Avram/Migrator/ChangeNullStatement.html index b18be26e1..baf3daa4c 100644 --- a/Avram/Migrator/ChangeNullStatement.html +++ b/Avram/Migrator/ChangeNullStatement.html @@ -1737,7 +1737,7 @@

- + avram/migrator/change_null_statement.cr @@ -1844,7 +1844,7 @@


- [View source] + [View source]
@@ -1874,7 +1874,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns.html b/Avram/Migrator/Columns.html index 9d2bbb442..d7ab4e7cc 100644 --- a/Avram/Migrator/Columns.html +++ b/Avram/Migrator/Columns.html @@ -1717,70 +1717,70 @@

- + avram/migrator/columns/base.cr
- + avram/migrator/columns/bool_column.cr
- + avram/migrator/columns/bytes_column.cr
- + avram/migrator/columns/float_column.cr
- + avram/migrator/columns/int16_column.cr
- + avram/migrator/columns/int32_column.cr
- + avram/migrator/columns/int64_column.cr
- + avram/migrator/columns/string_column.cr
- + avram/migrator/columns/time_column.cr
- + avram/migrator/columns/uuid_column.cr diff --git a/Avram/Migrator/Columns/Base.html b/Avram/Migrator/Columns/Base.html index a6845ca6d..885136666 100644 --- a/Avram/Migrator/Columns/Base.html +++ b/Avram/Migrator/Columns/Base.html @@ -1751,7 +1751,7 @@

- + avram/migrator/columns/base.cr @@ -1930,7 +1930,7 @@


- [View source] + [View source]
@@ -1958,7 +1958,7 @@


- [View source] + [View source]
@@ -1974,7 +1974,7 @@


- [View source] + [View source]
@@ -1990,7 +1990,7 @@


- [View source] + [View source]
@@ -2018,7 +2018,7 @@


- [View source] + [View source]
@@ -2034,7 +2034,7 @@


- [View source] + [View source]
@@ -2050,7 +2050,7 @@


- [View source] + [View source]
@@ -2066,7 +2066,7 @@


- [View source] + [View source]
@@ -2082,7 +2082,7 @@


- [View source] + [View source]
@@ -2098,7 +2098,7 @@


- [View source] + [View source]
@@ -2114,7 +2114,7 @@


- [View source] + [View source]
@@ -2130,7 +2130,7 @@


- [View source] + [View source]
@@ -2146,7 +2146,7 @@


- [View source] + [View source]
@@ -2162,7 +2162,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/BoolColumn.html b/Avram/Migrator/Columns/BoolColumn.html index d0cbfda85..97910e7e5 100644 --- a/Avram/Migrator/Columns/BoolColumn.html +++ b/Avram/Migrator/Columns/BoolColumn.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/bool_column.cr @@ -1903,7 +1903,7 @@


- [View source] + [View source]
@@ -1933,7 +1933,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/BytesColumn.html b/Avram/Migrator/Columns/BytesColumn.html index d94802c93..ae482fae0 100644 --- a/Avram/Migrator/Columns/BytesColumn.html +++ b/Avram/Migrator/Columns/BytesColumn.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/bytes_column.cr @@ -1903,7 +1903,7 @@


- [View source] + [View source]
@@ -1933,7 +1933,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/Float32Column.html b/Avram/Migrator/Columns/Float32Column.html index 11c559ad3..1f10038ec 100644 --- a/Avram/Migrator/Columns/Float32Column.html +++ b/Avram/Migrator/Columns/Float32Column.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/float_column.cr @@ -1919,7 +1919,7 @@


- [View source] + [View source]
@@ -1935,7 +1935,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/Float64Column.html b/Avram/Migrator/Columns/Float64Column.html index f8ad89f22..8a6a0c082 100644 --- a/Avram/Migrator/Columns/Float64Column.html +++ b/Avram/Migrator/Columns/Float64Column.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/float_column.cr @@ -1919,7 +1919,7 @@


- [View source] + [View source]
@@ -1935,7 +1935,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/FloatColumn.html b/Avram/Migrator/Columns/FloatColumn.html index 0b8ac8b8c..34c0abb25 100644 --- a/Avram/Migrator/Columns/FloatColumn.html +++ b/Avram/Migrator/Columns/FloatColumn.html @@ -1735,7 +1735,7 @@

- + avram/migrator/columns/float_column.cr @@ -1924,7 +1924,7 @@


- [View source] + [View source]
@@ -1940,7 +1940,7 @@


- [View source] + [View source]
@@ -1970,7 +1970,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/Int16Column.html b/Avram/Migrator/Columns/Int16Column.html index cfe756e8f..f3e902ef9 100644 --- a/Avram/Migrator/Columns/Int16Column.html +++ b/Avram/Migrator/Columns/Int16Column.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/int16_column.cr @@ -1903,7 +1903,7 @@


- [View source] + [View source]
@@ -1933,7 +1933,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/Int32Column.html b/Avram/Migrator/Columns/Int32Column.html index df2ccedb8..18e87f0d4 100644 --- a/Avram/Migrator/Columns/Int32Column.html +++ b/Avram/Migrator/Columns/Int32Column.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/int32_column.cr @@ -1903,7 +1903,7 @@


- [View source] + [View source]
@@ -1933,7 +1933,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/Int64Column.html b/Avram/Migrator/Columns/Int64Column.html index 821ce24e5..834082fb7 100644 --- a/Avram/Migrator/Columns/Int64Column.html +++ b/Avram/Migrator/Columns/Int64Column.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/int64_column.cr @@ -1903,7 +1903,7 @@


- [View source] + [View source]
@@ -1933,7 +1933,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/JSON.html b/Avram/Migrator/Columns/JSON.html index 1b8e8b7de..2c7b15bc1 100644 --- a/Avram/Migrator/Columns/JSON.html +++ b/Avram/Migrator/Columns/JSON.html @@ -1717,7 +1717,7 @@

- + avram/migrator/columns/json_column.cr diff --git a/Avram/Migrator/Columns/JSON/AnyColumn.html b/Avram/Migrator/Columns/JSON/AnyColumn.html index 2513c3be4..91825d7ce 100644 --- a/Avram/Migrator/Columns/JSON/AnyColumn.html +++ b/Avram/Migrator/Columns/JSON/AnyColumn.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/json_column.cr @@ -1920,7 +1920,7 @@


- [View source] + [View source]
@@ -1948,7 +1948,7 @@


- [View source] + [View source]
@@ -1976,7 +1976,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/PrimaryKeys.html b/Avram/Migrator/Columns/PrimaryKeys.html index 8ef680749..8a41f9266 100644 --- a/Avram/Migrator/Columns/PrimaryKeys.html +++ b/Avram/Migrator/Columns/PrimaryKeys.html @@ -1717,35 +1717,35 @@

- + avram/migrator/columns/primary_keys/base.cr
- + avram/migrator/columns/primary_keys/int16_primary_key.cr
- + avram/migrator/columns/primary_keys/int32_primary_key.cr
- + avram/migrator/columns/primary_keys/int64_primary_key.cr
- + avram/migrator/columns/primary_keys/uuid_primary_key.cr diff --git a/Avram/Migrator/Columns/PrimaryKeys/Base.html b/Avram/Migrator/Columns/PrimaryKeys/Base.html index ed428435d..af9e928b6 100644 --- a/Avram/Migrator/Columns/PrimaryKeys/Base.html +++ b/Avram/Migrator/Columns/PrimaryKeys/Base.html @@ -1739,7 +1739,7 @@

- + avram/migrator/columns/primary_keys/base.cr @@ -1838,7 +1838,7 @@


- [View source] + [View source]
@@ -1854,7 +1854,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey.html b/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey.html index 78851a7c2..a81dc20dc 100644 --- a/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey.html +++ b/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/primary_keys/int16_primary_key.cr @@ -1850,7 +1850,7 @@


- [View source] + [View source]
@@ -1880,7 +1880,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey.html b/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey.html index 78f15dbdf..56b88b0df 100644 --- a/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey.html +++ b/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/primary_keys/int32_primary_key.cr @@ -1850,7 +1850,7 @@


- [View source] + [View source]
@@ -1880,7 +1880,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey.html b/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey.html index 11ed89e75..e8f4721ef 100644 --- a/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey.html +++ b/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/primary_keys/int64_primary_key.cr @@ -1850,7 +1850,7 @@


- [View source] + [View source]
@@ -1880,7 +1880,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey.html b/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey.html index 210c9bebc..514c2aa60 100644 --- a/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey.html +++ b/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/primary_keys/uuid_primary_key.cr @@ -1855,7 +1855,7 @@


- [View source] + [View source]
@@ -1885,7 +1885,7 @@


- [View source] + [View source]
@@ -1901,7 +1901,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/StringColumn.html b/Avram/Migrator/Columns/StringColumn.html index 5f9b23c6b..f8abcbd40 100644 --- a/Avram/Migrator/Columns/StringColumn.html +++ b/Avram/Migrator/Columns/StringColumn.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/string_column.cr @@ -1905,7 +1905,7 @@


- [View source] + [View source]
@@ -1942,7 +1942,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/TimeColumn.html b/Avram/Migrator/Columns/TimeColumn.html index d91b597ae..a48ce4ba5 100644 --- a/Avram/Migrator/Columns/TimeColumn.html +++ b/Avram/Migrator/Columns/TimeColumn.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/time_column.cr @@ -1920,7 +1920,7 @@


- [View source] + [View source]
@@ -1948,7 +1948,7 @@


- [View source] + [View source]
@@ -1976,7 +1976,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Columns/UUIDColumn.html b/Avram/Migrator/Columns/UUIDColumn.html index 8a8c2aa06..ece30282d 100644 --- a/Avram/Migrator/Columns/UUIDColumn.html +++ b/Avram/Migrator/Columns/UUIDColumn.html @@ -1719,7 +1719,7 @@

- + avram/migrator/columns/uuid_column.cr @@ -1903,7 +1903,7 @@


- [View source] + [View source]
@@ -1933,7 +1933,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/CreateExtensionStatement.html b/Avram/Migrator/CreateExtensionStatement.html index 30631cf68..56a9aa434 100644 --- a/Avram/Migrator/CreateExtensionStatement.html +++ b/Avram/Migrator/CreateExtensionStatement.html @@ -1719,7 +1719,7 @@

- + avram/migrator/create_extension_statement.cr @@ -1826,7 +1826,7 @@


- [View source] + [View source]
@@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/CreateForeignKeyStatement.html b/Avram/Migrator/CreateForeignKeyStatement.html index d17b435c4..033d611d6 100644 --- a/Avram/Migrator/CreateForeignKeyStatement.html +++ b/Avram/Migrator/CreateForeignKeyStatement.html @@ -1737,7 +1737,7 @@

- + avram/migrator/create_foreign_key_statement.cr @@ -1844,7 +1844,7 @@


- [View source] + [View source]
@@ -1874,7 +1874,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/CreateFunctionStatement.html b/Avram/Migrator/CreateFunctionStatement.html index d023eda93..772d7cf2d 100644 --- a/Avram/Migrator/CreateFunctionStatement.html +++ b/Avram/Migrator/CreateFunctionStatement.html @@ -1719,7 +1719,7 @@

- + avram/migrator/create_function_statement.cr @@ -1831,7 +1831,7 @@


- [View source] + [View source]
@@ -1861,7 +1861,7 @@


- [View source] + [View source]
@@ -1877,7 +1877,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/CreateIndexStatement.html b/Avram/Migrator/CreateIndexStatement.html index d5aabe30e..654070d84 100644 --- a/Avram/Migrator/CreateIndexStatement.html +++ b/Avram/Migrator/CreateIndexStatement.html @@ -1759,7 +1759,7 @@

- + avram/migrator/create_index_statement.cr @@ -1890,7 +1890,7 @@


- [View source] + [View source]
@@ -1920,7 +1920,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/CreateIndexStatement/IndexTypes.html b/Avram/Migrator/CreateIndexStatement/IndexTypes.html index 6621677a4..8b5950160 100644 --- a/Avram/Migrator/CreateIndexStatement/IndexTypes.html +++ b/Avram/Migrator/CreateIndexStatement/IndexTypes.html @@ -1717,7 +1717,7 @@

- + avram/migrator/create_index_statement.cr @@ -1899,7 +1899,7 @@


- [View source] + [View source]
@@ -1915,7 +1915,7 @@


- [View source] + [View source]
@@ -1931,7 +1931,7 @@


- [View source] + [View source]
@@ -1947,7 +1947,7 @@


- [View source] + [View source]
@@ -1963,7 +1963,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/CreateTableStatement.html b/Avram/Migrator/CreateTableStatement.html index d68740d84..c1f14c5ed 100644 --- a/Avram/Migrator/CreateTableStatement.html +++ b/Avram/Migrator/CreateTableStatement.html @@ -1735,7 +1735,7 @@

- + avram/migrator/create_table_statement.cr @@ -1927,7 +1927,7 @@


- [View source] + [View source]
@@ -1988,7 +1988,7 @@


- [View source] + [View source]
@@ -2004,7 +2004,7 @@


- [View source] + [View source]
@@ -2032,7 +2032,7 @@


- [View source] + [View source]
@@ -2053,7 +2053,7 @@


- [View source] + [View source]
@@ -2069,7 +2069,7 @@


- [View source] + [View source]
@@ -2085,7 +2085,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/CreateTriggerStatement.html b/Avram/Migrator/CreateTriggerStatement.html index 41560a536..d4efbc3d3 100644 --- a/Avram/Migrator/CreateTriggerStatement.html +++ b/Avram/Migrator/CreateTriggerStatement.html @@ -1719,7 +1719,7 @@

- + avram/migrator/create_trigger_statement.cr @@ -1826,7 +1826,7 @@


- [View source] + [View source]
@@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/DropExtensionStatement.html b/Avram/Migrator/DropExtensionStatement.html index 96c911e68..a0d3767cf 100644 --- a/Avram/Migrator/DropExtensionStatement.html +++ b/Avram/Migrator/DropExtensionStatement.html @@ -1719,7 +1719,7 @@

- + avram/migrator/drop_extension_statement.cr @@ -1826,7 +1826,7 @@


- [View source] + [View source]
@@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/DropForeignKeyStatement.html b/Avram/Migrator/DropForeignKeyStatement.html index 4e3286cfd..a9b847c21 100644 --- a/Avram/Migrator/DropForeignKeyStatement.html +++ b/Avram/Migrator/DropForeignKeyStatement.html @@ -1737,7 +1737,7 @@

- + avram/migrator/drop_foreign_key_statement.cr @@ -1844,7 +1844,7 @@


- [View source] + [View source]
@@ -1874,7 +1874,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/DropFunctionStatement.html b/Avram/Migrator/DropFunctionStatement.html index cfe8d7e3c..f8d91113b 100644 --- a/Avram/Migrator/DropFunctionStatement.html +++ b/Avram/Migrator/DropFunctionStatement.html @@ -1719,7 +1719,7 @@

- + avram/migrator/drop_function_statement.cr @@ -1826,7 +1826,7 @@


- [View source] + [View source]
@@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/DropIndexStatement.html b/Avram/Migrator/DropIndexStatement.html index 2b231fde9..23eeb773a 100644 --- a/Avram/Migrator/DropIndexStatement.html +++ b/Avram/Migrator/DropIndexStatement.html @@ -1758,7 +1758,7 @@

- + avram/migrator/drop_index_statement.cr @@ -1913,7 +1913,7 @@


- [View source] + [View source]
@@ -1943,7 +1943,7 @@


- [View source] + [View source]
@@ -1959,7 +1959,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/DropTableStatement.html b/Avram/Migrator/DropTableStatement.html index 4d420777a..195c39b4e 100644 --- a/Avram/Migrator/DropTableStatement.html +++ b/Avram/Migrator/DropTableStatement.html @@ -1719,7 +1719,7 @@

- + avram/migrator/drop_table_statement.cr @@ -1826,7 +1826,7 @@


- [View source] + [View source]
@@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/DropTriggerStatement.html b/Avram/Migrator/DropTriggerStatement.html index 04b61be41..c195b6867 100644 --- a/Avram/Migrator/DropTriggerStatement.html +++ b/Avram/Migrator/DropTriggerStatement.html @@ -1719,7 +1719,7 @@

- + avram/migrator/drop_trigger_statement.cr @@ -1826,7 +1826,7 @@


- [View source] + [View source]
@@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/IndexStatementHelpers.html b/Avram/Migrator/IndexStatementHelpers.html index e2ec85b5a..60f224c90 100644 --- a/Avram/Migrator/IndexStatementHelpers.html +++ b/Avram/Migrator/IndexStatementHelpers.html @@ -1739,7 +1739,7 @@

- + avram/migrator/index_statement_helpers.cr @@ -1818,7 +1818,7 @@


- [View source] + [View source]
@@ -1839,7 +1839,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/IndexStatementHelpers/Columns.html b/Avram/Migrator/IndexStatementHelpers/Columns.html index e5c14610e..d76f9282f 100644 --- a/Avram/Migrator/IndexStatementHelpers/Columns.html +++ b/Avram/Migrator/IndexStatementHelpers/Columns.html @@ -1727,7 +1727,7 @@

- + avram/migrator/index_statement_helpers.cr diff --git a/Avram/Migrator/Migration.html b/Avram/Migrator/Migration.html index 4d4280dd6..ee068a226 100644 --- a/Avram/Migrator/Migration.html +++ b/Avram/Migrator/Migration.html @@ -1717,7 +1717,7 @@

- + avram/migrator/migration.cr diff --git a/Avram/Migrator/Migration/V1.html b/Avram/Migrator/Migration/V1.html index 8870916e6..c0835297f 100644 --- a/Avram/Migrator/Migration/V1.html +++ b/Avram/Migrator/Migration/V1.html @@ -1733,7 +1733,7 @@

- + avram/migrator/migration.cr @@ -1989,7 +1989,7 @@


- [View source] + [View source]
@@ -2005,7 +2005,7 @@


- [View source] + [View source]
@@ -2021,7 +2021,7 @@


- [View source] + [View source]
@@ -2037,7 +2037,7 @@


- [View source] + [View source]
@@ -2053,7 +2053,7 @@


- [View source] + [View source]
@@ -2069,7 +2069,7 @@


- [View source] + [View source]
@@ -2093,7 +2093,7 @@


- [View source] + [View source]
@@ -2109,7 +2109,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Migration/V1/MigrationId.html b/Avram/Migrator/Migration/V1/MigrationId.html index 5127f36f0..aaa4aeb47 100644 --- a/Avram/Migrator/Migration/V1/MigrationId.html +++ b/Avram/Migrator/Migration/V1/MigrationId.html @@ -1727,7 +1727,7 @@

- + avram/migrator/migration.cr diff --git a/Avram/Migrator/MigrationGenerator.html b/Avram/Migrator/MigrationGenerator.html index 02be55812..ddf84b8b5 100644 --- a/Avram/Migrator/MigrationGenerator.html +++ b/Avram/Migrator/MigrationGenerator.html @@ -1733,7 +1733,7 @@

- + avram/tasks/gen/migration_generator.cr @@ -1877,7 +1877,7 @@


- [View source] + [View source]
@@ -1893,7 +1893,7 @@


- [View source] + [View source]
@@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
@@ -1955,7 +1955,7 @@


- [View source] + [View source]
@@ -1971,7 +1971,7 @@


- [View source] + [View source]
@@ -2003,7 +2003,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/MissingOnDeleteWithBelongsToError.html b/Avram/Migrator/MissingOnDeleteWithBelongsToError.html index 91c81a5d5..0e33455f3 100644 --- a/Avram/Migrator/MissingOnDeleteWithBelongsToError.html +++ b/Avram/Migrator/MissingOnDeleteWithBelongsToError.html @@ -1733,7 +1733,7 @@

- + avram/migrator/missing_on_delete_with_belongs_to_error.cr @@ -1800,7 +1800,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/Runner.html b/Avram/Migrator/Runner.html index a399a0a07..ea548bf4e 100644 --- a/Avram/Migrator/Runner.html +++ b/Avram/Migrator/Runner.html @@ -1733,7 +1733,7 @@

- + avram/migrator/runner.cr @@ -1968,7 +1968,7 @@


- [View source] + [View source]
@@ -1996,7 +1996,7 @@


- [View source] + [View source]
@@ -2012,7 +2012,7 @@


- [View source] + [View source]
@@ -2028,7 +2028,7 @@


- [View source] + [View source]
@@ -2044,7 +2044,7 @@


- [View source] + [View source]
@@ -2060,7 +2060,7 @@


- [View source] + [View source]
@@ -2076,7 +2076,7 @@


- [View source] + [View source]
@@ -2092,7 +2092,7 @@


- [View source] + [View source]
@@ -2108,7 +2108,7 @@


- [View source] + [View source]
@@ -2124,7 +2124,7 @@


- [View source] + [View source]
@@ -2146,7 +2146,7 @@


- [View source] + [View source]
@@ -2162,7 +2162,7 @@


- [View source] + [View source]
@@ -2178,7 +2178,7 @@


- [View source] + [View source]
@@ -2194,7 +2194,7 @@


- [View source] + [View source]
@@ -2210,7 +2210,7 @@


- [View source] + [View source]
@@ -2238,7 +2238,7 @@


- [View source] + [View source]
@@ -2254,7 +2254,7 @@


- [View source] + [View source]
@@ -2270,7 +2270,7 @@


- [View source] + [View source]
@@ -2286,7 +2286,7 @@


- [View source] + [View source]
@@ -2302,7 +2302,7 @@


- [View source] + [View source]
@@ -2318,7 +2318,7 @@


- [View source] + [View source]
diff --git a/Avram/Migrator/StatementHelpers.html b/Avram/Migrator/StatementHelpers.html index a524064fa..b6889bfec 100644 --- a/Avram/Migrator/StatementHelpers.html +++ b/Avram/Migrator/StatementHelpers.html @@ -1747,7 +1747,7 @@

- + avram/migrator/statement_helpers.cr @@ -1937,7 +1937,7 @@


- [View source] + [View source]
@@ -1953,7 +1953,7 @@


- [View source] + [View source]
@@ -1969,7 +1969,7 @@


- [View source] + [View source]
@@ -1997,7 +1997,7 @@


- [View source] + [View source]
@@ -2013,7 +2013,7 @@


- [View source] + [View source]
@@ -2029,7 +2029,7 @@


- [View source] + [View source]
@@ -2045,7 +2045,7 @@


- [View source] + [View source]
@@ -2061,7 +2061,7 @@


- [View source] + [View source]
@@ -2077,7 +2077,7 @@


- [View source] + [View source]
@@ -2098,7 +2098,7 @@


- [View source] + [View source]
@@ -2114,7 +2114,7 @@


- [View source] + [View source]
@@ -2130,7 +2130,7 @@


- [View source] + [View source]
@@ -2146,7 +2146,7 @@


- [View source] + [View source]
@@ -2162,7 +2162,7 @@


- [View source] + [View source]
@@ -2190,7 +2190,7 @@


- [View source] + [View source]
@@ -2206,7 +2206,7 @@


- [View source] + [View source]
diff --git a/Avram/MissingRequiredAssociationError.html b/Avram/MissingRequiredAssociationError.html index c64ccedf3..a364ef24f 100644 --- a/Avram/MissingRequiredAssociationError.html +++ b/Avram/MissingRequiredAssociationError.html @@ -1719,7 +1719,7 @@

- + avram/errors.cr @@ -1851,7 +1851,7 @@


- [View source] + [View source]
@@ -1881,7 +1881,7 @@


- [View source] + [View source]
@@ -1897,7 +1897,7 @@


- [View source] + [View source]
diff --git a/Avram/Model.html b/Avram/Model.html index ff81d0928..28bf0ea89 100644 --- a/Avram/Model.html +++ b/Avram/Model.html @@ -1737,7 +1737,7 @@

- + avram/model.cr @@ -2052,7 +2052,7 @@


- [View source] + [View source]
@@ -2068,7 +2068,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
@@ -2138,7 +2138,7 @@


- [View source] + [View source]
@@ -2159,7 +2159,7 @@


- [View source] + [View source]
@@ -2180,7 +2180,7 @@


- [View source] + [View source]
@@ -2208,7 +2208,7 @@


- [View source] + [View source]
@@ -2224,7 +2224,7 @@


- [View source] + [View source]
@@ -2240,7 +2240,7 @@


- [View source] + [View source]
@@ -2256,7 +2256,7 @@


- [View source] + [View source]
@@ -2272,7 +2272,7 @@


- [View source] + [View source]
@@ -2288,7 +2288,7 @@


- [View source] + [View source]
@@ -2304,7 +2304,7 @@


- [View source] + [View source]
@@ -2327,7 +2327,7 @@


- [View source] + [View source]
@@ -2343,7 +2343,7 @@


- [View source] + [View source]
@@ -2359,7 +2359,7 @@


- [View source] + [View source]
@@ -2375,7 +2375,7 @@


- [View source] + [View source]
@@ -2391,7 +2391,7 @@


- [View source] + [View source]
@@ -2407,7 +2407,7 @@


- [View source] + [View source]
@@ -2423,7 +2423,7 @@


- [View source] + [View source]
@@ -2439,7 +2439,7 @@


- [View source] + [View source]
@@ -2455,7 +2455,7 @@


- [View source] + [View source]
@@ -2471,7 +2471,7 @@


- [View source] + [View source]
@@ -2487,7 +2487,7 @@


- [View source] + [View source]
diff --git a/Avram/Model/JSONConverter.html b/Avram/Model/JSONConverter.html index 97c534e9c..dc1786f6b 100644 --- a/Avram/Model/JSONConverter.html +++ b/Avram/Model/JSONConverter.html @@ -1717,7 +1717,7 @@

- + avram/model.cr @@ -1780,7 +1780,7 @@


- [View source] + [View source]
diff --git a/Avram/NeedyInitializer.html b/Avram/NeedyInitializer.html index 7e117826e..097d7b65c 100644 --- a/Avram/NeedyInitializer.html +++ b/Avram/NeedyInitializer.html @@ -1731,7 +1731,7 @@

- + avram/needy_initializer.cr @@ -1813,7 +1813,7 @@


- [View source] + [View source]
@@ -1829,7 +1829,7 @@


- [View source] + [View source]
@@ -1845,7 +1845,7 @@


- [View source] + [View source]
@@ -1861,7 +1861,7 @@


- [View source] + [View source]
diff --git a/Avram/NeedyInitializerAndDeleteMethods.html b/Avram/NeedyInitializerAndDeleteMethods.html index ea5d0cf6b..7cec1ffc0 100644 --- a/Avram/NeedyInitializerAndDeleteMethods.html +++ b/Avram/NeedyInitializerAndDeleteMethods.html @@ -1731,7 +1731,7 @@

- + avram/needy_initializer_and_delete_methods.cr @@ -1828,7 +1828,7 @@


- [View source] + [View source]
@@ -1844,7 +1844,7 @@


- [View source] + [View source]
@@ -1860,7 +1860,7 @@


- [View source] + [View source]
@@ -1876,7 +1876,7 @@


- [View source] + [View source]
@@ -1892,7 +1892,7 @@


- [View source] + [View source]
@@ -1908,7 +1908,7 @@


- [View source] + [View source]
@@ -1924,7 +1924,7 @@


- [View source] + [View source]
diff --git a/Avram/NeedyInitializerAndSaveMethods.html b/Avram/NeedyInitializerAndSaveMethods.html index c33f9d746..4b58fde12 100644 --- a/Avram/NeedyInitializerAndSaveMethods.html +++ b/Avram/NeedyInitializerAndSaveMethods.html @@ -1731,7 +1731,7 @@

- + avram/needy_initializer_and_save_methods.cr @@ -1833,7 +1833,7 @@


- [View source] + [View source]
@@ -1849,7 +1849,7 @@


- [View source] + [View source]
@@ -1865,7 +1865,7 @@


- [View source] + [View source]
@@ -1881,7 +1881,7 @@


- [View source] + [View source]
@@ -1897,7 +1897,7 @@


- [View source] + [View source]
@@ -1913,7 +1913,7 @@


- [View source] + [View source]
@@ -1929,7 +1929,7 @@


- [View source] + [View source]
@@ -1945,7 +1945,7 @@


- [View source] + [View source]
diff --git a/Avram/NestedSaveOperation.html b/Avram/NestedSaveOperation.html index 9929752b3..33e23f982 100644 --- a/Avram/NestedSaveOperation.html +++ b/Avram/NestedSaveOperation.html @@ -1731,7 +1731,7 @@

- + avram/nested_save_operation.cr @@ -1818,7 +1818,7 @@


- [View source] + [View source]
@@ -1834,7 +1834,7 @@


- [View source] + [View source]
@@ -1862,7 +1862,7 @@


- [View source] + [View source]
diff --git a/Avram/Nothing.html b/Avram/Nothing.html index 09bd9379d..1205e283a 100644 --- a/Avram/Nothing.html +++ b/Avram/Nothing.html @@ -1733,7 +1733,7 @@

- + avram/nothing.cr diff --git a/Avram/Operation.html b/Avram/Operation.html index 68156e478..140e12907 100644 --- a/Avram/Operation.html +++ b/Avram/Operation.html @@ -1743,7 +1743,7 @@

- + avram/operation.cr @@ -2100,7 +2100,7 @@


- [View source] + [View source]
@@ -2116,7 +2116,7 @@


- [View source] + [View source]
@@ -2144,7 +2144,7 @@


- [View source] + [View source]
@@ -2169,7 +2169,7 @@


- [View source] + [View source]
@@ -2194,7 +2194,7 @@


- [View source] + [View source]
@@ -2217,7 +2217,7 @@


- [View source] + [View source]
@@ -2240,7 +2240,7 @@


- [View source] + [View source]
@@ -2268,7 +2268,7 @@


- [View source] + [View source]
@@ -2284,7 +2284,7 @@


- [View source] + [View source]
@@ -2314,7 +2314,7 @@


- [View source] + [View source]
@@ -2330,7 +2330,7 @@


- [View source] + [View source]
@@ -2352,7 +2352,7 @@


- [View source] + [View source]
diff --git a/Avram/OperationErrors.html b/Avram/OperationErrors.html index ee0cedb70..c683b2493 100644 --- a/Avram/OperationErrors.html +++ b/Avram/OperationErrors.html @@ -1735,7 +1735,7 @@

- + avram/operation_errors.cr @@ -1805,7 +1805,7 @@


- [View source] + [View source]
@@ -1821,7 +1821,7 @@


- [View source] + [View source]
diff --git a/Avram/OrderBy.html b/Avram/OrderBy.html index cb569f4a5..722156ff7 100644 --- a/Avram/OrderBy.html +++ b/Avram/OrderBy.html @@ -1719,7 +1719,7 @@

- + avram/order_by_clause/order_by.cr @@ -1882,7 +1882,7 @@


- [View source] + [View source]
@@ -1917,7 +1917,7 @@


- [View source] + [View source]
@@ -1933,7 +1933,7 @@


- [View source] + [View source]
@@ -1949,7 +1949,7 @@


- [View source] + [View source]
@@ -1965,7 +1965,7 @@


- [View source] + [View source]
@@ -1981,7 +1981,7 @@


- [View source] + [View source]
@@ -1997,7 +1997,7 @@


- [View source] + [View source]
diff --git a/Avram/OrderBy/Direction.html b/Avram/OrderBy/Direction.html index 08126cd81..897d4afe2 100644 --- a/Avram/OrderBy/Direction.html +++ b/Avram/OrderBy/Direction.html @@ -1717,7 +1717,7 @@

- + avram/order_by_clause/order_by.cr @@ -1869,7 +1869,7 @@


- [View source] + [View source]
@@ -1885,7 +1885,7 @@


- [View source] + [View source]
diff --git a/Avram/OrderBy/NullSorting.html b/Avram/OrderBy/NullSorting.html index 80f874586..465cdec0e 100644 --- a/Avram/OrderBy/NullSorting.html +++ b/Avram/OrderBy/NullSorting.html @@ -1717,7 +1717,7 @@

- + avram/order_by_clause/order_by.cr @@ -1886,7 +1886,7 @@


- [View source] + [View source]
@@ -1902,7 +1902,7 @@


- [View source] + [View source]
@@ -1918,7 +1918,7 @@


- [View source] + [View source]
@@ -1953,7 +1953,7 @@


- [View source] + [View source]
diff --git a/Avram/OrderByClause.html b/Avram/OrderByClause.html index ffc7fa6db..16b8b7c59 100644 --- a/Avram/OrderByClause.html +++ b/Avram/OrderByClause.html @@ -1735,7 +1735,7 @@

- + avram/order_by_clause.cr @@ -1839,7 +1839,7 @@


- [View source] + [View source]
@@ -1855,7 +1855,7 @@


- [View source] + [View source]
@@ -1871,7 +1871,7 @@


- [View source] + [View source]
diff --git a/Avram/OrderByRandom.html b/Avram/OrderByRandom.html index 0fc32b64b..62578bfa8 100644 --- a/Avram/OrderByRandom.html +++ b/Avram/OrderByRandom.html @@ -1719,7 +1719,7 @@

- + avram/order_by_clause/order_by_random.cr @@ -1864,7 +1864,7 @@


- [View source] + [View source]
@@ -1880,7 +1880,7 @@


- [View source] + [View source]
@@ -1896,7 +1896,7 @@


- [View source] + [View source]
@@ -1912,7 +1912,7 @@


- [View source] + [View source]
diff --git a/Avram/PGClientNotInstalledError.html b/Avram/PGClientNotInstalledError.html index 4506bdbb1..c87bc266e 100644 --- a/Avram/PGClientNotInstalledError.html +++ b/Avram/PGClientNotInstalledError.html @@ -1719,7 +1719,7 @@

- + avram/errors.cr @@ -1829,7 +1829,7 @@


- [View source] + [View source]
diff --git a/Avram/PGNotRunningError.html b/Avram/PGNotRunningError.html index b6436467b..86cd3fed8 100644 --- a/Avram/PGNotRunningError.html +++ b/Avram/PGNotRunningError.html @@ -1719,7 +1719,7 @@

- + avram/errors.cr @@ -1829,7 +1829,7 @@


- [View source] + [View source]
diff --git a/Avram/ParamKeyOverride.html b/Avram/ParamKeyOverride.html index 51afd3009..5aee68cd0 100644 --- a/Avram/ParamKeyOverride.html +++ b/Avram/ParamKeyOverride.html @@ -1735,7 +1735,7 @@

- + avram/param_key_override.cr @@ -1802,7 +1802,7 @@


- [View source] + [View source]
diff --git a/Avram/Paramable.html b/Avram/Paramable.html index d9992b8eb..648f5db5c 100644 --- a/Avram/Paramable.html +++ b/Avram/Paramable.html @@ -1733,7 +1733,7 @@

- + avram/paramable.cr @@ -1848,7 +1848,7 @@


- [View source] + [View source]
@@ -1864,7 +1864,7 @@


- [View source] + [View source]
@@ -1880,7 +1880,7 @@


- [View source] + [View source]
@@ -1896,7 +1896,7 @@


- [View source] + [View source]
@@ -1912,7 +1912,7 @@


- [View source] + [View source]
@@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1944,7 +1944,7 @@


- [View source] + [View source]
@@ -1960,7 +1960,7 @@


- [View source] + [View source]
@@ -1976,7 +1976,7 @@


- [View source] + [View source]
@@ -1992,7 +1992,7 @@


- [View source] + [View source]
@@ -2008,7 +2008,7 @@


- [View source] + [View source]
diff --git a/Avram/Params.html b/Avram/Params.html index eedfbf178..7f72320cb 100644 --- a/Avram/Params.html +++ b/Avram/Params.html @@ -1733,7 +1733,7 @@

- + avram/params.cr @@ -1974,7 +1974,7 @@


- [View source] + [View source]
@@ -1990,7 +1990,7 @@


- [View source] + [View source]
@@ -2020,7 +2020,7 @@


- [View source] + [View source]
@@ -2036,7 +2036,7 @@


- [View source] + [View source]
@@ -2052,7 +2052,7 @@


- [View source] + [View source]
@@ -2068,7 +2068,7 @@


- [View source] + [View source]
@@ -2084,7 +2084,7 @@


- [View source] + [View source]
@@ -2100,7 +2100,7 @@


- [View source] + [View source]
@@ -2116,7 +2116,7 @@


- [View source] + [View source]
@@ -2132,7 +2132,7 @@


- [View source] + [View source]
@@ -2148,7 +2148,7 @@


- [View source] + [View source]
@@ -2164,7 +2164,7 @@


- [View source] + [View source]
@@ -2180,7 +2180,7 @@


- [View source] + [View source]
@@ -2196,7 +2196,7 @@


- [View source] + [View source]
@@ -2212,7 +2212,7 @@


- [View source] + [View source]
diff --git a/Avram/PermittedAttribute.html b/Avram/PermittedAttribute.html index 9b8016d12..6c1e62da1 100644 --- a/Avram/PermittedAttribute.html +++ b/Avram/PermittedAttribute.html @@ -1719,7 +1719,7 @@

- + avram/permitted_attribute.cr @@ -1947,7 +1947,7 @@


- [View source] + [View source]
diff --git a/Avram/Polymorphic.html b/Avram/Polymorphic.html index 457726d35..6e2c0ad8b 100644 --- a/Avram/Polymorphic.html +++ b/Avram/Polymorphic.html @@ -1742,7 +1742,7 @@

- + avram/polymorphic.cr @@ -1825,7 +1825,7 @@

View source] + [View source] diff --git a/Avram/PrimaryKeyMethods.html b/Avram/PrimaryKeyMethods.html index 1ab51cb5f..beba501d7 100644 --- a/Avram/PrimaryKeyMethods.html +++ b/Avram/PrimaryKeyMethods.html @@ -1717,7 +1717,7 @@

- + avram/primary_key_methods.cr @@ -1813,7 +1813,7 @@


- [View source] + [View source]
@@ -1829,7 +1829,7 @@


- [View source] + [View source]
@@ -1845,7 +1845,7 @@


- [View source] + [View source]
@@ -1885,7 +1885,7 @@


- [View source] + [View source]
@@ -1922,7 +1922,7 @@


- [View source] + [View source]
@@ -1944,7 +1944,7 @@


- [View source] + [View source]
diff --git a/Avram/PrimaryKeyQueryable.html b/Avram/PrimaryKeyQueryable.html index 1385f63e5..726836971 100644 --- a/Avram/PrimaryKeyQueryable.html +++ b/Avram/PrimaryKeyQueryable.html @@ -1717,7 +1717,7 @@

- + avram/primary_key_queryable.cr diff --git a/Avram/PrimaryKeyType.html b/Avram/PrimaryKeyType.html index 50ed9cd24..4ed9c9923 100644 --- a/Avram/PrimaryKeyType.html +++ b/Avram/PrimaryKeyType.html @@ -1717,7 +1717,7 @@

- + avram/primary_key_type.cr @@ -1869,7 +1869,7 @@


- [View source] + [View source]
@@ -1885,7 +1885,7 @@


- [View source] + [View source]
diff --git a/Avram/QueryBuilder.html b/Avram/QueryBuilder.html index b95672b1d..ae69c788e 100644 --- a/Avram/QueryBuilder.html +++ b/Avram/QueryBuilder.html @@ -1719,7 +1719,7 @@

- + avram/query_builder.cr @@ -2081,7 +2081,7 @@


- [View source] + [View source]
@@ -2111,7 +2111,7 @@


- [View source] + [View source]
@@ -2127,7 +2127,7 @@


- [View source] + [View source]
@@ -2149,7 +2149,7 @@


- [View source] + [View source]
@@ -2170,7 +2170,7 @@


- [View source] + [View source]
@@ -2186,7 +2186,7 @@


- [View source] + [View source]
@@ -2202,7 +2202,7 @@


- [View source] + [View source]
@@ -2218,7 +2218,7 @@


- [View source] + [View source]
@@ -2234,7 +2234,7 @@


- [View source] + [View source]
@@ -2250,7 +2250,7 @@


- [View source] + [View source]
@@ -2266,7 +2266,7 @@


- [View source] + [View source]
@@ -2282,7 +2282,7 @@


- [View source] + [View source]
@@ -2298,7 +2298,7 @@


- [View source] + [View source]
@@ -2314,7 +2314,7 @@


- [View source] + [View source]
@@ -2330,7 +2330,7 @@


- [View source] + [View source]
@@ -2346,7 +2346,7 @@


- [View source] + [View source]
@@ -2362,7 +2362,7 @@


- [View source] + [View source]
@@ -2378,7 +2378,7 @@


- [View source] + [View source]
@@ -2394,7 +2394,7 @@


- [View source] + [View source]
@@ -2415,7 +2415,7 @@


- [View source] + [View source]
@@ -2431,7 +2431,7 @@


- [View source] + [View source]
@@ -2447,7 +2447,7 @@


- [View source] + [View source]
@@ -2463,7 +2463,7 @@


- [View source] + [View source]
@@ -2479,7 +2479,7 @@


- [View source] + [View source]
@@ -2495,7 +2495,7 @@


- [View source] + [View source]
@@ -2511,7 +2511,7 @@


- [View source] + [View source]
@@ -2527,7 +2527,7 @@


- [View source] + [View source]
@@ -2543,7 +2543,7 @@


- [View source] + [View source]
@@ -2559,7 +2559,7 @@


- [View source] + [View source]
@@ -2580,7 +2580,7 @@


- [View source] + [View source]
@@ -2596,7 +2596,7 @@


- [View source] + [View source]
@@ -2612,7 +2612,7 @@


- [View source] + [View source]
@@ -2628,7 +2628,7 @@


- [View source] + [View source]
@@ -2644,7 +2644,7 @@


- [View source] + [View source]
@@ -2660,7 +2660,7 @@


- [View source] + [View source]
@@ -2676,7 +2676,7 @@


- [View source] + [View source]
@@ -2692,7 +2692,7 @@


- [View source] + [View source]
@@ -2708,7 +2708,7 @@


- [View source] + [View source]
@@ -2724,7 +2724,7 @@


- [View source] + [View source]
@@ -2740,7 +2740,7 @@


- [View source] + [View source]
@@ -2756,7 +2756,7 @@


- [View source] + [View source]
@@ -2772,7 +2772,7 @@


- [View source] + [View source]
@@ -2788,7 +2788,7 @@


- [View source] + [View source]
@@ -2804,7 +2804,7 @@


- [View source] + [View source]
@@ -2820,7 +2820,7 @@


- [View source] + [View source]
@@ -2836,7 +2836,7 @@


- [View source] + [View source]
@@ -2852,7 +2852,7 @@


- [View source] + [View source]
@@ -2874,7 +2874,7 @@


- [View source] + [View source]
@@ -2890,7 +2890,7 @@


- [View source] + [View source]
@@ -2906,7 +2906,7 @@


- [View source] + [View source]
@@ -2922,7 +2922,7 @@


- [View source] + [View source]
diff --git a/Avram/QueryBuilder/ColumnName.html b/Avram/QueryBuilder/ColumnName.html index 55ac55d26..9309019be 100644 --- a/Avram/QueryBuilder/ColumnName.html +++ b/Avram/QueryBuilder/ColumnName.html @@ -1727,7 +1727,7 @@

- + avram/query_builder.cr diff --git a/Avram/Queryable.html b/Avram/Queryable.html index 1143b71bb..e54619a44 100644 --- a/Avram/Queryable.html +++ b/Avram/Queryable.html @@ -1731,7 +1731,7 @@

- + avram/queryable.cr @@ -2067,7 +2067,7 @@


- [View source] + [View source]
@@ -2094,7 +2094,7 @@


- [View source] + [View source]
@@ -2110,7 +2110,7 @@


- [View source] + [View source]
@@ -2126,7 +2126,7 @@


- [View source] + [View source]
@@ -2142,7 +2142,7 @@


- [View source] + [View source]
@@ -2158,7 +2158,7 @@


- [View source] + [View source]
@@ -2174,7 +2174,7 @@


- [View source] + [View source]
@@ -2198,7 +2198,7 @@


- [View source] + [View source]
@@ -2214,7 +2214,7 @@


- [View source] + [View source]
@@ -2230,7 +2230,7 @@


- [View source] + [View source]
@@ -2255,7 +2255,7 @@


- [View source] + [View source]
@@ -2271,7 +2271,7 @@


- [View source] + [View source]
@@ -2299,7 +2299,7 @@


- [View source] + [View source]
@@ -2327,7 +2327,7 @@


- [View source] + [View source]
@@ -2343,7 +2343,7 @@


- [View source] + [View source]
@@ -2359,7 +2359,7 @@


- [View source] + [View source]
@@ -2375,7 +2375,7 @@


- [View source] + [View source]
@@ -2391,7 +2391,7 @@


- [View source] + [View source]
@@ -2407,7 +2407,7 @@


- [View source] + [View source]
@@ -2423,7 +2423,7 @@


- [View source] + [View source]
@@ -2439,7 +2439,7 @@


- [View source] + [View source]
@@ -2455,7 +2455,7 @@


- [View source] + [View source]
@@ -2483,7 +2483,7 @@


- [View source] + [View source]
@@ -2499,7 +2499,7 @@


- [View source] + [View source]
@@ -2521,7 +2521,7 @@


- [View source] + [View source]
@@ -2537,7 +2537,7 @@


- [View source] + [View source]
@@ -2553,7 +2553,7 @@


- [View source] + [View source]
@@ -2569,7 +2569,7 @@


- [View source] + [View source]
@@ -2585,7 +2585,7 @@


- [View source] + [View source]
@@ -2601,7 +2601,7 @@


- [View source] + [View source]
@@ -2617,7 +2617,7 @@


- [View source] + [View source]
@@ -2633,7 +2633,7 @@


- [View source] + [View source]
@@ -2649,7 +2649,7 @@


- [View source] + [View source]
@@ -2665,7 +2665,7 @@


- [View source] + [View source]
@@ -2681,7 +2681,7 @@


- [View source] + [View source]
@@ -2697,7 +2697,7 @@


- [View source] + [View source]
@@ -2713,7 +2713,7 @@


- [View source] + [View source]
@@ -2729,7 +2729,7 @@


- [View source] + [View source]
@@ -2745,7 +2745,7 @@


- [View source] + [View source]
@@ -2761,7 +2761,7 @@


- [View source] + [View source]
@@ -2777,7 +2777,7 @@


- [View source] + [View source]
@@ -2793,7 +2793,7 @@


- [View source] + [View source]
@@ -2809,7 +2809,7 @@


- [View source] + [View source]
@@ -2825,7 +2825,7 @@


- [View source] + [View source]
@@ -2849,7 +2849,7 @@


- [View source] + [View source]
@@ -2865,7 +2865,7 @@


- [View source] + [View source]
@@ -2881,7 +2881,7 @@


- [View source] + [View source]
@@ -2897,7 +2897,7 @@


- [View source] + [View source]
@@ -2913,7 +2913,7 @@


- [View source] + [View source]
@@ -2929,7 +2929,7 @@


- [View source] + [View source]
diff --git a/Avram/Queryable/PGValue.html b/Avram/Queryable/PGValue.html index 4b21fd4ea..67196fc4a 100644 --- a/Avram/Queryable/PGValue.html +++ b/Avram/Queryable/PGValue.html @@ -1738,7 +1738,7 @@

- + avram/queryable.cr diff --git a/Avram/RecordNotFoundError.html b/Avram/RecordNotFoundError.html index aeecb1471..bb2f59afe 100644 --- a/Avram/RecordNotFoundError.html +++ b/Avram/RecordNotFoundError.html @@ -1730,7 +1730,7 @@

- + avram/errors.cr @@ -1872,7 +1872,7 @@


- [View source] + [View source]
@@ -1888,7 +1888,7 @@


- [View source] + [View source]
@@ -1918,7 +1918,7 @@


- [View source] + [View source]
@@ -1934,7 +1934,7 @@


- [View source] + [View source]
@@ -1950,7 +1950,7 @@


- [View source] + [View source]
diff --git a/Avram/Rollback.html b/Avram/Rollback.html index 2dcb338c1..6216a7ba2 100644 --- a/Avram/Rollback.html +++ b/Avram/Rollback.html @@ -1730,7 +1730,7 @@

- + avram/errors.cr diff --git a/Avram/SaveOperation.html b/Avram/SaveOperation.html index 2f10b1bee..5f706b03a 100644 --- a/Avram/SaveOperation.html +++ b/Avram/SaveOperation.html @@ -1755,7 +1755,7 @@

- + avram/save_operation.cr @@ -2311,7 +2311,7 @@


- [View source] + [View source]
@@ -2327,7 +2327,7 @@


- [View source] + [View source]
@@ -2355,7 +2355,7 @@


- [View source] + [View source]
@@ -2377,7 +2377,7 @@


- [View source] + [View source]
@@ -2399,7 +2399,7 @@


- [View source] + [View source]
@@ -2427,7 +2427,7 @@


- [View source] + [View source]
@@ -2443,7 +2443,7 @@


- [View source] + [View source]
@@ -2459,7 +2459,7 @@


- [View source] + [View source]
@@ -2475,7 +2475,7 @@


- [View source] + [View source]
@@ -2491,7 +2491,7 @@


- [View source] + [View source]
@@ -2507,7 +2507,7 @@


- [View source] + [View source]
@@ -2537,7 +2537,7 @@


- [View source] + [View source]
@@ -2553,7 +2553,7 @@


- [View source] + [View source]
@@ -2569,7 +2569,7 @@


- [View source] + [View source]
@@ -2593,7 +2593,7 @@


- [View source] + [View source]
@@ -2609,7 +2609,7 @@


- [View source] + [View source]
@@ -2625,7 +2625,7 @@


- [View source] + [View source]
@@ -2641,7 +2641,7 @@


- [View source] + [View source]
@@ -2657,7 +2657,7 @@


- [View source] + [View source]
@@ -2680,7 +2680,7 @@


- [View source] + [View source]
@@ -2696,7 +2696,7 @@


- [View source] + [View source]
@@ -2712,7 +2712,7 @@


- [View source] + [View source]
@@ -2733,7 +2733,7 @@


- [View source] + [View source]
@@ -2749,7 +2749,7 @@


- [View source] + [View source]
@@ -2765,7 +2765,7 @@


- [View source] + [View source]
@@ -2786,7 +2786,7 @@


- [View source] + [View source]
@@ -2802,7 +2802,7 @@


- [View source] + [View source]
@@ -2818,7 +2818,7 @@


- [View source] + [View source]
@@ -2834,7 +2834,7 @@


- [View source] + [View source]
@@ -2850,7 +2850,7 @@


- [View source] + [View source]
@@ -2873,7 +2873,7 @@


- [View source] + [View source]
@@ -2901,7 +2901,7 @@


- [View source] + [View source]
@@ -2931,7 +2931,7 @@


- [View source] + [View source]
@@ -2954,7 +2954,7 @@


- [View source] + [View source]
diff --git a/Avram/SaveOperation/OperationStatus.html b/Avram/SaveOperation/OperationStatus.html index c13a477b7..88f90eee3 100644 --- a/Avram/SaveOperation/OperationStatus.html +++ b/Avram/SaveOperation/OperationStatus.html @@ -1717,7 +1717,7 @@

- + avram/save_operation.cr @@ -1879,7 +1879,7 @@


- [View source] + [View source]
@@ -1895,7 +1895,7 @@


- [View source] + [View source]
@@ -1911,7 +1911,7 @@


- [View source] + [View source]
diff --git a/Avram/SaveOperationTemplate.html b/Avram/SaveOperationTemplate.html index f291b84c0..4b4e8c738 100644 --- a/Avram/SaveOperationTemplate.html +++ b/Avram/SaveOperationTemplate.html @@ -1719,7 +1719,7 @@

- + avram/save_operation_template.cr @@ -1815,7 +1815,7 @@


- [View source] + [View source]
diff --git a/Avram/SchemaEnforcer.html b/Avram/SchemaEnforcer.html index eb1f94040..d361747f7 100644 --- a/Avram/SchemaEnforcer.html +++ b/Avram/SchemaEnforcer.html @@ -1731,14 +1731,14 @@

- + avram/schema_enforcer.cr
- + avram/schema_enforcer/validation.cr @@ -1847,7 +1847,7 @@


- [View source] + [View source]
@@ -1877,7 +1877,7 @@


- [View source] + [View source]
@@ -1893,7 +1893,7 @@


- [View source] + [View source]
diff --git a/Avram/SchemaEnforcer/EnsureExistingTable.html b/Avram/SchemaEnforcer/EnsureExistingTable.html index 11a66879d..f0728adce 100644 --- a/Avram/SchemaEnforcer/EnsureExistingTable.html +++ b/Avram/SchemaEnforcer/EnsureExistingTable.html @@ -1719,7 +1719,7 @@

- + avram/schema_enforcer/ensure_existing_table.cr @@ -1841,7 +1841,7 @@


- [View source] + [View source]
diff --git a/Avram/SchemaEnforcer/EnsureMatchingColumns.html b/Avram/SchemaEnforcer/EnsureMatchingColumns.html index aacaf2ad7..1ec6407ce 100644 --- a/Avram/SchemaEnforcer/EnsureMatchingColumns.html +++ b/Avram/SchemaEnforcer/EnsureMatchingColumns.html @@ -1719,7 +1719,7 @@

- + avram/schema_enforcer/ensure_matching_columns.cr @@ -1859,7 +1859,7 @@


- [View source] + [View source]
@@ -1875,7 +1875,7 @@


- [View source] + [View source]
@@ -1905,7 +1905,7 @@


- [View source] + [View source]
diff --git a/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault.html b/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault.html index 005981697..e6dce079a 100644 --- a/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault.html +++ b/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault.html @@ -1719,7 +1719,7 @@

- + avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr @@ -1861,7 +1861,7 @@


- [View source] + [View source]
@@ -1877,7 +1877,7 @@


- [View source] + [View source]
@@ -1893,7 +1893,7 @@


- [View source] + [View source]
@@ -1909,7 +1909,7 @@


- [View source] + [View source]
@@ -1925,7 +1925,7 @@


- [View source] + [View source]
diff --git a/Avram/SchemaEnforcer/Validation.html b/Avram/SchemaEnforcer/Validation.html index b41a44860..d5980be81 100644 --- a/Avram/SchemaEnforcer/Validation.html +++ b/Avram/SchemaEnforcer/Validation.html @@ -1737,7 +1737,7 @@

- + avram/schema_enforcer/validation.cr @@ -1844,7 +1844,7 @@


- [View source] + [View source]
@@ -1874,7 +1874,7 @@


- [View source] + [View source]
diff --git a/Avram/SchemaMismatchError.html b/Avram/SchemaMismatchError.html index 7cce161de..0379c92e6 100644 --- a/Avram/SchemaMismatchError.html +++ b/Avram/SchemaMismatchError.html @@ -1730,7 +1730,7 @@

- + avram/errors.cr diff --git a/Avram/Slugify.html b/Avram/Slugify.html index 1ba9ef3c2..1084afe76 100644 --- a/Avram/Slugify.html +++ b/Avram/Slugify.html @@ -1776,7 +1776,7 @@

- + avram/slugify.cr @@ -1856,7 +1856,7 @@


- [View source] + [View source]
@@ -1872,7 +1872,7 @@


- [View source] + [View source]
@@ -1888,7 +1888,7 @@


- [View source] + [View source]
@@ -1904,7 +1904,7 @@


- [View source] + [View source]
diff --git a/Avram/SoftDelete.html b/Avram/SoftDelete.html index 9fb0e7368..4fc82ba12 100644 --- a/Avram/SoftDelete.html +++ b/Avram/SoftDelete.html @@ -1717,7 +1717,7 @@

- + avram/soft_delete/model.cr diff --git a/Avram/SoftDelete/Model.html b/Avram/SoftDelete/Model.html index 830e77cd7..60b1843a9 100644 --- a/Avram/SoftDelete/Model.html +++ b/Avram/SoftDelete/Model.html @@ -1738,7 +1738,7 @@

- + avram/soft_delete/model.cr @@ -1835,7 +1835,7 @@


- [View source] + [View source]
@@ -1851,7 +1851,7 @@


- [View source] + [View source]
@@ -1873,7 +1873,7 @@


- [View source] + [View source]
@@ -1896,7 +1896,7 @@


- [View source] + [View source]
@@ -1912,7 +1912,7 @@


- [View source] + [View source]
diff --git a/Avram/SoftDelete/Query.html b/Avram/SoftDelete/Query.html index 792aac73f..ad37ed3fc 100644 --- a/Avram/SoftDelete/Query.html +++ b/Avram/SoftDelete/Query.html @@ -1733,7 +1733,7 @@

- + avram/soft_delete/query.cr @@ -1840,7 +1840,7 @@


- [View source] + [View source]
@@ -1863,7 +1863,7 @@


- [View source] + [View source]
@@ -1891,7 +1891,7 @@


- [View source] + [View source]
@@ -1919,7 +1919,7 @@


- [View source] + [View source]
@@ -1935,7 +1935,7 @@


- [View source] + [View source]
@@ -1959,7 +1959,7 @@


- [View source] + [View source]
diff --git a/Avram/SpecHelper.html b/Avram/SpecHelper.html index 18fac14d4..b5fb41c3c 100644 --- a/Avram/SpecHelper.html +++ b/Avram/SpecHelper.html @@ -1717,7 +1717,7 @@

- + avram/spec_helper.cr @@ -1826,7 +1826,7 @@


- [View source] + [View source]
@@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/TableFor.html b/Avram/TableFor.html index 11da52d79..9d9e95045 100644 --- a/Avram/TableFor.html +++ b/Avram/TableFor.html @@ -1731,7 +1731,7 @@

- + avram/table_for.cr @@ -1807,7 +1807,7 @@


- [View source] + [View source]
diff --git a/Avram/TableName.html b/Avram/TableName.html index 6eb128a33..38da06987 100644 --- a/Avram/TableName.html +++ b/Avram/TableName.html @@ -1727,7 +1727,7 @@

- + avram.cr diff --git a/Avram/Type.html b/Avram/Type.html index a4278f547..9d40c9c7f 100644 --- a/Avram/Type.html +++ b/Avram/Type.html @@ -1755,7 +1755,7 @@

- + avram/type.cr @@ -1845,7 +1845,7 @@


- [View source] + [View source]
@@ -1861,7 +1861,7 @@


- [View source] + [View source]
@@ -1877,7 +1877,7 @@


- [View source] + [View source]
@@ -1893,7 +1893,7 @@


- [View source] + [View source]
@@ -1909,7 +1909,7 @@


- [View source] + [View source]
@@ -1925,7 +1925,7 @@


- [View source] + [View source]
diff --git a/Avram/Type/FailedCast.html b/Avram/Type/FailedCast.html index 7e19518f0..9e81687bd 100644 --- a/Avram/Type/FailedCast.html +++ b/Avram/Type/FailedCast.html @@ -1719,7 +1719,7 @@

- + avram/type.cr @@ -1813,7 +1813,7 @@


- [View source] + [View source]
diff --git a/Avram/Type/SuccessfulCast.html b/Avram/Type/SuccessfulCast.html index 9b8ccaf16..f72b0d533 100644 --- a/Avram/Type/SuccessfulCast.html +++ b/Avram/Type/SuccessfulCast.html @@ -1719,7 +1719,7 @@

- + avram/type.cr @@ -1826,7 +1826,7 @@


- [View source] + [View source]
@@ -1856,7 +1856,7 @@


- [View source] + [View source]
diff --git a/Avram/UnsupportedQueryError.html b/Avram/UnsupportedQueryError.html index 3d77b8269..c228bcdcd 100644 --- a/Avram/UnsupportedQueryError.html +++ b/Avram/UnsupportedQueryError.html @@ -1730,7 +1730,7 @@

- + avram/errors.cr @@ -1840,7 +1840,7 @@


- [View source] + [View source]
diff --git a/Avram/Uploadable.html b/Avram/Uploadable.html index 6a6f9ad30..09b0a6b84 100644 --- a/Avram/Uploadable.html +++ b/Avram/Uploadable.html @@ -1731,7 +1731,7 @@

- + avram/uploadable.cr @@ -1830,7 +1830,7 @@


- [View source] + [View source]
@@ -1863,7 +1863,7 @@


- [View source] + [View source]
@@ -1884,7 +1884,7 @@


- [View source] + [View source]
@@ -1900,7 +1900,7 @@


- [View source] + [View source]
@@ -1916,7 +1916,7 @@


- [View source] + [View source]
diff --git a/Avram/Uploadable/Lucky.html b/Avram/Uploadable/Lucky.html index 9928b557a..eb9b1cd69 100644 --- a/Avram/Uploadable/Lucky.html +++ b/Avram/Uploadable/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/uploadable.cr @@ -1864,7 +1864,7 @@


- [View source] + [View source]
@@ -1880,7 +1880,7 @@


- [View source] + [View source]
@@ -1896,7 +1896,7 @@


- [View source] + [View source]
@@ -1912,7 +1912,7 @@


- [View source] + [View source]
diff --git a/Avram/Upsert.html b/Avram/Upsert.html index c68a52427..202bdaefe 100644 --- a/Avram/Upsert.html +++ b/Avram/Upsert.html @@ -1743,7 +1743,7 @@

- + avram/upsert.cr @@ -1867,7 +1867,7 @@

View source] + [View source] diff --git a/Avram/Validations.html b/Avram/Validations.html index 6019d37b0..eaf00ce95 100644 --- a/Avram/Validations.html +++ b/Avram/Validations.html @@ -1762,7 +1762,7 @@

- + avram/validations.cr @@ -1925,7 +1925,7 @@


- [View source] + [View source]
@@ -1948,7 +1948,7 @@


- [View source] + [View source]
@@ -1974,7 +1974,7 @@


- [View source] + [View source]
@@ -2000,7 +2000,7 @@


- [View source] + [View source]
@@ -2024,7 +2024,7 @@


- [View source] + [View source]
@@ -2047,7 +2047,7 @@


- [View source] + [View source]
@@ -2068,7 +2068,7 @@


- [View source] + [View source]
@@ -2092,7 +2092,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
@@ -2142,7 +2142,7 @@


- [View source] + [View source]
@@ -2165,7 +2165,7 @@


- [View source] + [View source]
@@ -2203,7 +2203,7 @@


- [View source] + [View source]
diff --git a/Avram/Where.html b/Avram/Where.html index 0a8befc2f..0696b1c9f 100644 --- a/Avram/Where.html +++ b/Avram/Where.html @@ -1717,7 +1717,7 @@

- + avram/where.cr diff --git a/Avram/Where/Condition.html b/Avram/Where/Condition.html index 1b7df9cd8..3e6a70682 100644 --- a/Avram/Where/Condition.html +++ b/Avram/Where/Condition.html @@ -1739,7 +1739,7 @@

- + avram/where.cr @@ -1848,7 +1848,7 @@


- [View source] + [View source]
@@ -1864,7 +1864,7 @@


- [View source] + [View source]
@@ -1880,7 +1880,7 @@


- [View source] + [View source]
@@ -1896,7 +1896,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/Conjunction.html b/Avram/Where/Conjunction.html index 98c44a4f5..217375906 100644 --- a/Avram/Where/Conjunction.html +++ b/Avram/Where/Conjunction.html @@ -1717,7 +1717,7 @@

- + avram/where.cr @@ -1886,7 +1886,7 @@


- [View source] + [View source]
@@ -1902,7 +1902,7 @@


- [View source] + [View source]
@@ -1918,7 +1918,7 @@


- [View source] + [View source]
@@ -1953,7 +1953,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/Equal.html b/Avram/Where/Equal.html index ed32e4ce6..9cbc62059 100644 --- a/Avram/Where/Equal.html +++ b/Avram/Where/Equal.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/Excludes.html b/Avram/Where/Excludes.html index 170e99a00..6b0a632ad 100644 --- a/Avram/Where/Excludes.html +++ b/Avram/Where/Excludes.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1944,7 +1944,7 @@


- [View source] + [View source]
@@ -1960,7 +1960,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/GreaterThan.html b/Avram/Where/GreaterThan.html index f7f13b529..163d05d8d 100644 --- a/Avram/Where/GreaterThan.html +++ b/Avram/Where/GreaterThan.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/GreaterThanOrEqualTo.html b/Avram/Where/GreaterThanOrEqualTo.html index 59f0571b7..49754f738 100644 --- a/Avram/Where/GreaterThanOrEqualTo.html +++ b/Avram/Where/GreaterThanOrEqualTo.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/Ilike.html b/Avram/Where/Ilike.html index 457d5f90d..fe203b1e0 100644 --- a/Avram/Where/Ilike.html +++ b/Avram/Where/Ilike.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/In.html b/Avram/Where/In.html index 9f9a831ff..c665ad50b 100644 --- a/Avram/Where/In.html +++ b/Avram/Where/In.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1944,7 +1944,7 @@


- [View source] + [View source]
@@ -1960,7 +1960,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/Includes.html b/Avram/Where/Includes.html index a76364687..42e8323a4 100644 --- a/Avram/Where/Includes.html +++ b/Avram/Where/Includes.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1944,7 +1944,7 @@


- [View source] + [View source]
@@ -1960,7 +1960,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/LessThan.html b/Avram/Where/LessThan.html index 73339fcda..793345a83 100644 --- a/Avram/Where/LessThan.html +++ b/Avram/Where/LessThan.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/LessThanOrEqualTo.html b/Avram/Where/LessThanOrEqualTo.html index 8e65e3cc9..e8e4a9833 100644 --- a/Avram/Where/LessThanOrEqualTo.html +++ b/Avram/Where/LessThanOrEqualTo.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/Like.html b/Avram/Where/Like.html index 4b181a450..b95b5f8ca 100644 --- a/Avram/Where/Like.html +++ b/Avram/Where/Like.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/NotEqual.html b/Avram/Where/NotEqual.html index 018b94d8f..652459656 100644 --- a/Avram/Where/NotEqual.html +++ b/Avram/Where/NotEqual.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/NotIlike.html b/Avram/Where/NotIlike.html index 3e8d61a20..24514680b 100644 --- a/Avram/Where/NotIlike.html +++ b/Avram/Where/NotIlike.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/NotIn.html b/Avram/Where/NotIn.html index ffdb26cf2..52c2c26b0 100644 --- a/Avram/Where/NotIn.html +++ b/Avram/Where/NotIn.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1944,7 +1944,7 @@


- [View source] + [View source]
@@ -1960,7 +1960,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/NotLike.html b/Avram/Where/NotLike.html index 8573c5dfb..ed8eb52c7 100644 --- a/Avram/Where/NotLike.html +++ b/Avram/Where/NotLike.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/NotNull.html b/Avram/Where/NotNull.html index ae21743cc..12a624043 100644 --- a/Avram/Where/NotNull.html +++ b/Avram/Where/NotNull.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1914,7 +1914,7 @@


- [View source] + [View source]
@@ -1930,7 +1930,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/Null.html b/Avram/Where/Null.html index 7319fcd7d..6bde31242 100644 --- a/Avram/Where/Null.html +++ b/Avram/Where/Null.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1914,7 +1914,7 @@


- [View source] + [View source]
@@ -1930,7 +1930,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/NullSqlClause.html b/Avram/Where/NullSqlClause.html index a0bb093dd..c9c66cea0 100644 --- a/Avram/Where/NullSqlClause.html +++ b/Avram/Where/NullSqlClause.html @@ -1735,7 +1735,7 @@

- + avram/where.cr @@ -1906,7 +1906,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/PrecedenceEnd.html b/Avram/Where/PrecedenceEnd.html index 80ae2a5fd..61e197eb9 100644 --- a/Avram/Where/PrecedenceEnd.html +++ b/Avram/Where/PrecedenceEnd.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1847,7 +1847,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/PrecedenceStart.html b/Avram/Where/PrecedenceStart.html index 3e20e6821..d85a61414 100644 --- a/Avram/Where/PrecedenceStart.html +++ b/Avram/Where/PrecedenceStart.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1860,7 +1860,7 @@


- [View source] + [View source]
@@ -1890,7 +1890,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/Raw.html b/Avram/Where/Raw.html index 54a805070..c8da5f672 100644 --- a/Avram/Where/Raw.html +++ b/Avram/Where/Raw.html @@ -1719,7 +1719,7 @@

- + avram/where.cr @@ -1865,7 +1865,7 @@


- [View source] + [View source]
@@ -1881,7 +1881,7 @@


- [View source] + [View source]
@@ -1911,7 +1911,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/SqlClause.html b/Avram/Where/SqlClause.html index 005bcf6e7..2e3bd2e10 100644 --- a/Avram/Where/SqlClause.html +++ b/Avram/Where/SqlClause.html @@ -1735,7 +1735,7 @@

- + avram/where.cr @@ -1891,7 +1891,7 @@


- [View source] + [View source]
@@ -1921,7 +1921,7 @@


- [View source] + [View source]
@@ -1937,7 +1937,7 @@


- [View source] + [View source]
@@ -1953,7 +1953,7 @@


- [View source] + [View source]
@@ -1969,7 +1969,7 @@


- [View source] + [View source]
diff --git a/Avram/Where/ValueHoldingSqlClause.html b/Avram/Where/ValueHoldingSqlClause.html index 82f8ae09f..d9fdc4f50 100644 --- a/Avram/Where/ValueHoldingSqlClause.html +++ b/Avram/Where/ValueHoldingSqlClause.html @@ -1759,7 +1759,7 @@

- + avram/where.cr @@ -1943,7 +1943,7 @@


- [View source] + [View source]
@@ -1973,7 +1973,7 @@


- [View source] + [View source]
diff --git a/BaseTask.html b/BaseTask.html index f3cd58948..e0a1d3ac8 100644 --- a/BaseTask.html +++ b/BaseTask.html @@ -1759,7 +1759,7 @@

- + avram/tasks/db/base_task.cr @@ -1950,7 +1950,7 @@


- [View source] + [View source]
@@ -1972,7 +1972,7 @@


- [View source] + [View source]
@@ -1994,7 +1994,7 @@


- [View source] + [View source]
@@ -2022,7 +2022,7 @@


- [View source] + [View source]
@@ -2094,7 +2094,7 @@


- [View source] + [View source]
@@ -2110,7 +2110,7 @@


- [View source] + [View source]
diff --git a/Bool.html b/Bool.html index 580c48e5f..7ca217a78 100644 --- a/Bool.html +++ b/Bool.html @@ -1747,28 +1747,28 @@

- + lib/lucky/src/charms/bool_extensions.cr
- + avram/blank_extensions.cr
- + avram/charms/bool_extensions.cr
- + avram/object_extensions.cr @@ -1892,7 +1892,7 @@


- [View source] + [View source]
@@ -1920,7 +1920,7 @@


- [View source] + [View source]
@@ -1936,7 +1936,7 @@


- [View source] + [View source]
diff --git a/Bool/Lucky.html b/Bool/Lucky.html index 23f70bc89..d53eac796 100644 --- a/Bool/Lucky.html +++ b/Bool/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/bool_extensions.cr @@ -1884,7 +1884,7 @@


- [View source] + [View source]
@@ -1912,7 +1912,7 @@


- [View source] + [View source]
@@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1944,7 +1944,7 @@


- [View source] + [View source]
@@ -1960,7 +1960,7 @@


- [View source] + [View source]
@@ -1976,7 +1976,7 @@


- [View source] + [View source]
diff --git a/Bool/Lucky/ColumnType.html b/Bool/Lucky/ColumnType.html index 1835e59b2..cf3b5c1a7 100644 --- a/Bool/Lucky/ColumnType.html +++ b/Bool/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/bool_extensions.cr diff --git a/Bool/Lucky/Criteria.html b/Bool/Lucky/Criteria.html index 8f63d397d..253600e22 100644 --- a/Bool/Lucky/Criteria.html +++ b/Bool/Lucky/Criteria.html @@ -1719,7 +1719,7 @@

- + avram/charms/bool_extensions.cr @@ -1942,7 +1942,7 @@


- [View source] + [View source]
diff --git a/Char.html b/Char.html index 19a34fd91..83faeefe5 100644 --- a/Char.html +++ b/Char.html @@ -1767,14 +1767,14 @@

- + lib/lucky/src/charms/object.cr
- + avram/object_extensions.cr @@ -1888,7 +1888,7 @@


- [View source] + [View source]
diff --git a/DB.html b/DB.html index 96ae7b041..5cefa9424 100644 --- a/DB.html +++ b/DB.html @@ -1788,168 +1788,168 @@

- + lib/db/src/db.cr
- + lib/db/src/db/begin_transaction.cr
- + lib/db/src/db/connection.cr
- + lib/db/src/db/connection_builder.cr
- + lib/db/src/db/connection_context.cr
- + lib/db/src/db/database.cr
- + lib/db/src/db/disposable.cr
- + lib/db/src/db/driver.cr
- + lib/db/src/db/enumerable_concat.cr
- + lib/db/src/db/error.cr
- + lib/db/src/db/mapping.cr
- + lib/db/src/db/pool.cr
- + lib/db/src/db/pool_prepared_statement.cr
- + lib/db/src/db/pool_statement.cr
- + lib/db/src/db/pool_unprepared_statement.cr
- + lib/db/src/db/query_methods.cr
- + lib/db/src/db/result_set.cr
- + lib/db/src/db/serializable.cr
- + lib/db/src/db/session_methods.cr
- + lib/db/src/db/statement.cr
- + lib/db/src/db/string_key_cache.cr
- + lib/db/src/db/transaction.cr
- + ext/db/connection.cr
- + ext/db/transaction.cr diff --git a/DB/Connection.html b/DB/Connection.html index 293bbc218..f9f8591ee 100644 --- a/DB/Connection.html +++ b/DB/Connection.html @@ -1762,21 +1762,21 @@

- + lib/db/src/db/connection.cr
- + lib/db/src/db/error.cr
- + ext/db/connection.cr diff --git a/DB/SavePointTransaction.html b/DB/SavePointTransaction.html index 1d7497eda..09b067934 100644 --- a/DB/SavePointTransaction.html +++ b/DB/SavePointTransaction.html @@ -1719,14 +1719,14 @@

- + lib/db/src/db/transaction.cr
- + ext/db/transaction.cr @@ -1846,7 +1846,7 @@


- [View source] + [View source]
diff --git a/DB/TopLevelTransaction.html b/DB/TopLevelTransaction.html index de730f69e..2d3b1b1cc 100644 --- a/DB/TopLevelTransaction.html +++ b/DB/TopLevelTransaction.html @@ -1719,14 +1719,14 @@

- + lib/db/src/db/transaction.cr
- + ext/db/transaction.cr @@ -1846,7 +1846,7 @@


- [View source] + [View source]
diff --git a/DB/Transaction.html b/DB/Transaction.html index bce6e265b..a1cb1e1d0 100644 --- a/DB/Transaction.html +++ b/DB/Transaction.html @@ -1769,14 +1769,14 @@

- + lib/db/src/db/transaction.cr
- + ext/db/transaction.cr diff --git a/Db.html b/Db.html index 29e470cea..44dc4a6b9 100644 --- a/Db.html +++ b/Db.html @@ -1717,7 +1717,7 @@

- + avram/tasks/db/console.cr diff --git a/Db/Console.html b/Db/Console.html index 47aa2e6c6..140fcb9cf 100644 --- a/Db/Console.html +++ b/Db/Console.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/console.cr @@ -1905,7 +1905,7 @@


- [View source] + [View source]
@@ -1927,7 +1927,7 @@


- [View source] + [View source]
@@ -1949,7 +1949,7 @@


- [View source] + [View source]
@@ -1977,7 +1977,7 @@


- [View source] + [View source]
@@ -2049,7 +2049,7 @@


- [View source] + [View source]
diff --git a/Db/Create.html b/Db/Create.html index 875081ac9..7a1f22cbc 100644 --- a/Db/Create.html +++ b/Db/Create.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/create.cr @@ -1981,7 +1981,7 @@


- [View source] + [View source]
@@ -2016,7 +2016,7 @@


- [View source] + [View source]
@@ -2038,7 +2038,7 @@


- [View source] + [View source]
@@ -2060,7 +2060,7 @@


- [View source] + [View source]
@@ -2144,7 +2144,7 @@


- [View source] + [View source]
@@ -2160,7 +2160,7 @@


- [View source] + [View source]
diff --git a/Db/Create/Migrator.html b/Db/Create/Migrator.html index 7bb4336dc..83c044c64 100644 --- a/Db/Create/Migrator.html +++ b/Db/Create/Migrator.html @@ -1727,7 +1727,7 @@

- + avram/tasks/db/create.cr diff --git a/Db/Drop.html b/Db/Drop.html index 447f5fdbc..1d6b74a7e 100644 --- a/Db/Drop.html +++ b/Db/Drop.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/drop.cr @@ -1981,7 +1981,7 @@


- [View source] + [View source]
@@ -2016,7 +2016,7 @@


- [View source] + [View source]
@@ -2038,7 +2038,7 @@


- [View source] + [View source]
@@ -2060,7 +2060,7 @@


- [View source] + [View source]
@@ -2144,7 +2144,7 @@


- [View source] + [View source]
@@ -2160,7 +2160,7 @@


- [View source] + [View source]
diff --git a/Db/Migrate.html b/Db/Migrate.html index 689165e53..c183ff6e9 100644 --- a/Db/Migrate.html +++ b/Db/Migrate.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/migrate.cr @@ -1981,7 +1981,7 @@


- [View source] + [View source]
@@ -2016,7 +2016,7 @@


- [View source] + [View source]
@@ -2038,7 +2038,7 @@


- [View source] + [View source]
@@ -2060,7 +2060,7 @@


- [View source] + [View source]
@@ -2144,7 +2144,7 @@


- [View source] + [View source]
@@ -2160,7 +2160,7 @@


- [View source] + [View source]
diff --git a/Db/Migrate/One.html b/Db/Migrate/One.html index 4f327f806..10e155b69 100644 --- a/Db/Migrate/One.html +++ b/Db/Migrate/One.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/migrate_one.cr @@ -1973,7 +1973,7 @@


- [View source] + [View source]
@@ -1995,7 +1995,7 @@


- [View source] + [View source]
@@ -2017,7 +2017,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
diff --git a/Db/Migrations.html b/Db/Migrations.html index fb4d51a29..8f641cb64 100644 --- a/Db/Migrations.html +++ b/Db/Migrations.html @@ -1717,7 +1717,7 @@

- + avram/tasks/db/migrations_status.cr diff --git a/Db/Migrations/Status.html b/Db/Migrations/Status.html index 9d8ef24f6..af6715721 100644 --- a/Db/Migrations/Status.html +++ b/Db/Migrations/Status.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/migrations_status.cr @@ -1973,7 +1973,7 @@


- [View source] + [View source]
@@ -1995,7 +1995,7 @@


- [View source] + [View source]
@@ -2017,7 +2017,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
diff --git a/Db/Redo.html b/Db/Redo.html index 3a9c8ff69..e43696deb 100644 --- a/Db/Redo.html +++ b/Db/Redo.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/redo.cr @@ -1973,7 +1973,7 @@


- [View source] + [View source]
@@ -1995,7 +1995,7 @@


- [View source] + [View source]
@@ -2017,7 +2017,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
diff --git a/Db/Reset.html b/Db/Reset.html index f1eaa277e..e0e8f2169 100644 --- a/Db/Reset.html +++ b/Db/Reset.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/reset.cr @@ -1981,7 +1981,7 @@


- [View source] + [View source]
@@ -2016,7 +2016,7 @@


- [View source] + [View source]
@@ -2038,7 +2038,7 @@


- [View source] + [View source]
@@ -2060,7 +2060,7 @@


- [View source] + [View source]
@@ -2144,7 +2144,7 @@


- [View source] + [View source]
@@ -2160,7 +2160,7 @@


- [View source] + [View source]
diff --git a/Db/Rollback.html b/Db/Rollback.html index 99fd18d0f..065287186 100644 --- a/Db/Rollback.html +++ b/Db/Rollback.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/rollback.cr @@ -1973,7 +1973,7 @@


- [View source] + [View source]
@@ -1995,7 +1995,7 @@


- [View source] + [View source]
@@ -2017,7 +2017,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
diff --git a/Db/RollbackAll.html b/Db/RollbackAll.html index 5932becb4..323ae1c81 100644 --- a/Db/RollbackAll.html +++ b/Db/RollbackAll.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/rollback_all.cr @@ -1973,7 +1973,7 @@


- [View source] + [View source]
@@ -1995,7 +1995,7 @@


- [View source] + [View source]
@@ -2017,7 +2017,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
diff --git a/Db/RollbackTo.html b/Db/RollbackTo.html index fe8d4e4ed..00a397d49 100644 --- a/Db/RollbackTo.html +++ b/Db/RollbackTo.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/rollback_to.cr @@ -1973,7 +1973,7 @@


- [View source] + [View source]
@@ -1995,7 +1995,7 @@


- [View source] + [View source]
@@ -2017,7 +2017,7 @@


- [View source] + [View source]
@@ -2101,7 +2101,7 @@


- [View source] + [View source]
@@ -2117,7 +2117,7 @@


- [View source] + [View source]
diff --git a/Db/Schema.html b/Db/Schema.html index 447fb5a88..102ec427f 100644 --- a/Db/Schema.html +++ b/Db/Schema.html @@ -1717,7 +1717,7 @@

- + avram/tasks/db/schema_dump.cr diff --git a/Db/Schema/Dump.html b/Db/Schema/Dump.html index d917245d0..2e4f84416 100644 --- a/Db/Schema/Dump.html +++ b/Db/Schema/Dump.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/schema_dump.cr @@ -1991,7 +1991,7 @@


- [View source] + [View source]
@@ -2026,7 +2026,7 @@


- [View source] + [View source]
@@ -2048,7 +2048,7 @@


- [View source] + [View source]
@@ -2070,7 +2070,7 @@


- [View source] + [View source]
@@ -2098,7 +2098,7 @@


- [View source] + [View source]
@@ -2170,7 +2170,7 @@


- [View source] + [View source]
@@ -2186,7 +2186,7 @@


- [View source] + [View source]
@@ -2202,7 +2202,7 @@


- [View source] + [View source]
diff --git a/Db/Schema/Restore.html b/Db/Schema/Restore.html index 07cff6496..f29bcaafb 100644 --- a/Db/Schema/Restore.html +++ b/Db/Schema/Restore.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/schema_restore.cr @@ -1981,7 +1981,7 @@


- [View source] + [View source]
@@ -2016,7 +2016,7 @@


- [View source] + [View source]
@@ -2038,7 +2038,7 @@


- [View source] + [View source]
@@ -2060,7 +2060,7 @@


- [View source] + [View source]
@@ -2144,7 +2144,7 @@


- [View source] + [View source]
@@ -2160,7 +2160,7 @@


- [View source] + [View source]
diff --git a/Db/Setup.html b/Db/Setup.html index 794094f45..f734c0072 100644 --- a/Db/Setup.html +++ b/Db/Setup.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/setup.cr @@ -1981,7 +1981,7 @@


- [View source] + [View source]
@@ -2016,7 +2016,7 @@


- [View source] + [View source]
@@ -2038,7 +2038,7 @@


- [View source] + [View source]
@@ -2060,7 +2060,7 @@


- [View source] + [View source]
@@ -2144,7 +2144,7 @@


- [View source] + [View source]
@@ -2160,7 +2160,7 @@


- [View source] + [View source]
diff --git a/Db/VerifyConnection.html b/Db/VerifyConnection.html index 38fefc4d2..2ed99f9cc 100644 --- a/Db/VerifyConnection.html +++ b/Db/VerifyConnection.html @@ -1719,7 +1719,7 @@

- + avram/tasks/db/verify_connection.cr @@ -1986,7 +1986,7 @@


- [View source] + [View source]
@@ -2021,7 +2021,7 @@


- [View source] + [View source]
@@ -2043,7 +2043,7 @@


- [View source] + [View source]
@@ -2065,7 +2065,7 @@


- [View source] + [View source]
@@ -2149,7 +2149,7 @@


- [View source] + [View source]
@@ -2165,7 +2165,7 @@


- [View source] + [View source]
@@ -2181,7 +2181,7 @@


- [View source] + [View source]
diff --git a/Enum.html b/Enum.html index 152a817fc..98527979c 100644 --- a/Enum.html +++ b/Enum.html @@ -1819,14 +1819,14 @@

- + lib/db/src/db/result_set.cr
- + avram/charms/enum_extensions.cr @@ -1928,7 +1928,7 @@


- [View source] + [View source]
diff --git a/Enum/Lucky.html b/Enum/Lucky.html index 1835bd1b4..1558d40c6 100644 --- a/Enum/Lucky.html +++ b/Enum/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/enum_extensions.cr @@ -1869,7 +1869,7 @@


- [View source] + [View source]
@@ -1885,7 +1885,7 @@


- [View source] + [View source]
@@ -1901,7 +1901,7 @@


- [View source] + [View source]
@@ -1917,7 +1917,7 @@


- [View source] + [View source]
@@ -1933,7 +1933,7 @@


- [View source] + [View source]
diff --git a/Enum/Lucky/ColumnType.html b/Enum/Lucky/ColumnType.html index 3223fcd9c..70fc5065c 100644 --- a/Enum/Lucky/ColumnType.html +++ b/Enum/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/enum_extensions.cr diff --git a/Enum/Lucky/Criteria.html b/Enum/Lucky/Criteria.html index 91e90e473..ef46c4a30 100644 --- a/Enum/Lucky/Criteria.html +++ b/Enum/Lucky/Criteria.html @@ -1719,7 +1719,7 @@

- + avram/charms/enum_extensions.cr @@ -2027,7 +2027,7 @@


- [View source] + [View source]
@@ -2057,7 +2057,7 @@


- [View source] + [View source]
@@ -2073,7 +2073,7 @@


- [View source] + [View source]
diff --git a/Fiber.html b/Fiber.html index b4d2b9781..e09a4eaf7 100644 --- a/Fiber.html +++ b/Fiber.html @@ -1730,7 +1730,7 @@

- + avram/charms/fiber.cr @@ -1839,7 +1839,7 @@


- [View source] + [View source]
@@ -1861,7 +1861,7 @@


- [View source] + [View source]
diff --git a/Float64.html b/Float64.html index 76aced07c..1ec88d60e 100644 --- a/Float64.html +++ b/Float64.html @@ -1719,14 +1719,14 @@

- + avram/blank_extensions.cr
- + avram/charms/float64_extensions.cr @@ -1875,7 +1875,7 @@


- [View source] + [View source]
@@ -1903,7 +1903,7 @@


- [View source] + [View source]
diff --git a/Float64/Lucky.html b/Float64/Lucky.html index 9949c8fb7..25dcbd4a0 100644 --- a/Float64/Lucky.html +++ b/Float64/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/float64_extensions.cr @@ -1914,7 +1914,7 @@


- [View source] + [View source]
@@ -1942,7 +1942,7 @@


- [View source] + [View source]
@@ -1958,7 +1958,7 @@


- [View source] + [View source]
@@ -1974,7 +1974,7 @@


- [View source] + [View source]
@@ -1990,7 +1990,7 @@


- [View source] + [View source]
@@ -2006,7 +2006,7 @@


- [View source] + [View source]
@@ -2022,7 +2022,7 @@


- [View source] + [View source]
@@ -2038,7 +2038,7 @@


- [View source] + [View source]
@@ -2054,7 +2054,7 @@


- [View source] + [View source]
@@ -2070,7 +2070,7 @@


- [View source] + [View source]
@@ -2086,7 +2086,7 @@


- [View source] + [View source]
@@ -2102,7 +2102,7 @@


- [View source] + [View source]
diff --git a/Float64/Lucky/ColumnType.html b/Float64/Lucky/ColumnType.html index f55e66888..6d85c7172 100644 --- a/Float64/Lucky/ColumnType.html +++ b/Float64/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/float64_extensions.cr diff --git a/Float64/Lucky/Criteria.html b/Float64/Lucky/Criteria.html index 6ab5ea4fc..163ca3465 100644 --- a/Float64/Lucky/Criteria.html +++ b/Float64/Lucky/Criteria.html @@ -1733,7 +1733,7 @@

- + avram/charms/float64_extensions.cr @@ -1995,7 +1995,7 @@


- [View source] + [View source]
@@ -2030,7 +2030,7 @@


- [View source] + [View source]
@@ -2046,7 +2046,7 @@


- [View source] + [View source]
@@ -2062,7 +2062,7 @@


- [View source] + [View source]
diff --git a/Gen.html b/Gen.html index 62a6c022f..e0d659dc9 100644 --- a/Gen.html +++ b/Gen.html @@ -1717,7 +1717,7 @@

- + avram/tasks/gen/migration.cr diff --git a/Gen/Migration.html b/Gen/Migration.html index 64d977dd3..dc2a14ae6 100644 --- a/Gen/Migration.html +++ b/Gen/Migration.html @@ -1735,7 +1735,7 @@

- + avram/tasks/gen/migration.cr @@ -1959,7 +1959,7 @@


- [View source] + [View source]
@@ -1975,7 +1975,7 @@


- [View source] + [View source]
@@ -1991,7 +1991,7 @@


- [View source] + [View source]
@@ -2014,7 +2014,7 @@


- [View source] + [View source]
@@ -2036,7 +2036,7 @@


- [View source] + [View source]
@@ -2058,7 +2058,7 @@


- [View source] + [View source]
@@ -2086,7 +2086,7 @@


- [View source] + [View source]
@@ -2158,7 +2158,7 @@


- [View source] + [View source]
@@ -2174,7 +2174,7 @@


- [View source] + [View source]
diff --git a/Gen/Migration/HabitatSettings.html b/Gen/Migration/HabitatSettings.html index f5749e3e5..007a9fd9d 100644 --- a/Gen/Migration/HabitatSettings.html +++ b/Gen/Migration/HabitatSettings.html @@ -1719,7 +1719,7 @@

- + avram/tasks/gen/migration.cr diff --git a/Gen/Mixins.html b/Gen/Mixins.html index 0467b3f90..6eb441f7b 100644 --- a/Gen/Mixins.html +++ b/Gen/Mixins.html @@ -1717,7 +1717,7 @@

- + lucky/tasks/gen/mixins/migration_with_columns.cr diff --git a/Gen/Mixins/MigrationWithColumns.html b/Gen/Mixins/MigrationWithColumns.html index ddf0e87ed..e83b67f95 100644 --- a/Gen/Mixins/MigrationWithColumns.html +++ b/Gen/Mixins/MigrationWithColumns.html @@ -1733,7 +1733,7 @@

- + lucky/tasks/gen/mixins/migration_with_columns.cr @@ -1817,7 +1817,7 @@


- [View source] + [View source]
diff --git a/Gen/Model.html b/Gen/Model.html index 86460fbe9..95a3842cd 100644 --- a/Gen/Model.html +++ b/Gen/Model.html @@ -1733,7 +1733,7 @@

- + lucky/tasks/gen/model.cr @@ -1948,7 +1948,7 @@


- [View source] + [View source]
@@ -1970,7 +1970,7 @@


- [View source] + [View source]
@@ -1992,7 +1992,7 @@


- [View source] + [View source]
@@ -2020,7 +2020,7 @@


- [View source] + [View source]
@@ -2036,7 +2036,7 @@


- [View source] + [View source]
@@ -2052,7 +2052,7 @@


- [View source] + [View source]
@@ -2124,7 +2124,7 @@


- [View source] + [View source]
diff --git a/Gen/Resource.html b/Gen/Resource.html index dbf8ca944..43fd8ec84 100644 --- a/Gen/Resource.html +++ b/Gen/Resource.html @@ -1717,7 +1717,7 @@

- + lucky/tasks/gen/resource/browser.cr diff --git a/Gen/Resource/Browser.html b/Gen/Resource/Browser.html index a5fa02887..83840675d 100644 --- a/Gen/Resource/Browser.html +++ b/Gen/Resource/Browser.html @@ -1733,7 +1733,7 @@

- + lucky/tasks/gen/resource/browser.cr @@ -1948,7 +1948,7 @@


- [View source] + [View source]
@@ -1970,7 +1970,7 @@


- [View source] + [View source]
@@ -1992,7 +1992,7 @@


- [View source] + [View source]
@@ -2020,7 +2020,7 @@


- [View source] + [View source]
@@ -2036,7 +2036,7 @@


- [View source] + [View source]
@@ -2052,7 +2052,7 @@


- [View source] + [View source]
@@ -2124,7 +2124,7 @@


- [View source] + [View source]
diff --git a/Gen/Resource/Browser/InvalidOption.html b/Gen/Resource/Browser/InvalidOption.html index 4767da14f..9800b9e62 100644 --- a/Gen/Resource/Browser/InvalidOption.html +++ b/Gen/Resource/Browser/InvalidOption.html @@ -1719,7 +1719,7 @@

- + lucky/tasks/gen/resource/browser.cr @@ -1819,7 +1819,7 @@


- [View source] + [View source]
diff --git a/Int16.html b/Int16.html index 04518b399..5b1130eb8 100644 --- a/Int16.html +++ b/Int16.html @@ -1733,21 +1733,21 @@

- + lib/lucky/src/charms/int16_extensions.cr
- + avram/blank_extensions.cr
- + avram/charms/int16_extensions.cr @@ -1906,7 +1906,7 @@


- [View source] + [View source]
@@ -1934,7 +1934,7 @@


- [View source] + [View source]
diff --git a/Int16/Lucky.html b/Int16/Lucky.html index e52943d25..a7e9c9e70 100644 --- a/Int16/Lucky.html +++ b/Int16/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/int16_extensions.cr @@ -1894,7 +1894,7 @@


- [View source] + [View source]
@@ -1922,7 +1922,7 @@


- [View source] + [View source]
@@ -1938,7 +1938,7 @@


- [View source] + [View source]
@@ -1954,7 +1954,7 @@


- [View source] + [View source]
@@ -1970,7 +1970,7 @@


- [View source] + [View source]
@@ -1986,7 +1986,7 @@


- [View source] + [View source]
@@ -2002,7 +2002,7 @@


- [View source] + [View source]
@@ -2018,7 +2018,7 @@


- [View source] + [View source]
diff --git a/Int16/Lucky/ColumnType.html b/Int16/Lucky/ColumnType.html index 4f0fb632b..11acd1619 100644 --- a/Int16/Lucky/ColumnType.html +++ b/Int16/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/int16_extensions.cr diff --git a/Int16/Lucky/Criteria.html b/Int16/Lucky/Criteria.html index c2bdc656b..fba1742f1 100644 --- a/Int16/Lucky/Criteria.html +++ b/Int16/Lucky/Criteria.html @@ -1733,7 +1733,7 @@

- + avram/charms/int16_extensions.cr @@ -1995,7 +1995,7 @@


- [View source] + [View source]
@@ -2030,7 +2030,7 @@


- [View source] + [View source]
@@ -2046,7 +2046,7 @@


- [View source] + [View source]
@@ -2062,7 +2062,7 @@


- [View source] + [View source]
diff --git a/Int32.html b/Int32.html index e99c179d9..772ea9538 100644 --- a/Int32.html +++ b/Int32.html @@ -1733,21 +1733,21 @@

- + lib/lucky/src/charms/int32_extensions.cr
- + avram/blank_extensions.cr
- + avram/charms/int32_extensions.cr @@ -1906,7 +1906,7 @@


- [View source] + [View source]
@@ -1934,7 +1934,7 @@


- [View source] + [View source]
diff --git a/Int32/Lucky.html b/Int32/Lucky.html index 415016f7f..469466119 100644 --- a/Int32/Lucky.html +++ b/Int32/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/int32_extensions.cr @@ -1894,7 +1894,7 @@


- [View source] + [View source]
@@ -1922,7 +1922,7 @@


- [View source] + [View source]
@@ -1938,7 +1938,7 @@


- [View source] + [View source]
@@ -1954,7 +1954,7 @@


- [View source] + [View source]
@@ -1970,7 +1970,7 @@


- [View source] + [View source]
@@ -1986,7 +1986,7 @@


- [View source] + [View source]
@@ -2002,7 +2002,7 @@


- [View source] + [View source]
@@ -2018,7 +2018,7 @@


- [View source] + [View source]
diff --git a/Int32/Lucky/ColumnType.html b/Int32/Lucky/ColumnType.html index f95bca686..8e5280cb9 100644 --- a/Int32/Lucky/ColumnType.html +++ b/Int32/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/int32_extensions.cr diff --git a/Int32/Lucky/Criteria.html b/Int32/Lucky/Criteria.html index 4de5e7706..f9fd5bc6c 100644 --- a/Int32/Lucky/Criteria.html +++ b/Int32/Lucky/Criteria.html @@ -1749,7 +1749,7 @@

- + avram/charms/int32_extensions.cr @@ -2028,7 +2028,7 @@


- [View source] + [View source]
@@ -2063,7 +2063,7 @@


- [View source] + [View source]
@@ -2084,7 +2084,7 @@


- [View source] + [View source]
@@ -2100,7 +2100,7 @@


- [View source] + [View source]
@@ -2116,7 +2116,7 @@


- [View source] + [View source]
diff --git a/Int64.html b/Int64.html index 53534d099..1fc26db6b 100644 --- a/Int64.html +++ b/Int64.html @@ -1733,21 +1733,21 @@

- + lib/lucky/src/charms/int64_extensions.cr
- + avram/blank_extensions.cr
- + avram/charms/int64_extensions.cr @@ -1906,7 +1906,7 @@


- [View source] + [View source]
@@ -1934,7 +1934,7 @@


- [View source] + [View source]
diff --git a/Int64/Lucky.html b/Int64/Lucky.html index 89ceacaf5..1ceb4a06e 100644 --- a/Int64/Lucky.html +++ b/Int64/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/int64_extensions.cr @@ -1894,7 +1894,7 @@


- [View source] + [View source]
@@ -1922,7 +1922,7 @@


- [View source] + [View source]
@@ -1938,7 +1938,7 @@


- [View source] + [View source]
@@ -1954,7 +1954,7 @@


- [View source] + [View source]
@@ -1970,7 +1970,7 @@


- [View source] + [View source]
@@ -1986,7 +1986,7 @@


- [View source] + [View source]
@@ -2002,7 +2002,7 @@


- [View source] + [View source]
@@ -2018,7 +2018,7 @@


- [View source] + [View source]
diff --git a/Int64/Lucky/ColumnType.html b/Int64/Lucky/ColumnType.html index dc61d3caa..b67691f13 100644 --- a/Int64/Lucky/ColumnType.html +++ b/Int64/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/int64_extensions.cr diff --git a/Int64/Lucky/Criteria.html b/Int64/Lucky/Criteria.html index 605210099..9ac18264d 100644 --- a/Int64/Lucky/Criteria.html +++ b/Int64/Lucky/Criteria.html @@ -1735,7 +1735,7 @@

- + avram/charms/int64_extensions.cr @@ -2014,7 +2014,7 @@


- [View source] + [View source]
@@ -2049,7 +2049,7 @@


- [View source] + [View source]
@@ -2070,7 +2070,7 @@


- [View source] + [View source]
@@ -2086,7 +2086,7 @@


- [View source] + [View source]
@@ -2102,7 +2102,7 @@


- [View source] + [View source]
diff --git a/Nil.html b/Nil.html index a554e4380..291ac09bd 100644 --- a/Nil.html +++ b/Nil.html @@ -1759,21 +1759,21 @@

- + lib/lucky/src/charms/object.cr
- + avram/blank_extensions.cr
- + avram/object_extensions.cr @@ -1867,7 +1867,7 @@


- [View source] + [View source]
diff --git a/Object.html b/Object.html index b32b876f8..e744bac11 100644 --- a/Object.html +++ b/Object.html @@ -1746,14 +1746,14 @@

- + lib/lucky/src/charms/object.cr
- + avram/object_extensions.cr @@ -1848,7 +1848,7 @@


- [View source] + [View source]
diff --git a/Slice.html b/Slice.html index f04f9719e..0dccdce66 100644 --- a/Slice.html +++ b/Slice.html @@ -1752,14 +1752,14 @@

- + avram/blank_extensions.cr
- + avram/charms/slice_extensions.cr @@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1956,7 +1956,7 @@


- [View source] + [View source]
diff --git a/Slice/Lucky.html b/Slice/Lucky.html index eb9261b6d..7564fa468 100644 --- a/Slice/Lucky.html +++ b/Slice/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/slice_extensions.cr @@ -1884,7 +1884,7 @@


- [View source] + [View source]
@@ -1912,7 +1912,7 @@


- [View source] + [View source]
@@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1944,7 +1944,7 @@


- [View source] + [View source]
@@ -1960,7 +1960,7 @@


- [View source] + [View source]
@@ -1976,7 +1976,7 @@


- [View source] + [View source]
diff --git a/Slice/Lucky/ColumnType.html b/Slice/Lucky/ColumnType.html index d15134838..508c9e3f4 100644 --- a/Slice/Lucky/ColumnType.html +++ b/Slice/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/slice_extensions.cr diff --git a/Slice/Lucky/Criteria.html b/Slice/Lucky/Criteria.html index e338b274d..3dd37f89b 100644 --- a/Slice/Lucky/Criteria.html +++ b/Slice/Lucky/Criteria.html @@ -1719,7 +1719,7 @@

- + avram/charms/slice_extensions.cr @@ -1942,7 +1942,7 @@


- [View source] + [View source]
diff --git a/String.html b/String.html index b631234a6..7d742cf2f 100644 --- a/String.html +++ b/String.html @@ -1833,14 +1833,14 @@

- + lib/lucky/src/charms/string_extensions.cr
- + avram/charms/string_extensions.cr @@ -1942,7 +1942,7 @@


- [View source] + [View source]
diff --git a/String/Lucky.html b/String/Lucky.html index 1c025c714..5a6902c0c 100644 --- a/String/Lucky.html +++ b/String/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/string_extensions.cr @@ -1879,7 +1879,7 @@


- [View source] + [View source]
@@ -1907,7 +1907,7 @@


- [View source] + [View source]
@@ -1923,7 +1923,7 @@


- [View source] + [View source]
@@ -1939,7 +1939,7 @@


- [View source] + [View source]
@@ -1955,7 +1955,7 @@


- [View source] + [View source]
diff --git a/String/Lucky/ColumnType.html b/String/Lucky/ColumnType.html index 8a62ee056..7e5617b12 100644 --- a/String/Lucky/ColumnType.html +++ b/String/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/string_extensions.cr diff --git a/String/Lucky/Criteria.html b/String/Lucky/Criteria.html index c183d0e62..9344e4170 100644 --- a/String/Lucky/Criteria.html +++ b/String/Lucky/Criteria.html @@ -1733,7 +1733,7 @@

- + avram/charms/string_extensions.cr @@ -2010,7 +2010,7 @@


- [View source] + [View source]
@@ -2040,7 +2040,7 @@


- [View source] + [View source]
@@ -2061,7 +2061,7 @@


- [View source] + [View source]
@@ -2077,7 +2077,7 @@


- [View source] + [View source]
@@ -2093,7 +2093,7 @@


- [View source] + [View source]
@@ -2109,7 +2109,7 @@


- [View source] + [View source]
@@ -2125,7 +2125,7 @@


- [View source] + [View source]
diff --git a/Time.html b/Time.html index a0c61d6f4..d266c3a59 100644 --- a/Time.html +++ b/Time.html @@ -1907,14 +1907,14 @@

- + avram/blank_extensions.cr
- + avram/charms/time_extensions.cr @@ -2053,7 +2053,7 @@


- [View source] + [View source]
@@ -2081,7 +2081,7 @@


- [View source] + [View source]
diff --git a/Time/Lucky.html b/Time/Lucky.html index 3f11867ce..ff81b23a8 100644 --- a/Time/Lucky.html +++ b/Time/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/time_extensions.cr @@ -1913,7 +1913,7 @@


- [View source] + [View source]
@@ -1929,7 +1929,7 @@


- [View source] + [View source]
@@ -1945,7 +1945,7 @@


- [View source] + [View source]
@@ -1973,7 +1973,7 @@


- [View source] + [View source]
@@ -1989,7 +1989,7 @@


- [View source] + [View source]
@@ -2005,7 +2005,7 @@


- [View source] + [View source]
@@ -2021,7 +2021,7 @@


- [View source] + [View source]
@@ -2037,7 +2037,7 @@


- [View source] + [View source]
diff --git a/Time/Lucky/ColumnType.html b/Time/Lucky/ColumnType.html index b0cfba4cb..7550b41c9 100644 --- a/Time/Lucky/ColumnType.html +++ b/Time/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/time_extensions.cr diff --git a/Time/Lucky/Criteria.html b/Time/Lucky/Criteria.html index eef99be62..19433a985 100644 --- a/Time/Lucky/Criteria.html +++ b/Time/Lucky/Criteria.html @@ -1735,7 +1735,7 @@

- + avram/charms/time_extensions.cr @@ -2122,7 +2122,7 @@


- [View source] + [View source]
@@ -2152,7 +2152,7 @@


- [View source] + [View source]
@@ -2173,7 +2173,7 @@


- [View source] + [View source]
@@ -2189,7 +2189,7 @@


- [View source] + [View source]
@@ -2205,7 +2205,7 @@


- [View source] + [View source]
@@ -2221,7 +2221,7 @@


- [View source] + [View source]
@@ -2237,7 +2237,7 @@


- [View source] + [View source]
@@ -2253,7 +2253,7 @@


- [View source] + [View source]
@@ -2269,7 +2269,7 @@


- [View source] + [View source]
@@ -2285,7 +2285,7 @@


- [View source] + [View source]
@@ -2301,7 +2301,7 @@


- [View source] + [View source]
@@ -2317,7 +2317,7 @@


- [View source] + [View source]
@@ -2333,7 +2333,7 @@


- [View source] + [View source]
@@ -2349,7 +2349,7 @@


- [View source] + [View source]
@@ -2365,7 +2365,7 @@


- [View source] + [View source]
@@ -2381,7 +2381,7 @@


- [View source] + [View source]
@@ -2397,7 +2397,7 @@


- [View source] + [View source]
@@ -2413,7 +2413,7 @@


- [View source] + [View source]
@@ -2429,7 +2429,7 @@


- [View source] + [View source]
@@ -2445,7 +2445,7 @@


- [View source] + [View source]
@@ -2461,7 +2461,7 @@


- [View source] + [View source]
@@ -2477,7 +2477,7 @@


- [View source] + [View source]
@@ -2493,7 +2493,7 @@


- [View source] + [View source]
@@ -2509,7 +2509,7 @@


- [View source] + [View source]
@@ -2525,7 +2525,7 @@


- [View source] + [View source]
@@ -2541,7 +2541,7 @@


- [View source] + [View source]
@@ -2557,7 +2557,7 @@


- [View source] + [View source]
diff --git a/UUID.html b/UUID.html index 9d4249204..2dab18487 100644 --- a/UUID.html +++ b/UUID.html @@ -1747,21 +1747,21 @@

- + lib/lucky/src/charms/uuid_extensions.cr
- + avram/blank_extensions.cr
- + avram/charms/uuid_extensions.cr @@ -1900,7 +1900,7 @@


- [View source] + [View source]
@@ -1928,7 +1928,7 @@


- [View source] + [View source]
diff --git a/UUID/Lucky.html b/UUID/Lucky.html index 19d1fce39..f42d5d2fb 100644 --- a/UUID/Lucky.html +++ b/UUID/Lucky.html @@ -1745,7 +1745,7 @@

- + avram/charms/uuid_extensions.cr @@ -1884,7 +1884,7 @@


- [View source] + [View source]
@@ -1912,7 +1912,7 @@


- [View source] + [View source]
@@ -1928,7 +1928,7 @@


- [View source] + [View source]
@@ -1944,7 +1944,7 @@


- [View source] + [View source]
@@ -1960,7 +1960,7 @@


- [View source] + [View source]
@@ -1976,7 +1976,7 @@


- [View source] + [View source]
diff --git a/UUID/Lucky/ColumnType.html b/UUID/Lucky/ColumnType.html index 4c648f472..ee6320fc0 100644 --- a/UUID/Lucky/ColumnType.html +++ b/UUID/Lucky/ColumnType.html @@ -1727,7 +1727,7 @@

- + avram/charms/uuid_extensions.cr diff --git a/UUID/Lucky/Criteria.html b/UUID/Lucky/Criteria.html index feb0d1e16..6e8bf98e1 100644 --- a/UUID/Lucky/Criteria.html +++ b/UUID/Lucky/Criteria.html @@ -1733,7 +1733,7 @@

- + avram/charms/uuid_extensions.cr @@ -1985,7 +1985,7 @@


- [View source] + [View source]
@@ -2020,7 +2020,7 @@


- [View source] + [View source]
diff --git a/index.json b/index.json index 9cbf4bcee..b795dad5d 100644 --- a/index.json +++ b/index.json @@ -1 +1 @@ -{"repository_name":"avram","body":"# Avram\n\n[![API Documentation Website](https://img.shields.io/website?down_color=red&down_message=Offline&label=API%20Documentation&up_message=Online&url=https%3A%2F%2Fluckyframework.github.io%2Favram%2F)](https://luckyframework.github.io/avram)\n\n### Why Avram?\n\nThe name comes from [Henriette Avram](https://en.wikipedia.org/wiki/Henriette_Avram).\n\n> Henriette Davidson Avram (October 7, 1919 – April 22, 2006) was a computer programmer and systems analyst who developed the MARC format (Machine Readable Cataloging), the international data standard for bibliographic and holdings information in libraries.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n avram:\n github: luckyframework/avram\n```\n\n## Usage\n\n```crystal\nrequire \"avram\"\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/luckyframework/avram/fork )\n1. Create your feature branch (git checkout -b my-new-feature)\n1. Install docker and docker-compose: https://docs.docker.com/compose/install/\n1. Run `script/setup`\n1. Make your changes\n1. Run `script/test` to run the specs, build shards, and check formatting\n1. Commit your changes (git commit -am 'Add some feature')\n1. Push to the branch (git push origin my-new-feature)\n1. Create a new Pull Request\n\n## Testing\n\nTo run the tests:\n\n1. Install docker and docker-compose: https://docs.docker.com/compose/install/\n1. Run `script/setup` to set up the docker environment\n1. Run `script/test` to run the specs, build shards, and check formatting\n\nYou can run individual tests like this: `docker-compose run --rm app crystal spec path/to/spec.cr`\n\n> Remember to run `docker-compose down` when you're done. This will stop the\n> Crystal container.\n\n## Contributors\n\n- [paulcsmith](https://github.com/paulcsmith) Paul Smith - creator, maintainer\n- [mikeeus](https://github.com/mikeeus) Mikias Abera - contributor\n","program":{"html_id":"avram/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"avram","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Array","path":"Array.html","kind":"class","full_name":"Array(T)","name":"Array","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"},{"html_id":"avram/Indexable","kind":"module","full_name":"Indexable","name":"Indexable"},{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"},{"html_id":"avram/Iterable","kind":"module","full_name":"Iterable","name":"Iterable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L55"},{"filename":"src/avram/charms/array_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/array_extensions.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L19"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"}],"doc":"An `Array` is an ordered, integer-indexed collection of objects of type T.\n\nArray indexing starts at 0. A negative index is assumed to be\nrelative to the end of the array: -1 indicates the last element,\n-2 is the next to last element, and so on.\n\nAn `Array` can be created using the usual `new` method (several are provided), or with an array literal:\n\n```\nArray(Int32).new # => []\n[1, 2, 3] # Array(Int32)\n[1, \"hello\", 'x'] # Array(Int32 | String | Char)\n```\n\nSee [`Array` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/array.html) in the language reference.\n\nAn `Array` can have mixed types, meaning T will be a union of types, but these are determined\nwhen the array is created, either by specifying T or by using an array literal. In the latter\ncase, T will be set to the union of the array literal elements' types.\n\nWhen creating an empty array you must always specify T:\n\n```\n[] of Int32 # same as Array(Int32)\n[] # syntax error\n```\n\nAn `Array` is implemented using an internal buffer of some capacity\nand is reallocated when elements are pushed to it when more capacity\nis needed. This is normally known as a [dynamic array](http://en.wikipedia.org/wiki/Dynamic_array).\n\nYou can use a special array literal syntax with other types too, as long as they define an argless\n`new` method and a `<<` method. `Set` is one such type:\n\n```\nset = Set{1, 2, 3} # => Set{1, 2, 3}\nset.class # => Set(Int32)\n```\n\nThe above is the same as this:\n\n```\nset = Set(typeof(1, 2, 3)).new\nset << 1\nset << 2\nset << 3\n```","summary":"

An Array is an ordered, integer-indexed collection of objects of type T.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","doc":"Proxy to the `T`'s adapter so we can call methods like\n`Array(String).adapter.to_db([\"test\"])`","summary":"

Proxy to the T's adapter so we can call methods like Array(String).adapter.to_db(["test"])

","abstract":false,"location":{"filename":"src/avram/charms/array_extensions.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/array_extensions.cr#L4"},"def":{"name":"adapter","visibility":"Public","body":"T.adapter"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L56"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"empty?"}},{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","doc":"Arrays of any size should be considered present","summary":"

Arrays of any size should be considered present

","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L21"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"false"}}]},{"html_id":"avram/Avram","path":"Avram.html","kind":"module","full_name":"Avram","name":"Avram","abstract":false,"ancestors":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"locations":[{"filename":"src/avram.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L25"},{"filename":"src/avram/chrono_units.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L1"},{"filename":"src/avram/criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L1"},{"filename":"src/avram/database/column_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L1"},{"filename":"src/avram/database/database_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L1"},{"filename":"src/avram/database/table_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L1"},{"filename":"src/avram/errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L1"},{"filename":"src/avram/order_by_clause.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L1"},{"filename":"src/avram/order_by_clause/order_by.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L1"},{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L1"},{"filename":"src/avram/version.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/version.cr#L1"},{"filename":"src/lucky/ext/avram/errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"FailedQueryLog","name":"FailedQueryLog","value":"Log.for(\"failed_query\")"},{"id":"HABITAT_SETTINGS","name":"HABITAT_SETTINGS","value":"[{decl: lazy_load_enabled : Bool = true, example: nil, validation: nil}, {decl: database_to_migrate : Avram::Database.class, example: \"AppDatabase\", validation: nil}, {decl: time_formats : Array(String) = [] of String, example: nil, validation: nil}, {decl: i18n_backend : Avram::I18nBackend = Avram::I18n.new, example: \"Avram::I18n.new\", validation: nil}, {decl: query_cache_enabled : Bool = false, example: nil, validation: nil}] of Nil"},{"id":"Log","name":"Log","value":"::Log.for(Avram)"},{"id":"QueryLog","name":"QueryLog","value":"Log.for(\"query\")"},{"id":"SaveFailedLog","name":"SaveFailedLog","value":"Log.for(\"save_failed\")"},{"id":"VERSION","name":"VERSION","value":"\"1.1.1\""}],"included_modules":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"class_methods":[{"html_id":"configure(&)-class-method","name":"configure","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L26"},"def":{"name":"configure","yields":1,"block_arity":1,"visibility":"Public","body":"yield settings"}},{"html_id":"initialize_logging-class-method","name":"initialize_logging","doc":"This subscribes to several `Pulsar` events.\nThese events are triggered during query and\noperation events","summary":"

This subscribes to several Pulsar events.

","abstract":false,"location":{"filename":"src/avram.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L44"},"def":{"name":"initialize_logging","visibility":"Public","body":"Avram::Events::QueryEvent.subscribe do |event, duration|\n if event.query.starts_with?(\"TRUNCATE\")\n next\n end\n Avram::QueryLog.dexter.info do\n queryable = event.queryable\n log_data = {query: event.query, args: event.args, duration: Pulsar.elapsed_text(duration)}\n if queryable\n {model: queryable}.merge(log_data)\n else\n log_data\n end\n end\nend\nAvram::Events::FailedQueryEvent.subscribe do |event|\n Avram::FailedQueryLog.dexter.error do\n queryable = event.queryable\n log_data = {error_message: event.error_message, query: event.query, args: \"[FILTERED]\"}\n if queryable\n {model: queryable}.merge(log_data)\n else\n log_data\n end\n end\nend\nAvram::Events::SaveFailedEvent.subscribe do |event|\n Avram::SaveFailedLog.dexter.warn do\n {failed_to_save: event.operation_class, validation_errors: event.error_messages_as_string}\n end\nend\n"}},{"html_id":"settings-class-method","name":"settings","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L26"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"instance_methods":[{"html_id":"settings-instance-method","name":"settings","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L26"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"types":[{"html_id":"avram/Avram/AddColumnAttributes","path":"Avram/AddColumnAttributes.html","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes","abstract":false,"locations":[{"filename":"src/avram/add_column_attributes.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/add_column_attributes.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"This module creates methods for each column in a model that map\nto an `Avram::Attribute` as well as methods that fill those attributes\nwith values that comes from params.","summary":"

This module creates methods for each column in a model that map to an Avram::Attribute as well as methods that fill those attributes with values that comes from params.

"},{"html_id":"avram/Avram/Associations","path":"Avram/Associations.html","kind":"module","full_name":"Avram::Associations","name":"Associations","abstract":false,"ancestors":[{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"}],"locations":[{"filename":"src/avram/associations.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations.cr#L3"},{"filename":"src/avram/associations/belongs_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/belongs_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"}],"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Associations/BelongsTo","path":"Avram/Associations/BelongsTo.html","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo","abstract":false,"locations":[{"filename":"src/avram/associations/belongs_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/belongs_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"belongs_to(type_declaration,foreign_key=nil)-macro","name":"belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, foreign_key = nil)","args_html":"(type_declaration, foreign_key = nil)","location":{"filename":"src/avram/associations/belongs_to.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/belongs_to.cr#L2"},"def":{"name":"belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if type_declaration.type.is_a?(Union) %}\n {% model = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% model = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n\n \n{% if !foreign_key %}\n {% foreign_key = \"#{assoc_name}_id\".id %}\n {% end %}\n\n\n column \n{{ foreign_key.id }}\n : \n{{ model }}\n::PrimaryKeyType\n{% if nilable %}?{% end %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name.id }}\n,\n type: \n{{ model }}\n,\n foreign_key: :\n{{ foreign_key.id }}\n,\n relationship_type: :belongs_to\n\n define_belongs_to_private_assoc_getter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key.id }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_public_preloaded_getters(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_preloaded_setter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n define_belongs_to_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key.id }}\n)\n \n"}}]},{"html_id":"avram/Avram/Associations/HasMany","path":"Avram/Associations/HasMany.html","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany","abstract":false,"locations":[{"filename":"src/avram/associations/has_many.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/has_many.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"has_many(type_declaration,through=nil,foreign_key=nil)-macro","name":"has_many","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, through = nil, foreign_key = nil)","args_html":"(type_declaration, through = nil, foreign_key = nil)","location":{"filename":"src/avram/associations/has_many.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/has_many.cr#L2"},"def":{"name":"has_many","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% if (!through.is_a?(NilLiteral)) && ((!through.is_a?(ArrayLiteral)) || through.any? do |item|\n !item.is_a?(SymbolLiteral)\nend) %}\n {% through.raise(\"'through' on #{@type.name} must be given an Array(Symbol). Instead, got: #{through}\\n\\nExample...\\n has_many comments : Comment\\n has_many related_authors : User, through: [:comments, :author]\\n\\nLearn more about associations: https://luckyframework.org/guides/database/models#model-associations\") %}\n {% end %}\n\n \n{% if (!through.is_a?(NilLiteral)) && through.size < 2 %}\n {% through.raise(\"'through' on #{@type.name} must be given at least two items. Instead, got: #{through}\\n\\nExample...\\n has_many comments : Comment\\n has_many related_authors : User, through: [:comments, :author]\\n\\nLearn more about associations: https://luckyframework.org/guides/database/models#model-associations\") %}\n {% end %}\n\n \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if foreign_key %}{% else %}\n {% foreign_key = \"#{(@type.name.underscore.split(\"::\")).last.id}_id\".id %}\n {% end %}\n\n\n \n{% foreign_key = foreign_key.id %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name }}\n,\n type: \n{{ type_declaration.type }}\n,\n foreign_key: :\n{{ foreign_key }}\n,\n through: \n{{ through }}\n,\n relationship_type: :has_many\n\n \n{% model = type_declaration.type %}\n\n\n define_has_many_lazy_loading(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ through }}\n)\n define_has_many_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ through }}\n)\n \n"}}]},{"html_id":"avram/Avram/Associations/HasOne","path":"Avram/Associations/HasOne.html","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne","abstract":false,"locations":[{"filename":"src/avram/associations/has_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/has_one.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"has_one(type_declaration,foreign_key=nil)-macro","name":"has_one","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, foreign_key = nil)","args_html":"(type_declaration, foreign_key = nil)","location":{"filename":"src/avram/associations/has_one.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/has_one.cr#L2"},"def":{"name":"has_one","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if type_declaration.type.is_a?(Union) %}\n {% model = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% model = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n\n \n{% if foreign_key %}{% else %}\n {% foreign_key = \"#{(@type.name.underscore.split(\"::\")).last.id}_id\".id %}\n {% end %}\n\n\n \n{% foreign_key = foreign_key.id %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name.id }}\n,\n type: \n{{ model }}\n,\n foreign_key: :\n{{ foreign_key.id }}\n,\n relationship_type: :has_one\n\n Avram::Associations.__define_public_preloaded_getters(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_preloaded_setter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n define_has_one_private_assoc_getter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ nilable }}\n)\n define_has_one_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n)\n \n"}}]}]},{"html_id":"avram/Avram/Attribute","path":"Avram/Attribute.html","kind":"class","full_name":"Avram::Attribute(T)","name":"Attribute","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/attribute.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/PermittedAttribute","kind":"class","full_name":"Avram::PermittedAttribute(T)","name":"PermittedAttribute"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(name:Symbol,value:T|Nil,param_key:String,param:Array(String)|Avram::Uploadable|String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::Symbol"},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"::String"},{"name":"param","default_value":"nil","external_name":"param","restriction":"::Array(::String) | ::Avram::Uploadable | ::String | ::Nil"}],"args_string":"(name : Symbol, value : T | Nil, param_key : String, param : Array(String) | Avram::Uploadable | String | Nil = nil)","args_html":"(name : Symbol, value : T | Nil, param_key : String, param : Array(String) | Avram::Uploadable | String | Nil = nil)","location":{"filename":"src/avram/attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::Symbol"},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"::String"},{"name":"param","default_value":"nil","external_name":"param","restriction":"::Array(::String) | ::Avram::Uploadable | ::String | ::Nil"}],"visibility":"Public","body":"_ = Attribute(T).allocate\n_.initialize(name, value, param_key, param)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"[](key)-instance-method","name":"[]","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/attribute.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L167"},"def":{"name":"[]","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":"call_value_instead_error_message(\".[key]\")"}},{"html_id":"[]?(key)-instance-method","name":"[]?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/attribute.cr","line_number":171,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L171"},"def":{"name":"[]?","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":"call_value_instead_error_message(\".[key]?\")"}},{"html_id":"add_error(message:String=\"isinvalid\")-instance-method","name":"add_error","abstract":false,"args":[{"name":"message","default_value":"\"is invalid\"","external_name":"message","restriction":"String"}],"args_string":"(message : String = \"is invalid\")","args_html":"(message : String = "is invalid")","location":{"filename":"src/avram/attribute.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L34"},"def":{"name":"add_error","args":[{"name":"message","default_value":"\"is invalid\"","external_name":"message","restriction":"String"}],"visibility":"Public","body":"@errors << message"}},{"html_id":"add_error(message:Proc|Avram::CallableErrorMessage)-instance-method","name":"add_error","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"Proc | Avram::CallableErrorMessage"}],"args_string":"(message : Proc | Avram::CallableErrorMessage)","args_html":"(message : Proc | Avram::CallableErrorMessage)","location":{"filename":"src/avram/attribute.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L38"},"def":{"name":"add_error","args":[{"name":"message","external_name":"message","restriction":"Proc | Avram::CallableErrorMessage"}],"visibility":"Public","body":"message_string = message.call(@name.to_s, @value.to_s)\nadd_error(message_string)\n"}},{"html_id":"allow_blank=(allow_blank:Bool)-instance-method","name":"allow_blank=","doc":"This can be used as an escape hatch when you\nmay have a blank string that's allowed to be saved.","summary":"

This can be used as an escape hatch when you may have a blank string that's allowed to be saved.

","abstract":false,"args":[{"name":"allow_blank","external_name":"allow_blank","restriction":"Bool"}],"args_string":"(allow_blank : Bool)","args_html":"(allow_blank : Bool)","location":{"filename":"src/avram/attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L11"},"def":{"name":"allow_blank=","args":[{"name":"allow_blank","external_name":"allow_blank","restriction":"Bool"}],"visibility":"Public","body":"@allow_blank = allow_blank"}},{"html_id":"allow_blank?:Bool-instance-method","name":"allow_blank?","doc":"This can be used as an escape hatch when you\nmay have a blank string that's allowed to be saved.","summary":"

This can be used as an escape hatch when you may have a blank string that's allowed to be saved.

","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L11"},"def":{"name":"allow_blank?","return_type":"Bool","visibility":"Public","body":"@allow_blank"}},{"html_id":"changed?(from:T|Nil|Nothing=Nothing.new,to:T|Nil|Nothing=Nothing.new):Bool-instance-method","name":"changed?","abstract":false,"args":[{"name":"from","default_value":"Nothing.new","external_name":"from","restriction":"T | ::Nil | Nothing"},{"name":"to","default_value":"Nothing.new","external_name":"to","restriction":"T | ::Nil | Nothing"}],"args_string":"(from : T | Nil | Nothing = Nothing.new, to : T | Nil | Nothing = Nothing.new) : Bool","args_html":"(from : T | Nil | Nothing = Nothing.new, to : T | Nil | Nothing = Nothing.new) : Bool","location":{"filename":"src/avram/attribute.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L79"},"def":{"name":"changed?","args":[{"name":"from","default_value":"Nothing.new","external_name":"from","restriction":"T | ::Nil | Nothing"},{"name":"to","default_value":"Nothing.new","external_name":"to","restriction":"T | ::Nil | Nothing"}],"return_type":"Bool","visibility":"Public","body":"from = from.is_a?(Nothing) ? true : from == original_value\nto = to.is_a?(Nothing) ? true : to == value\n((value != original_value) && from) && to\n"}},{"html_id":"errors:Array(String)-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L47"},"def":{"name":"errors","return_type":"Array(String)","visibility":"Public","body":"@errors.uniq"}},{"html_id":"extract(params:Avram::Paramable)-instance-method","name":"extract","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/attribute.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L85"},"def":{"name":"extract","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"}],"visibility":"Public","body":"extract(params, type: T)"}},{"html_id":"name:Symbol-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L3"},"def":{"name":"name","return_type":"Symbol","visibility":"Public","body":"@name"}},{"html_id":"original_value:T|Nil-instance-method","name":"original_value","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L59"},"def":{"name":"original_value","return_type":"T | ::Nil","visibility":"Public","body":"if allow_blank?\n @original_value\nelse\n ensure_no_blank(@original_value)\nend"}},{"html_id":"param:Avram::Uploadable|Array(String)|String-instance-method","name":"param","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L30"},"def":{"name":"param","return_type":"Avram::Uploadable | Array(String) | String","visibility":"Public","body":"@param || value.to_s"}},{"html_id":"param_key:String-instance-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L5"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"@param_key"}},{"html_id":"permitted-instance-method","name":"permitted","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L19"},"def":{"name":"permitted","visibility":"Public","body":"@_permitted || (@_permitted = (Avram::PermittedAttribute(T).new(name: @name, param: @param, value: @value, param_key: @param_key).tap do |attribute|\n attribute.allow_blank = allow_blank?\n errors.each do |error|\n attribute.add_error(error)\n end\nend))"}},{"html_id":"reset_errors-instance-method","name":"reset_errors","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L43"},"def":{"name":"reset_errors","visibility":"Public","body":"@errors = [] of String"}},{"html_id":"to_f-instance-method","name":"to_f","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":159,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L159"},"def":{"name":"to_f","visibility":"Public","body":"call_value_instead_error_message(\".to_f\")"}},{"html_id":"to_f64-instance-method","name":"to_f64","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":163,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L163"},"def":{"name":"to_f64","visibility":"Public","body":"call_value_instead_error_message(\".to_f64\")"}},{"html_id":"to_i-instance-method","name":"to_i","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L147"},"def":{"name":"to_i","visibility":"Public","body":"call_value_instead_error_message(\".to_i\")"}},{"html_id":"to_i32-instance-method","name":"to_i32","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":151,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L151"},"def":{"name":"to_i32","visibility":"Public","body":"call_value_instead_error_message(\".to_i32\")"}},{"html_id":"to_i64-instance-method","name":"to_i64","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L155"},"def":{"name":"to_i64","visibility":"Public","body":"call_value_instead_error_message(\".to_i64\")"}},{"html_id":"to_s(time_format:String)-instance-method","name":"to_s","doc":"NOTE: to_s(io : IO) is used when passing an object\nin to string interpolation. Don't override that method.","summary":"

NOTE to_s(io : IO) is used when passing an object in to string interpolation.

","abstract":false,"args":[{"name":"time_format","external_name":"time_format","restriction":"String"}],"args_string":"(time_format : String)","args_html":"(time_format : String)","location":{"filename":"src/avram/attribute.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L143"},"def":{"name":"to_s","args":[{"name":"time_format","external_name":"time_format","restriction":"String"}],"visibility":"Public","body":"call_value_instead_error_message(\".to_s(...)\")"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"These methods may accidentally get called on attributes\ninside of operations. Since these methods don't exist,\nchances are, you meant to call them on the value.\n```\nusername.to_s\n# VS\nusername.value.to_s\n```","summary":"

These methods may accidentally get called on attributes inside of operations.

","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L137"},"def":{"name":"to_s","visibility":"Public","body":"call_value_instead_error_message(\".to_s\")"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L75"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"errors.empty?"}},{"html_id":"value:T|Nil-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L51"},"def":{"name":"value","return_type":"T | ::Nil","visibility":"Public","body":"if allow_blank?\n @value\nelse\n ensure_no_blank(@value)\nend"}},{"html_id":"value=(value:T|Nil)-instance-method","name":"value=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T | ::Nil"}],"args_string":"(value : T | Nil)","args_html":"(value : T | Nil)","location":{"filename":"src/avram/attribute.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L4"},"def":{"name":"value=","args":[{"name":"value","external_name":"value","restriction":"T | ::Nil"}],"visibility":"Public","body":"@value = value"}}],"macros":[{"html_id":"call_value_instead_error_message(method)-macro","name":"call_value_instead_error_message","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""}],"args_string":"(method)","args_html":"(method)","location":{"filename":"src/avram/attribute.cr","line_number":175,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L175"},"def":{"name":"call_value_instead_error_message","args":[{"name":"method","external_name":"method","restriction":""}],"visibility":"Public","body":" \n{% raise(\"\\nThe #{method.id} method should not be called directly on attributes (#{@type}).\\nDid you mean to call it on the value property?\\n\\nTry this...\\n\\n ▸ attribute.value#{method.id}\\n\") %}\n\n \n"}}],"types":[{"html_id":"avram/Avram/Attribute/ErrorMessage","path":"Avram/Attribute/ErrorMessage.html","kind":"alias","full_name":"Avram::Attribute::ErrorMessage","name":"ErrorMessage","abstract":false,"locations":[{"filename":"src/avram/attribute.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Avram::CallableErrorMessage | Proc(String, String, String) | String)","aliased_html":"Avram::CallableErrorMessage | String, String -> String | String","const":false,"namespace":{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute(T)","name":"Attribute"}}]},{"html_id":"avram/Avram/AvramError","path":"Avram/AvramError.html","kind":"class","full_name":"Avram::AvramError","name":"AvramError","abstract":false,"superclass":{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/ConnectionError","kind":"class","full_name":"Avram::ConnectionError","name":"ConnectionError"},{"html_id":"avram/Avram/FailedMigration","kind":"class","full_name":"Avram::FailedMigration","name":"FailedMigration"},{"html_id":"avram/Avram/FailedOperation","kind":"class","full_name":"Avram::FailedOperation","name":"FailedOperation"},{"html_id":"avram/Avram/ImpossibleValidation","kind":"class","full_name":"Avram::ImpossibleValidation","name":"ImpossibleValidation"},{"html_id":"avram/Avram/InvalidDatabaseNameError","kind":"class","full_name":"Avram::InvalidDatabaseNameError","name":"InvalidDatabaseNameError"},{"html_id":"avram/Avram/InvalidOperationError","kind":"class","full_name":"Avram::InvalidOperationError","name":"InvalidOperationError"},{"html_id":"avram/Avram/InvalidQueryError","kind":"class","full_name":"Avram::InvalidQueryError","name":"InvalidQueryError"},{"html_id":"avram/Avram/LazyLoadError","kind":"class","full_name":"Avram::LazyLoadError","name":"LazyLoadError"},{"html_id":"avram/Avram/MissingRequiredAssociationError","kind":"class","full_name":"Avram::MissingRequiredAssociationError","name":"MissingRequiredAssociationError"},{"html_id":"avram/Avram/PGClientNotInstalledError","kind":"class","full_name":"Avram::PGClientNotInstalledError","name":"PGClientNotInstalledError"},{"html_id":"avram/Avram/PGNotRunningError","kind":"class","full_name":"Avram::PGNotRunningError","name":"PGNotRunningError"},{"html_id":"avram/Avram/RecordNotFoundError","kind":"class","full_name":"Avram::RecordNotFoundError","name":"RecordNotFoundError"},{"html_id":"avram/Avram/Rollback","kind":"class","full_name":"Avram::Rollback","name":"Rollback"},{"html_id":"avram/Avram/SchemaMismatchError","kind":"class","full_name":"Avram::SchemaMismatchError","name":"SchemaMismatchError"},{"html_id":"avram/Avram/UnsupportedQueryError","kind":"class","full_name":"Avram::UnsupportedQueryError","name":"UnsupportedQueryError"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Generic Avram exception class.","summary":"

Generic Avram exception class.

"},{"html_id":"avram/Avram/BaseQueryTemplate","path":"Avram/BaseQueryTemplate.html","kind":"class","full_name":"Avram::BaseQueryTemplate","name":"BaseQueryTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/base_query_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/base_query_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,associations,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, associations, *args, **named_args)","args_html":"(type, columns, associations, *args, **named_args)","location":{"filename":"src/avram/base_query_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/base_query_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":3,"visibility":"Public","body":" class ::\n{{ type }}\n::BaseQuery\n def_clone\n include Avram::Queryable(\n{{ type }}\n)\n\n \n{% if type.resolve.has_constant?(\"PRIMARY_KEY_NAME\") %}\n include Avram::PrimaryKeyQueryable({{ type }})\n {% end %}\n\n\n macro generate_criteria_method(name, type)\n def \n\\{\n{ name }}\n \n\\{\n{ type }}.adapter.criteria(self, \"#{table_name}.\n\\{\n{ name }}\")\n \nend\n \nend\n\n def update(\n \n{% for column in columns %}\n {{ column[:name] }} : {{ column[:type] }} | Avram::Nothing{% if column[:nilable] %} | Nil{% end %} = Avram::Nothing.new,\n {% end %}\n\n ) : Int64\n\n _changes = \n{} of Symbol => String?\n\n \n{% for column in columns %}\n if {{ column[:name] }}.nil?\n _changes[:{{ column[:name] }}] = nil\n elsif {{ column[:name] }}.is_a?(Avram::Nothing)\n nil\n else\n value = {{ column[:name] }}.not_nil!.class.adapter.to_db({{ column[:name] }}).to_s\n _changes[:{{ column[:name] }}] = value\n end\n {% end %}\n\n\n database.exec(\n query.statement_for_update(_changes, return_columns: false),\n args: query.args_for_update(_changes)\n ).rows_affected\n \nend\n\n \n{% for column in columns %}\n def {{ column[:name] }}(value)\n {{ column[:name] }}.eq(value)\n end\n\n generate_criteria_method({{ column[:name] }}, {{ column[:type] }})\n\n macro inherited\n generate_criteria_method({{ column[:name] }}, {{ column[:type] }})\n end\n {% end %}\n\n\n \n{% for assoc in associations %}\n def join_{{ assoc[:assoc_name] }}\n inner_join_{{ assoc[:assoc_name] }}\n end\n\n {% for join_type in [\"Inner\", \"Left\", \"Right\", \"Full\"] %}\n def {{ join_type.downcase.id }}_join_{{ assoc[:assoc_name] }}\n {% if assoc[:relationship_type] == (:belongs_to) %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n primary_key: {{ assoc[:foreign_key].id.symbolize }},\n foreign_key: {{ assoc[:type] }}::PRIMARY_KEY_NAME\n )\n )\n {% else %}{% if assoc[:relationship_type] == (:has_one) %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n foreign_key: {{ assoc[:foreign_key].id.symbolize }},\n primary_key: primary_key_name\n )\n )\n {% else %}{% if assoc[:through] %}\n {{ join_type.downcase.id }}_join_{{ assoc[:through].first.id }}\n .__yield_where_{{ assoc[:through].first.id }} do |join_query|\n join_query.{{ join_type.downcase.id }}_join_{{ assoc[:through][1].id }}\n end\n {% else %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n foreign_key: {{ assoc[:foreign_key] }},\n primary_key: primary_key_name\n )\n )\n {% end %}{% end %}{% end %}\n end\n {% end %}\n\n\n def where_{{ assoc[:assoc_name] }}(assoc_query : {{ assoc[:type] }}::BaseQuery, auto_inner_join : Bool = true)\n if auto_inner_join\n join_{{ assoc[:assoc_name] }}.merge_query(assoc_query.query)\n else\n merge_query(assoc_query.query)\n end\n end\n\n # :nodoc:\n # Used internally for has_many through queries\n def __yield_where_{{ assoc[:assoc_name] }}\n assoc_query = yield {{ assoc[:type] }}::BaseQuery.new\n merge_query(assoc_query.query)\n end\n {% end %}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/BetweenCriteria","path":"Avram/BetweenCriteria.html","kind":"module","full_name":"Avram::BetweenCriteria(T, V)","name":"BetweenCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/between_criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria_extensions/between_criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Float64/Lucky/Criteria","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int16/Lucky/Criteria","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/CallableErrorMessage","path":"Avram/CallableErrorMessage.html","kind":"module","full_name":"Avram::CallableErrorMessage","name":"CallableErrorMessage","abstract":false,"locations":[{"filename":"src/avram/validations/callable_error_message.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations/callable_error_message.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"call(attribute_name,attribute_value)-instance-method","name":"call","abstract":true,"args":[{"name":"attribute_name","external_name":"attribute_name","restriction":""},{"name":"attribute_value","external_name":"attribute_value","restriction":""}],"args_string":"(attribute_name, attribute_value)","args_html":"(attribute_name, attribute_value)","location":{"filename":"src/avram/validations/callable_error_message.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations/callable_error_message.cr#L2"},"def":{"name":"call","args":[{"name":"attribute_name","external_name":"attribute_name","restriction":""},{"name":"attribute_value","external_name":"attribute_value","restriction":""}],"visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Callbacks","path":"Avram/Callbacks.html","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks","abstract":false,"locations":[{"filename":"src/avram/callbacks.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"after_commit(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_commit","doc":"Run the given method after save and after successful transaction commit\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_commit notify_post_author\n\n private def notify_post_author(comment : Comment)\n NewCommentNotificationEmail.new(comment, to: comment.author!).deliver_now\n end\nend\n```\n","summary":"

Run the given method after save and after successful transaction commit

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":439,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L439"},"def":{"name":"after_commit","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_commit, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_commit, {{ method_name }}, :unless)\n {% end %}\n\n after_commit(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_commit(if_if=nil,unless_unless=nil,&block)-macro","name":"after_commit","doc":"Run the given block after save and after successful transaction commit\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_commit do |comment|\n NewCommentNotificationEmail.new(comment, to: comment.author!).deliver_now\n end\nend\n```","summary":"

Run the given block after save and after successful transaction commit

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":462,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L462"},"def":{"name":"after_commit","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_commit callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_commit, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_commit, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_commit' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_commit do |saved_user|\\n some_method(saved_user)\\n end\")\nend %}\n\n def after_commit(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_commit).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"after_delete(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_delete","doc":"Same as `after_save` but with a different name","summary":"

Same as after_save but with a different name

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":243,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L243"},"def":{"name":"after_delete","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_delete, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_delete, {{ method_name }}, :unless)\n {% end %}\n\n after_delete(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_delete(if_if=nil,unless_unless=nil,&block)-macro","name":"after_delete","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":323,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L323"},"def":{"name":"after_delete","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_delete callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_delete, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_delete, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_delete' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_delete do |deleted_user|\\n some_method(deleted_user)\\n end\")\nend %}\n\n def after_delete(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_delete).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"after_run(method_name)-macro","name":"after_run","doc":"Run the given method after `run` is called on an `Operation`.\nThe return value of the `run` method is passed to `method_name`.\n\n```\nafter_run :log_entry\n\nprivate def log_entry(value)\n log_stuff(value)\nend\n```","summary":"

Run the given method after run is called on an Operation.

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/avram/callbacks.cr","line_number":378,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L378"},"def":{"name":"after_run","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" after_run do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_run(&block)-macro","name":"after_run","doc":"Run the given block after the operation runs\n\nThe return value from `run` will be passed to this block.\n\n```\nclass GenerateReport < Avram::Operation\n after_run do |value|\n value == \"some report\"\n end\n\n def run\n \"some report\"\n end\nend\n```","summary":"

Run the given block after the operation runs

","abstract":false,"location":{"filename":"src/avram/callbacks.cr","line_number":399,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L399"},"def":{"name":"after_run","block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if block.args.size != 1\n raise(\"The 'after_run' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_run { |value| some_method(value) }\")\nend %}\n\n def after_run(\n%object\n)\n \n{% if @type.methods.map(&.name).includes?((:after_run).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ block.args.first }}\n = \n%object\n\n \n{{ block.body }}\n\n \nend\n \n"}},{"html_id":"after_save(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_save","doc":"Run the given method after save, but before transaction is committed\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThis is a great place to do other database saves because if something goes\nwrong the whole transaction would be rolled back.\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_save touch_post\n\n private def touch_post(comment : Comment)\n SavePost.update!(comment.post!, updated_at: Time.utc)\n end\nend\n```\n\n> This is *not* a good place to do things like send messages, enqueue\n> background jobs, or charge payments. Since the transaction could be rolled\n> back the record may not be persisted to the database.\n> Instead use `after_commit`","summary":"

Run the given method after save, but before transaction is committed

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":230,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L230"},"def":{"name":"after_save","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_save, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_save, {{ method_name }}, :unless)\n {% end %}\n\n after_save(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_save(if_if=nil,unless_unless=nil,&block)-macro","name":"after_save","doc":"Run the given block after save, but before transaction is committed\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThis is a great place to do other database saves because if something goes\nwrong the whole transaction would be rolled back.\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_save do |comment|\n SavePost.update!(comment.post!, updated_at: Time.utc)\n end\nend\n```\n\n> This is *not* a good place to do things like send messages, enqueue\n> background jobs, or charge payments. Since the transaction could be rolled\n> back the record may not be persisted to the database.\n> Instead use `after_commit`","summary":"

Run the given block after save, but before transaction is committed

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":278,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L278"},"def":{"name":"after_save","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_save callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_save, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_save, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_save' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_save do |saved_user|\\n some_method(saved_user)\\n end\")\nend %}\n\n def after_save(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_save).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"before_delete(method_name,if_if=nil,unless_unless=nil)-macro","name":"before_delete","doc":"Same as `before_save`, but with a different name","summary":"

Same as before_save, but with a different name

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":76,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L76"},"def":{"name":"before_delete","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_delete, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_delete, {{ method_name }}, :unless)\n {% end %}\n\n before_delete(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_delete(if_if=nil,unless_unless=nil)-macro","name":"before_delete","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil)","args_html":"(if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":154,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L154"},"def":{"name":"before_delete","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your before_delete callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_delete, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_delete, :unless)\n {% end %}\n\n\n def before_delete\n \n{% if @type.methods.map(&.name).includes?((:before_delete).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ yield }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ yield }}\n end\n {% else %}\n {{ yield }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"before_run(method_name)-macro","name":"before_run","doc":"Run the given method before `run` is called on an `Operation`.\n\n```\nbefore_run :validate_inputs\n\nprivate def validate_inputs\n validate_required data\nend\n```","summary":"

Run the given method before run is called on an Operation.

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/avram/callbacks.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L97"},"def":{"name":"before_run","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" before_run do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_run-macro","name":"before_run","doc":"Run the given block before `run` is called on an `Operation`.\n\n```\nbefore_run do\n validate_required data\nend\n```","summary":"

Run the given block before run is called on an Operation.

","abstract":false,"location":{"filename":"src/avram/callbacks.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L193"},"def":{"name":"before_run","visibility":"Public","body":" def before_run\n \n{% if @type.methods.map(&.name).includes?((:before_run).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}},{"html_id":"before_save(method_name,if_if=nil,unless_unless=nil)-macro","name":"before_save","doc":"Run the given method before saving or creating for `SaveOperation`\n\nThis runs before saving and before the database transaction is started.\nYou can set defaults, validate, or perform any other setup necessary for\nsaving.\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\n```\nbefore_save :run_validations\nbefore_save :validate_can_internet, unless: :too_cool_for_school?\n\nprivate def run_validations\n validate_required name, age\nend\n\nprivate def validate_can_internet\n validate_size_of age, min: 13\nend\n\nprivate def too_cool_for_school?\n [true, false].sample\nend\n```","summary":"

Run the given method before saving or creating for SaveOperation

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L63"},"def":{"name":"before_save","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_save, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_save, {{ method_name }}, :unless)\n {% end %}\n\n before_save(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_save(if_if=nil,unless_unless=nil)-macro","name":"before_save","doc":"Run the given block before saving or creating for `SaveOperation`\n\nThis runs before saving and before the database transaction is started.\nYou can set defaults, validate, or perform any other setup necessary for\nsaving.\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\n```\nbefore_save(unless: :skip_callback?) do\n validate_required name, age\nend\n\nprivate def skip_callback?\n false\nend\n```","summary":"

Run the given block before saving or creating for SaveOperation

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil)","args_html":"(if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":122,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L122"},"def":{"name":"before_save","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your before_save callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_save, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_save, :unless)\n {% end %}\n\n\n def before_save\n \n{% if @type.methods.map(&.name).includes?((:before_save).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ yield }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ yield }}\n end\n {% else %}\n {{ yield }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"conditional_error_for_block_callbacks(callback,condition)-macro","name":"conditional_error_for_block_callbacks","abstract":false,"args":[{"name":"callback","external_name":"callback","restriction":""},{"name":"condition","external_name":"condition","restriction":""}],"args_string":"(callback, condition)","args_html":"(callback, condition)","location":{"filename":"src/avram/callbacks.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L19"},"def":{"name":"conditional_error_for_block_callbacks","args":[{"name":"callback","external_name":"callback","restriction":""},{"name":"condition","external_name":"condition","restriction":""}],"visibility":"Public","body":" \n\\{%\n \nraise <<-ERROR\n You must pass a Symbol to `\n{{ condition.id }}\n` in \n{{ @type }}\n. The Symbol will reference a method you define.\n\n Try this...\n\n \n{{ callback.id }}\n(\n{{ condition.id }}\n: :check_condition?) do\n # your callback block\n end\n\n def check_condition?\n # return your bool value here\n end\n ERROR\n %}\n \n"}}]},{"html_id":"avram/Avram/ChronoUnits","path":"Avram/ChronoUnits.html","kind":"enum","full_name":"Avram::ChronoUnits","name":"ChronoUnits","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/chrono_units.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L2"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Century","name":"Century","value":"0"},{"id":"Day","name":"Day","value":"1"},{"id":"Decade","name":"Decade","value":"2"},{"id":"Dow","name":"Dow","value":"3"},{"id":"Doy","name":"Doy","value":"4"},{"id":"Epoch","name":"Epoch","value":"5"},{"id":"Hour","name":"Hour","value":"6"},{"id":"Isodow","name":"Isodow","value":"7"},{"id":"Isoyear","name":"Isoyear","value":"8"},{"id":"Julian","name":"Julian","value":"9"},{"id":"Microseconds","name":"Microseconds","value":"10"},{"id":"Millennium","name":"Millennium","value":"11"},{"id":"Milliseconds","name":"Milliseconds","value":"12"},{"id":"Minute","name":"Minute","value":"13"},{"id":"Month","name":"Month","value":"14"},{"id":"Quarter","name":"Quarter","value":"15"},{"id":"Second","name":"Second","value":"16"},{"id":"Timezone","name":"Timezone","value":"17"},{"id":"TimezoneHour","name":"TimezoneHour","value":"18"},{"id":"TimezoneMinute","name":"TimezoneMinute","value":"19"},{"id":"Week","name":"Week","value":"20"},{"id":"Year","name":"Year","value":"21"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"century?-instance-method","name":"century?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L3"},"def":{"name":"century?","visibility":"Public","body":"self == Century"}},{"html_id":"day?-instance-method","name":"day?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L4"},"def":{"name":"day?","visibility":"Public","body":"self == Day"}},{"html_id":"decade?-instance-method","name":"decade?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L5"},"def":{"name":"decade?","visibility":"Public","body":"self == Decade"}},{"html_id":"dow?-instance-method","name":"dow?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L6"},"def":{"name":"dow?","visibility":"Public","body":"self == Dow"}},{"html_id":"doy?-instance-method","name":"doy?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L7"},"def":{"name":"doy?","visibility":"Public","body":"self == Doy"}},{"html_id":"epoch?-instance-method","name":"epoch?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L8"},"def":{"name":"epoch?","visibility":"Public","body":"self == Epoch"}},{"html_id":"hour?-instance-method","name":"hour?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L9"},"def":{"name":"hour?","visibility":"Public","body":"self == Hour"}},{"html_id":"isodow?-instance-method","name":"isodow?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L10"},"def":{"name":"isodow?","visibility":"Public","body":"self == Isodow"}},{"html_id":"isoyear?-instance-method","name":"isoyear?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L11"},"def":{"name":"isoyear?","visibility":"Public","body":"self == Isoyear"}},{"html_id":"julian?-instance-method","name":"julian?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L12"},"def":{"name":"julian?","visibility":"Public","body":"self == Julian"}},{"html_id":"microseconds?-instance-method","name":"microseconds?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L13"},"def":{"name":"microseconds?","visibility":"Public","body":"self == Microseconds"}},{"html_id":"millennium?-instance-method","name":"millennium?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L14"},"def":{"name":"millennium?","visibility":"Public","body":"self == Millennium"}},{"html_id":"milliseconds?-instance-method","name":"milliseconds?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L15"},"def":{"name":"milliseconds?","visibility":"Public","body":"self == Milliseconds"}},{"html_id":"minute?-instance-method","name":"minute?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L16"},"def":{"name":"minute?","visibility":"Public","body":"self == Minute"}},{"html_id":"month?-instance-method","name":"month?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L17"},"def":{"name":"month?","visibility":"Public","body":"self == Month"}},{"html_id":"quarter?-instance-method","name":"quarter?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L18"},"def":{"name":"quarter?","visibility":"Public","body":"self == Quarter"}},{"html_id":"second?-instance-method","name":"second?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L19"},"def":{"name":"second?","visibility":"Public","body":"self == Second"}},{"html_id":"timezone?-instance-method","name":"timezone?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L20"},"def":{"name":"timezone?","visibility":"Public","body":"self == Timezone"}},{"html_id":"timezone_hour?-instance-method","name":"timezone_hour?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L21"},"def":{"name":"timezone_hour?","visibility":"Public","body":"self == TimezoneHour"}},{"html_id":"timezone_minute?-instance-method","name":"timezone_minute?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L22"},"def":{"name":"timezone_minute?","visibility":"Public","body":"self == TimezoneMinute"}},{"html_id":"week?-instance-method","name":"week?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L23"},"def":{"name":"week?","visibility":"Public","body":"self == Week"}},{"html_id":"year?-instance-method","name":"year?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L24"},"def":{"name":"year?","visibility":"Public","body":"self == Year"}}]},{"html_id":"avram/Avram/Connection","path":"Avram/Connection.html","kind":"class","full_name":"Avram::Connection","name":"Connection","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Handles the connection to the DB.","summary":"

Handles the connection to the DB.

","constructors":[{"html_id":"new(connection_string:String,database_class:Avram::Database.class)-class-method","name":"new","abstract":false,"args":[{"name":"connection_string","external_name":"connection_string","restriction":"String"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"args_string":"(connection_string : String, database_class : Avram::Database.class)","args_html":"(connection_string : String, database_class : Avram::Database.class)","location":{"filename":"src/avram/connection.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L5"},"def":{"name":"new","args":[{"name":"connection_string","external_name":"connection_string","restriction":"String"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection_string, database_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"close:Nil-instance-method","name":"close","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L12"},"def":{"name":"close","return_type":"Nil","visibility":"Public","body":"@db.try(&.close)\n@db = nil\n"}},{"html_id":"connect_listen(*channels:String,&block:PQ::Notification->):Nil-instance-method","name":"connect_listen","abstract":false,"args":[{"name":"channels","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String, &block : PQ::Notification -> ) : Nil","args_html":"(*channels : String, &block : PQ::Notification -> ) : Nil","location":{"filename":"src/avram/connection.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L17"},"def":{"name":"connect_listen","args":[{"name":"channels","external_name":"channels","restriction":"String"}],"splat_index":0,"yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(PQ::Notification ->)"},"return_type":"Nil","visibility":"Public","body":"begin\n PG.connect_listen(@connection_string, *channels, &block)\nrescue DB::ConnectionRefused\n raise(ConnectionError.new(connection_uri, database_class: @database_class))\nend"}},{"html_id":"open:DB::Database-instance-method","name":"open","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L8"},"def":{"name":"open","return_type":"DB::Database","visibility":"Public","body":"@db = try_connection!"}},{"html_id":"try_connection!:DB::Database-instance-method","name":"try_connection!","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L23"},"def":{"name":"try_connection!","return_type":"DB::Database","visibility":"Public","body":"begin\n DB.open(@connection_string)\nrescue DB::ConnectionRefused\n raise(ConnectionError.new(connection_uri, database_class: @database_class))\nend"}}]},{"html_id":"avram/Avram/ConnectionError","path":"Avram/ConnectionError.html","kind":"class","full_name":"Avram::ConnectionError","name":"ConnectionError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L82"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"DEFAULT_PG_PORT","name":"DEFAULT_PG_PORT","value":"5432"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(connection_details:URI,database_class:Avram::Database.class)-class-method","name":"new","abstract":false,"args":[{"name":"connection_details","external_name":"connection_details","restriction":"URI"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"args_string":"(connection_details : URI, database_class : Avram::Database.class)","args_html":"(connection_details : URI, database_class : Avram::Database.class)","location":{"filename":"src/avram/errors.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L88"},"def":{"name":"new","args":[{"name":"connection_details","external_name":"connection_details","restriction":"URI"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection_details, database_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"connection_details:URI-instance-method","name":"connection_details","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L85"},"def":{"name":"connection_details","return_type":"URI","visibility":"Public","body":"@connection_details"}},{"html_id":"database_class:Avram::Database.class-instance-method","name":"database_class","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L86"},"def":{"name":"database_class","return_type":"Avram::Database.class","visibility":"Public","body":"@database_class"}}]},{"html_id":"avram/Avram/Credentials","path":"Avram/Credentials.html","kind":"class","full_name":"Avram::Credentials","name":"Credentials","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/credentials.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"parse?(connection_url:String|Nil):Credentials|Nil-class-method","name":"parse?","doc":"Parse a postgres connection string URL. This may come from an\nenvironment variable.\nReturns `nil` if no `connection_url` is provided.\n\n```\nAvram::Credentials.parse?(ENV[\"DB_URL\"]?)\n```","summary":"

Parse a postgres connection string URL.

","abstract":false,"args":[{"name":"connection_url","external_name":"connection_url","restriction":"String | ::Nil"}],"args_string":"(connection_url : String | Nil) : Credentials | Nil","args_html":"(connection_url : String | Nil) : Credentials | Nil","location":{"filename":"src/avram/credentials.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L28"},"def":{"name":"parse?","args":[{"name":"connection_url","external_name":"connection_url","restriction":"String | ::Nil"}],"return_type":"Credentials | ::Nil","visibility":"Public","body":"if connection_url.nil?\n return nil\nend\nparse(connection_url.as(String))\n"}}],"constructors":[{"html_id":"new(database:String,hostname:String|Nil=nil,username:String|Nil=nil,password:String|Nil=nil,port:Int32|Nil=nil,query:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"String"},{"name":"hostname","default_value":"nil","external_name":"hostname","restriction":"String | ::Nil"},{"name":"username","default_value":"nil","external_name":"username","restriction":"String | ::Nil"},{"name":"password","default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"port","default_value":"nil","external_name":"port","restriction":"Int32 | ::Nil"},{"name":"query","default_value":"nil","external_name":"query","restriction":"String | ::Nil"}],"args_string":"(database : String, hostname : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil, port : Int32 | Nil = nil, query : String | Nil = nil)","args_html":"(database : String, hostname : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil, port : Int32 | Nil = nil, query : String | Nil = nil)","location":{"filename":"src/avram/credentials.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L4"},"def":{"name":"new","args":[{"name":"database","external_name":"database","restriction":"String"},{"name":"hostname","default_value":"nil","external_name":"hostname","restriction":"String | ::Nil"},{"name":"username","default_value":"nil","external_name":"username","restriction":"String | ::Nil"},{"name":"password","default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"port","default_value":"nil","external_name":"port","restriction":"Int32 | ::Nil"},{"name":"query","default_value":"nil","external_name":"query","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(database, hostname, username, password, port, query)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"parse(connection_url:String):Credentials-class-method","name":"parse","doc":"Parse a postgres connection string URL. This may come from an\nenvironment variable.\n\n```\nAvram::Credentials.parse(ENV[\"DB_URL\"])\n```","summary":"

Parse a postgres connection string URL.

","abstract":false,"args":[{"name":"connection_url","external_name":"connection_url","restriction":"String"}],"args_string":"(connection_url : String) : Credentials","args_html":"(connection_url : String) : Credentials","location":{"filename":"src/avram/credentials.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L39"},"def":{"name":"parse","args":[{"name":"connection_url","external_name":"connection_url","restriction":"String"}],"return_type":"Credentials","visibility":"Public","body":"uri = URI.parse(connection_url)\nnew(database: uri.path.to_s, hostname: uri.host, username: uri.user, password: uri.password, port: uri.port, query: uri.query)\n"}},{"html_id":"void:Credentials-class-method","name":"void","doc":"Used when you need to configure credentials,\nbut no database connection is made.","summary":"

Used when you need to configure credentials, but no database connection is made.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L17"},"def":{"name":"void","return_type":"Credentials","visibility":"Public","body":"new(database: \"unused\")"}}],"instance_methods":[{"html_id":"connection_string:String-instance-method","name":"connection_string","doc":"This is the full connection string used\nto connect to the PostgreSQL server.","summary":"

This is the full connection string used to connect to the PostgreSQL server.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L85"},"def":{"name":"connection_string","return_type":"String","visibility":"Public","body":"String.build do |io|\n set_url_protocol(io)\n set_url_creds(io)\n set_url_host(io)\n set_url_port(io)\nend"}},{"html_id":"database:String-instance-method","name":"database","doc":"The name of the database you want to connect to","summary":"

The name of the database you want to connect to

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L52"},"def":{"name":"database","return_type":"String","visibility":"Public","body":"@database = @database.strip\nif @database.starts_with?('/')\n @database = @database[1..-1]\nend\nif @database.empty?\n raise(InvalidDatabaseNameError.new(\"The database name specified was blank. Be sure to set a value.\"))\nend\n@database\n"}},{"html_id":"hostname:String|Nil-instance-method","name":"hostname","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L63"},"def":{"name":"hostname","return_type":"String | ::Nil","visibility":"Public","body":"@hostname.try(&.strip).presence"}},{"html_id":"password:String|Nil-instance-method","name":"password","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L71"},"def":{"name":"password","return_type":"String | ::Nil","visibility":"Public","body":"@password.try(&.strip).presence"}},{"html_id":"port:Int32|Nil-instance-method","name":"port","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L75"},"def":{"name":"port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@port"}},{"html_id":"query:String|Nil-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L79"},"def":{"name":"query","return_type":"String | ::Nil","visibility":"Public","body":"@query.try(&.strip).presence"}},{"html_id":"url:String-instance-method","name":"url","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L2"},"def":{"name":"url","return_type":"String","visibility":"Public","body":"@url"}},{"html_id":"url_without_query_params:String-instance-method","name":"url_without_query_params","doc":"Returns the postgres connection string without\nany query params.","summary":"

Returns the postgres connection string without any query params.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":96,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L96"},"def":{"name":"url_without_query_params","return_type":"String","visibility":"Public","body":"url.sub(\"?#{@query}\", \"\")"}},{"html_id":"username:String|Nil-instance-method","name":"username","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L67"},"def":{"name":"username","return_type":"String | ::Nil","visibility":"Public","body":"@username.try(&.strip).presence"}}]},{"html_id":"avram/Avram/Criteria","path":"Avram/Criteria.html","kind":"class","full_name":"Avram::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Bool/Lucky/Criteria","kind":"class","full_name":"Bool::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Float64/Lucky/Criteria","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int16/Lucky/Criteria","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/JSON/Any/Lucky/Criteria","kind":"class","full_name":"JSON::Any::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/JSON/Serializable/Lucky/Criteria","kind":"class","full_name":"JSON::Serializable::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Slice/Lucky/Criteria","kind":"class","full_name":"Slice::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/String/Lucky/Criteria","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/UUID/Lucky/Criteria","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"asc_order(null_sorting:Avram::OrderBy::NullSorting=:default):T-instance-method","name":"asc_order","abstract":false,"args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"args_string":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","args_html":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","location":{"filename":"src/avram/criteria.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L14"},"def":{"name":"asc_order","args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderBy.new(column, :asc, null_sorting))"}},{"html_id":"column:Symbol|String-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L3"},"def":{"name":"column","return_type":"Symbol | String","visibility":"Public","body":"@column"}},{"html_id":"column=(column:Symbol|String)-instance-method","name":"column=","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(column : Symbol | String)","args_html":"(column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L3"},"def":{"name":"column=","args":[{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"@column = column"}},{"html_id":"desc_order(null_sorting:Avram::OrderBy::NullSorting=:default):T-instance-method","name":"desc_order","abstract":false,"args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"args_string":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","args_html":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","location":{"filename":"src/avram/criteria.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L10"},"def":{"name":"desc_order","args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderBy.new(column, :desc, null_sorting))"}},{"html_id":"eq(value):T-instance-method","name":"eq","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L22"},"def":{"name":"eq","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"check_just_nil!(typeof(value))\ncheck_nilable!(value)\nperform_eq(value)\n"}},{"html_id":"gt(value):T-instance-method","name":"gt","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":116,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L116"},"def":{"name":"gt","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::GreaterThan.new(column, V.adapter.to_db!(value)))"}},{"html_id":"gte(value):T-instance-method","name":"gte","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":120,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L120"},"def":{"name":"gte","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::GreaterThanOrEqualTo.new(column, V.adapter.to_db!(value)))"}},{"html_id":"in(values):T-instance-method","name":"in","abstract":false,"args":[{"name":"values","external_name":"values","restriction":""}],"args_string":"(values) : T","args_html":"(values) : T","location":{"filename":"src/avram/criteria.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L152"},"def":{"name":"in","args":[{"name":"values","external_name":"values","restriction":""}],"return_type":"T","visibility":"Public","body":"values = values.map do |value|\n V.adapter.to_db!(value)\nend\nadd_clause(Avram::Where::In.new(column, values))\n"}},{"html_id":"is_nil:T-instance-method","name":"is_nil","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":102,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L102"},"def":{"name":"is_nil","return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Null.new(column))"}},{"html_id":"is_not_nil:T-instance-method","name":"is_not_nil","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L106"},"def":{"name":"is_not_nil","return_type":"T","visibility":"Public","body":"not()\nis_nil\n"}},{"html_id":"lt(value):T-instance-method","name":"lt","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":124,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L124"},"def":{"name":"lt","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::LessThan.new(column, V.adapter.to_db!(value)))"}},{"html_id":"lte(value):T-instance-method","name":"lte","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":128,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L128"},"def":{"name":"lte","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::LessThanOrEqualTo.new(column, V.adapter.to_db!(value)))"}},{"html_id":"nilable_eq(value):T-instance-method","name":"nilable_eq","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":92,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L92"},"def":{"name":"nilable_eq","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"check_just_nil!(typeof(value))\nif value.nil?\n is_nil\nelse\n perform_eq(value)\nend\n"}},{"html_id":"not:Avram::Criteria-instance-method","name":"not","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":111,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L111"},"def":{"name":"not","return_type":"Avram::Criteria","visibility":"Public","body":"@negate_next_criteria = true\nself\n"}},{"html_id":"random_order:T-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L18"},"def":{"name":"random_order","return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderByRandom.new)"}},{"html_id":"rows:T-instance-method","name":"rows","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L2"},"def":{"name":"rows","return_type":"T","visibility":"Public","body":"@rows"}},{"html_id":"rows=(rows:T)-instance-method","name":"rows=","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"}],"args_string":"(rows : T)","args_html":"(rows : T)","location":{"filename":"src/avram/criteria.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L2"},"def":{"name":"rows=","args":[{"name":"rows","external_name":"rows","restriction":"T"}],"visibility":"Public","body":"@rows = rows"}},{"html_id":"select_average:Float64|Nil-instance-method","name":"select_average","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L140"},"def":{"name":"select_average","return_type":"Float64 | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_average(column)).as(PG::Numeric | ::Nil)).try(&.to_f64)"}},{"html_id":"select_average!:Float64-instance-method","name":"select_average!","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":144,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L144"},"def":{"name":"select_average!","return_type":"Float64","visibility":"Public","body":"select_average || 0_f64"}},{"html_id":"select_max:V|Nil-instance-method","name":"select_max","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":136,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L136"},"def":{"name":"select_max","return_type":"V | ::Nil","visibility":"Public","body":"rows.exec_scalar(&.select_max(column)).as(V | ::Nil)"}},{"html_id":"select_min:V|Nil-instance-method","name":"select_min","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L132"},"def":{"name":"select_min","return_type":"V | ::Nil","visibility":"Public","body":"rows.exec_scalar(&.select_min(column)).as(V | ::Nil)"}},{"html_id":"select_sum-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":148,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L148"},"def":{"name":"select_sum","visibility":"Public","body":"rows.exec_scalar(&.select_sum(column))"}}],"macros":[{"html_id":"define_function_criteria(name,output_type=V,sql_name=nil)-macro","name":"define_function_criteria","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"output_type","default_value":"V","external_name":"output_type","restriction":""},{"name":"sql_name","default_value":"nil","external_name":"sql_name","restriction":""}],"args_string":"(name, output_type = V, sql_name = nil)","args_html":"(name, output_type = V, sql_name = nil)","location":{"filename":"src/avram/criteria.cr","line_number":190,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L190"},"def":{"name":"define_function_criteria","args":[{"name":"name","external_name":"name","restriction":""},{"name":"output_type","default_value":"V","external_name":"output_type","restriction":""},{"name":"sql_name","default_value":"nil","external_name":"sql_name","restriction":""}],"visibility":"Public","body":" \n{% sql_name = sql_name ? sql_name.id : name.id.upcase %}\n\n def \n{{ name }}\n\n Criteria(T,\n{{ output_type }}\n).new(rows, \"\n{{ sql_name }}\n(#{column})\")\n \nend\n \n"}}]},{"html_id":"avram/Avram/Database","path":"Avram/Database.html","kind":"class","full_name":"Avram::Database","name":"Database","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L1"},{"filename":"src/avram/database/column_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L2"},{"filename":"src/avram/database/database_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L2"},{"filename":"src/avram/database/table_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"close_connections!-class-method","name":"close_connections!","doc":"Close all available connections as well as the DB","summary":"

Close all available connections as well as the DB

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L162"},"def":{"name":"close_connections!","visibility":"Public","body":"connections.values.map(&.close)\n@@db.try(&.close)\n"}},{"html_id":"connections-class-method","name":"connections","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L6"},"def":{"name":"connections","visibility":"Public","body":"@@connections"}},{"html_id":"credentials-class-method","name":"credentials","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L140"},"def":{"name":"credentials","visibility":"Public","body":"settings.credentials"}},{"html_id":"database_info:DatabaseInfo-class-method","name":"database_info","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L69"},"def":{"name":"database_info","return_type":"DatabaseInfo","visibility":"Public","body":"@@database_info || (@@database_info = DatabaseInfo.load(self))"}},{"html_id":"delete-class-method","name":"delete","doc":"Run a SQL `DELETE` on all tables in the database","summary":"

Run a SQL DELETE on all tables in the database

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L49"},"def":{"name":"delete","visibility":"Public","body":"new.delete"}},{"html_id":"exec(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"exec","doc":"Same as crystal-db's `DB::QueryMethods#exec` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#exec but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"exec","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.exec(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"listen(*channels:String,&block:PQ::Notification->):Nil-class-method","name":"listen","doc":"Listens for `pg_notify()` calls on each channel in `channels`\nYields a `PQ::Notification` object with `channel`, `payload`, and `pid`.\n\n```\n# pg_notify(\"callback\", \"123\")\nAppDatabase.listen(\"callback\", \"jobs\") do |notification|\n notification.channel # => \"callback\"\n notification.payload # => \"123\"\nend\n```","summary":"

Listens for pg_notify() calls on each channel in channels Yields a PQ::Notification object with channel, payload, and pid.

","abstract":false,"args":[{"name":"channels","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String, &block : PQ::Notification -> ) : Nil","args_html":"(*channels : String, &block : PQ::Notification -> ) : Nil","location":{"filename":"src/avram/database.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L63"},"def":{"name":"listen","args":[{"name":"channels","external_name":"channels","restriction":"String"}],"splat_index":0,"yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(PQ::Notification ->)"},"return_type":"Nil","visibility":"Public","body":"new.listen(*channels, &block)"}},{"html_id":"lock_id:UInt64|Nil-class-method","name":"lock_id","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L7"},"def":{"name":"lock_id","return_type":"UInt64 | ::Nil","visibility":"Public","body":"@@lock_id"}},{"html_id":"lock_id=(lock_id:UInt64|Nil)-class-method","name":"lock_id=","abstract":false,"args":[{"name":"lock_id","external_name":"lock_id","restriction":"UInt64 | ::Nil"}],"args_string":"(lock_id : UInt64 | Nil)","args_html":"(lock_id : UInt64 | Nil)","location":{"filename":"src/avram/database.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L7"},"def":{"name":"lock_id=","args":[{"name":"lock_id","external_name":"lock_id","restriction":"UInt64 | ::Nil"}],"visibility":"Public","body":"@@lock_id = lock_id"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#:query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_all(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#:query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_all(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_each(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_each","doc":"Same as crystal-db's `DB::QueryMethods#:query_each` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_each but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_each","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_each(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_one(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#:query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_one(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#query_one?` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one? but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_one?(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#:\"query_one?\"` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:"query_one?" but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_one?(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"rollback-class-method","name":"rollback","doc":"Rollback the current transaction","summary":"

Rollback the current transaction

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L39"},"def":{"name":"rollback","visibility":"Public","body":"new.rollback"}},{"html_id":"run(&)-class-method","name":"run","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":148,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L148"},"def":{"name":"run","yields":1,"block_arity":1,"visibility":"Public","body":"new.run do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"scalar(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"scalar","doc":"Same as crystal-db's `DB::QueryMethods#scalar` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#scalar but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"scalar","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.scalar(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"setup_connection(&block:DB::Connection->Nil)-class-method","name":"setup_connection","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L28"},"def":{"name":"setup_connection","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(DB::Connection -> Nil)"},"visibility":"Public","body":"new.db.setup_connection do |conn|\n block.call(conn)\nend"}},{"html_id":"transaction(&)-class-method","name":"transaction","doc":"Wrap the block in a database transaction\n\n```\nAppDatabase.transaction do\n # Create, read, update\n # Force a rollback with AppDatabase.rollback\nend\n```","summary":"

Wrap the block in a database transaction

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L81"},"def":{"name":"transaction","yields":1,"block_arity":1,"visibility":"Public","body":"new.transaction do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"truncate(**named_args)-class-method","name":"truncate","doc":"Run a SQL `TRUNCATE` on all tables in the database","summary":"

Run a SQL TRUNCATE on all tables in the database

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L44"},"def":{"name":"truncate","double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"visibility":"Public","body":"new.truncate(**named_args)"}},{"html_id":"verify_connection-class-method","name":"verify_connection","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L34"},"def":{"name":"verify_connection","visibility":"Public","body":"new.connection.open.close"}}],"instance_methods":[{"html_id":"exec(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"exec","doc":"Same as crystal-db's `DB::QueryMethods#exec` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#exec but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"exec","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.exec(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"publish_query_event(query,args_,args,queryable,&)-instance-method","name":"publish_query_event","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","external_name":"args","restriction":""},{"name":"queryable","external_name":"queryable","restriction":""}],"args_string":"(query, args_, args, queryable, &)","args_html":"(query, args_, args, queryable, &)","location":{"filename":"src/avram/database.cr","line_number":125,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L125"},"def":{"name":"publish_query_event","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","external_name":"args","restriction":""},{"name":"queryable","external_name":"queryable","restriction":""}],"yields":0,"block_arity":0,"visibility":"Public","body":"begin\n logging_args = (DB::EnumerableConcat.build(args_, args)).to_s\n Avram::Events::QueryEvent.publish(query: query, args: logging_args, queryable: queryable) do\n yield\n end\nrescue e : PQ::PQError\n Avram::Events::FailedQueryEvent.publish(error_message: e.message.to_s, query: query, queryable: queryable, args: logging_args)\n raise(e)\nend"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#:query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_all(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#:query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_all(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_each(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_each","doc":"Same as crystal-db's `DB::QueryMethods#:query_each` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_each but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_each","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_each(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#:query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#query_one?` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one? but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one?(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#:\"query_one?\"` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:"query_one?" but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one?(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"scalar(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"scalar","doc":"Same as crystal-db's `DB::QueryMethods#scalar` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#scalar but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"scalar","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.scalar(query, *args_, **named_args, args: args)\n end\nend"}}],"types":[{"html_id":"avram/Avram/Database/ColumnInfo","path":"Avram/Database/ColumnInfo.html","kind":"struct","full_name":"Avram::Database::ColumnInfo","name":"ColumnInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/DB/Mappable","kind":"module","full_name":"DB::Mappable","name":"Mappable"},{"html_id":"avram/DB/Serializable","kind":"module","full_name":"DB::Serializable","name":"Serializable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/column_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/Mappable","kind":"module","full_name":"DB::Mappable","name":"Mappable"},{"html_id":"avram/DB/Serializable","kind":"module","full_name":"DB::Serializable","name":"Serializable"}],"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"class_methods":[{"html_id":"from_rs(rs:DB::ResultSet)-class-method","name":"from_rs","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/database/column_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L4"},"def":{"name":"from_rs","args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"visibility":"Public","body":"begin\n objs = Array(self).new\n rs.each do\n objs << (self.new(rs))\n end\n objs\nensure\n rs.close\nend"}}],"constructors":[{"html_id":"new(rs:DB::ResultSet)-class-method","name":"new","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/database/column_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L4"},"def":{"name":"new","args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"visibility":"Public","body":"instance = allocate\ninstance.initialize(__set_for_db_serializable: rs)\nif instance.responds_to?(:finalize)\n GC.add_finalizer(instance)\nend\ninstance\n"}}],"instance_methods":[{"html_id":"column_default:String|Nil-instance-method","name":"column_default","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L12"},"def":{"name":"column_default","return_type":"String | ::Nil","visibility":"Public","body":"@column_default"}},{"html_id":"column_default=(column_default:String|Nil)-instance-method","name":"column_default=","abstract":false,"args":[{"name":"column_default","external_name":"column_default","restriction":"String | ::Nil"}],"args_string":"(column_default : String | Nil)","args_html":"(column_default : String | Nil)","location":{"filename":"src/avram/database/column_info.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L12"},"def":{"name":"column_default=","args":[{"name":"column_default","external_name":"column_default","restriction":"String | ::Nil"}],"visibility":"Public","body":"@column_default = column_default"}},{"html_id":"column_name:String-instance-method","name":"column_name","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L10"},"def":{"name":"column_name","return_type":"String","visibility":"Public","body":"@column_name"}},{"html_id":"column_name=(column_name:String)-instance-method","name":"column_name=","abstract":false,"args":[{"name":"column_name","external_name":"column_name","restriction":"String"}],"args_string":"(column_name : String)","args_html":"(column_name : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L10"},"def":{"name":"column_name=","args":[{"name":"column_name","external_name":"column_name","restriction":"String"}],"visibility":"Public","body":"@column_name = column_name"}},{"html_id":"data_type:String-instance-method","name":"data_type","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L13"},"def":{"name":"data_type","return_type":"String","visibility":"Public","body":"@data_type"}},{"html_id":"data_type=(data_type:String)-instance-method","name":"data_type=","abstract":false,"args":[{"name":"data_type","external_name":"data_type","restriction":"String"}],"args_string":"(data_type : String)","args_html":"(data_type : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L13"},"def":{"name":"data_type=","args":[{"name":"data_type","external_name":"data_type","restriction":"String"}],"visibility":"Public","body":"@data_type = data_type"}},{"html_id":"is_nullable:String-instance-method","name":"is_nullable","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L11"},"def":{"name":"is_nullable","return_type":"String","visibility":"Public","body":"@is_nullable"}},{"html_id":"is_nullable=(is_nullable:String)-instance-method","name":"is_nullable=","abstract":false,"args":[{"name":"is_nullable","external_name":"is_nullable","restriction":"String"}],"args_string":"(is_nullable : String)","args_html":"(is_nullable : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L11"},"def":{"name":"is_nullable=","args":[{"name":"is_nullable","external_name":"is_nullable","restriction":"String"}],"visibility":"Public","body":"@is_nullable = is_nullable"}},{"html_id":"nilable?:Bool-instance-method","name":"nilable?","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L15"},"def":{"name":"nilable?","return_type":"Bool","visibility":"Public","body":"is_nullable == \"YES\""}},{"html_id":"table:Avram::Database::TableInfo-instance-method","name":"table","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L19"},"def":{"name":"table","return_type":"Avram::Database::TableInfo","visibility":"Public","body":"TableInfo.new(table_name, table_type, table_schema)"}},{"html_id":"table_catalog:String-instance-method","name":"table_catalog","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L6"},"def":{"name":"table_catalog","return_type":"String","visibility":"Public","body":"@table_catalog"}},{"html_id":"table_catalog=(table_catalog:String)-instance-method","name":"table_catalog=","abstract":false,"args":[{"name":"table_catalog","external_name":"table_catalog","restriction":"String"}],"args_string":"(table_catalog : String)","args_html":"(table_catalog : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L6"},"def":{"name":"table_catalog=","args":[{"name":"table_catalog","external_name":"table_catalog","restriction":"String"}],"visibility":"Public","body":"@table_catalog = table_catalog"}},{"html_id":"table_name:String-instance-method","name":"table_name","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L8"},"def":{"name":"table_name","return_type":"String","visibility":"Public","body":"@table_name"}},{"html_id":"table_name=(table_name:String)-instance-method","name":"table_name=","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"String"}],"args_string":"(table_name : String)","args_html":"(table_name : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L8"},"def":{"name":"table_name=","args":[{"name":"table_name","external_name":"table_name","restriction":"String"}],"visibility":"Public","body":"@table_name = table_name"}},{"html_id":"table_schema:String-instance-method","name":"table_schema","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L7"},"def":{"name":"table_schema","return_type":"String","visibility":"Public","body":"@table_schema"}},{"html_id":"table_schema=(table_schema:String)-instance-method","name":"table_schema=","abstract":false,"args":[{"name":"table_schema","external_name":"table_schema","restriction":"String"}],"args_string":"(table_schema : String)","args_html":"(table_schema : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L7"},"def":{"name":"table_schema=","args":[{"name":"table_schema","external_name":"table_schema","restriction":"String"}],"visibility":"Public","body":"@table_schema = table_schema"}},{"html_id":"table_type:String-instance-method","name":"table_type","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L9"},"def":{"name":"table_type","return_type":"String","visibility":"Public","body":"@table_type"}},{"html_id":"table_type=(table_type:String)-instance-method","name":"table_type=","abstract":false,"args":[{"name":"table_type","external_name":"table_type","restriction":"String"}],"args_string":"(table_type : String)","args_html":"(table_type : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L9"},"def":{"name":"table_type=","args":[{"name":"table_type","external_name":"table_type","restriction":"String"}],"visibility":"Public","body":"@table_type = table_type"}}]},{"html_id":"avram/Avram/Database/DatabaseCleaner","path":"Avram/Database/DatabaseCleaner.html","kind":"class","full_name":"Avram::Database::DatabaseCleaner","name":"DatabaseCleaner","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database.cr","line_number":253,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L253"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"new(database:Avram::Database)-class-method","name":"new","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"::Avram::Database"}],"args_string":"(database : Avram::Database)","args_html":"(database : Avram::Database)","location":{"filename":"src/avram/database.cr","line_number":257,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L257"},"def":{"name":"new","args":[{"name":"database","external_name":"database","restriction":"::Avram::Database"}],"visibility":"Public","body":"_ = allocate\n_.initialize(database)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"delete-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":277,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L277"},"def":{"name":"delete","visibility":"Public","body":"if table_names.empty?\n return\nend\ntable_names.each do |t|\n statement = (\"DELETE FROM #{t}\")\n database.exec(statement)\nend\n"}},{"html_id":"truncate(*,cascade:Bool=true,restart_identity:Bool=true)-instance-method","name":"truncate","abstract":false,"args":[{"name":"","external_name":"","restriction":""},{"name":"cascade","default_value":"true","external_name":"cascade","restriction":"Bool"},{"name":"restart_identity","default_value":"true","external_name":"restart_identity","restriction":"Bool"}],"args_string":"(*, cascade : Bool = true, restart_identity : Bool = true)","args_html":"(*, cascade : Bool = true, restart_identity : Bool = true)","location":{"filename":"src/avram/database.cr","line_number":266,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L266"},"def":{"name":"truncate","args":[{"name":"","external_name":"","restriction":""},{"name":"cascade","default_value":"true","external_name":"cascade","restriction":"Bool"},{"name":"restart_identity","default_value":"true","external_name":"restart_identity","restriction":"Bool"}],"splat_index":0,"visibility":"Public","body":"if table_names.empty?\n return\nend\ncascade_sql = cascade ? \" CASCADE\" : \"\"\nrestart_id_sql = restart_identity ? \" RESTART IDENTITY\" : \"\"\ntable_names_sql = table_names.join(\", \")\nsql = \"TRUNCATE TABLE #{table_names_sql}#{restart_id_sql}#{cascade_sql}\"\ndatabase.exec(sql)\n"}}]},{"html_id":"avram/Avram/Database/DatabaseInfo","path":"Avram/Database/DatabaseInfo.html","kind":"struct","full_name":"Avram::Database::DatabaseInfo","name":"DatabaseInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/database_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SQL_QUERY","name":"SQL_QUERY","value":"\" SELECT columns.table_name,\\n tables.table_type,\\n columns.table_schema,\\n columns.table_catalog,\\n columns.column_name,\\n columns.is_nullable,\\n columns.column_default,\\n columns.data_type\\n FROM information_schema.columns as columns\\n JOIN information_schema.tables as tables\\n ON tables.table_name = columns.table_name\\n AND tables.table_catalog = columns.table_catalog\\n AND tables.table_schema = columns.table_schema\\n WHERE columns.table_schema='public';\""}],"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"load(database:Avram::Database.class):DatabaseInfo-class-method","name":"load","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"Avram::Database.class"}],"args_string":"(database : Avram::Database.class) : DatabaseInfo","args_html":"(database : Avram::Database.class) : DatabaseInfo","location":{"filename":"src/avram/database/database_info.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L21"},"def":{"name":"load","args":[{"name":"database","external_name":"database","restriction":"Avram::Database.class"}],"return_type":"DatabaseInfo","visibility":"Public","body":"column_infos = database.query(SQL_QUERY) do |rs|\n ColumnInfo.from_rs(rs)\nend\ngrouped = column_infos.group_by(&.table)\ngrouped.each do |table, columns|\n columns.each do |c|\n table.columns << c\n end\nend\ntable_infos = grouped.keys\nnew(table_infos)\n"}},{"html_id":"new(table_infos:Array(Avram::Database::TableInfo))-class-method","name":"new","abstract":false,"args":[{"name":"table_infos","external_name":"table_infos","restriction":"::Array(::Avram::Database::TableInfo)"}],"args_string":"(table_infos : Array(Avram::Database::TableInfo))","args_html":"(table_infos : Array(Avram::Database::TableInfo))","location":{"filename":"src/avram/database/database_info.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L34"},"def":{"name":"new","args":[{"name":"table_infos","external_name":"table_infos","restriction":"::Array(::Avram::Database::TableInfo)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_infos)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"table(name:String):TableInfo|Nil-instance-method","name":"table","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : TableInfo | Nil","args_html":"(name : String) : TableInfo | Nil","location":{"filename":"src/avram/database/database_info.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L45"},"def":{"name":"table","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"TableInfo | ::Nil","visibility":"Public","body":"table_infos.find() do |__arg2|\n __arg2.table_name == name\nend"}},{"html_id":"table?(name:String):Bool-instance-method","name":"table?","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : Bool","args_html":"(name : String) : Bool","location":{"filename":"src/avram/database/database_info.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L37"},"def":{"name":"table?","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"Bool","visibility":"Public","body":"table_names.includes?(name)"}},{"html_id":"table_infos:Array(TableInfo)-instance-method","name":"table_infos","abstract":false,"location":{"filename":"src/avram/database/database_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L32"},"def":{"name":"table_infos","return_type":"Array(TableInfo)","visibility":"Public","body":"@table_infos"}},{"html_id":"table_infos=(table_infos:Array(TableInfo))-instance-method","name":"table_infos=","abstract":false,"args":[{"name":"table_infos","external_name":"table_infos","restriction":"Array(TableInfo)"}],"args_string":"(table_infos : Array(TableInfo))","args_html":"(table_infos : Array(TableInfo))","location":{"filename":"src/avram/database/database_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L32"},"def":{"name":"table_infos=","args":[{"name":"table_infos","external_name":"table_infos","restriction":"Array(TableInfo)"}],"visibility":"Public","body":"@table_infos = table_infos"}},{"html_id":"table_names:Array(String)-instance-method","name":"table_names","abstract":false,"location":{"filename":"src/avram/database/database_info.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L41"},"def":{"name":"table_names","return_type":"Array(String)","visibility":"Public","body":"table_infos.map(&.table_name)"}}]},{"html_id":"avram/Avram/Database/FiberId","path":"Avram/Database/FiberId.html","kind":"alias","full_name":"Avram::Database::FiberId","name":"FiberId","abstract":false,"locations":[{"filename":"src/avram/database.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"UInt64","aliased_html":"UInt64","const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"}},{"html_id":"avram/Avram/Database/TableInfo","path":"Avram/Database/TableInfo.html","kind":"struct","full_name":"Avram::Database::TableInfo","name":"TableInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/table_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"new(table_name:String,table_type:String,table_schema:String)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"::String"},{"name":"table_type","external_name":"table_type","restriction":"::String"},{"name":"table_schema","external_name":"table_schema","restriction":"::String"}],"args_string":"(table_name : String, table_type : String, table_schema : String)","args_html":"(table_name : String, table_type : String, table_schema : String)","location":{"filename":"src/avram/database/table_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L9"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"::String"},{"name":"table_type","external_name":"table_type","restriction":"::String"},{"name":"table_schema","external_name":"table_schema","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, table_type, table_schema)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column(name:String):ColumnInfo|Nil-instance-method","name":"column","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : ColumnInfo | Nil","args_html":"(name : String) : ColumnInfo | Nil","location":{"filename":"src/avram/database/table_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L32"},"def":{"name":"column","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"ColumnInfo | ::Nil","visibility":"Public","body":"columns.find() do |__arg1|\n __arg1.column_name == name\nend"}},{"html_id":"column?(name:String):Bool-instance-method","name":"column?","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : Bool","args_html":"(name : String) : Bool","location":{"filename":"src/avram/database/table_info.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L24"},"def":{"name":"column?","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"Bool","visibility":"Public","body":"column_names.includes?(name)"}},{"html_id":"column_names:Array(String)-instance-method","name":"column_names","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L28"},"def":{"name":"column_names","return_type":"Array(String)","visibility":"Public","body":"columns.map(&.column_name)"}},{"html_id":"columns:Array(Avram::Database::ColumnInfo)-instance-method","name":"columns","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L7"},"def":{"name":"columns","visibility":"Public","body":"@columns"}},{"html_id":"migrations_table?:Bool-instance-method","name":"migrations_table?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L36"},"def":{"name":"migrations_table?","return_type":"Bool","visibility":"Public","body":"table_name == \"migrations\""}},{"html_id":"table?:Bool-instance-method","name":"table?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L16"},"def":{"name":"table?","return_type":"Bool","visibility":"Public","body":"table_type == \"BASE TABLE\""}},{"html_id":"table_name:String-instance-method","name":"table_name","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L4"},"def":{"name":"table_name","return_type":"String","visibility":"Public","body":"@table_name"}},{"html_id":"table_schema:String-instance-method","name":"table_schema","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L6"},"def":{"name":"table_schema","return_type":"String","visibility":"Public","body":"@table_schema"}},{"html_id":"table_type:String-instance-method","name":"table_type","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L5"},"def":{"name":"table_type","return_type":"String","visibility":"Public","body":"@table_type"}},{"html_id":"view?:Bool-instance-method","name":"view?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L20"},"def":{"name":"view?","return_type":"Bool","visibility":"Public","body":"table_type == \"VIEW\""}}]}]},{"html_id":"avram/Avram/DatabaseValidations","path":"Avram/DatabaseValidations.html","kind":"module","full_name":"Avram::DatabaseValidations(T)","name":"DatabaseValidations","abstract":false,"locations":[{"filename":"src/avram/database_validations.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database_validations.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/DefineAttribute","path":"Avram/DefineAttribute.html","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute","abstract":false,"locations":[{"filename":"src/avram/define_attribute.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"attributes-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L34"},"def":{"name":"attributes","visibility":"Public","body":"[] of Avram::PermittedAttribute(Nil)"}}],"macros":[{"html_id":"attribute(type_declaration)-macro","name":"attribute","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/define_attribute.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L36"},"def":{"name":"attribute","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.type.is_a?(Union) %}\n {% if type_declaration.value.is_a?(Nop) %}\n {% default_value = \"\" %}\n {% else %}\n {% default_value = \"= #{type_declaration.value}\" %}\n {% end %}\n {% raise(\"`attribute` in #{@type} must not be called with a type union or nilable type but was called with #{type_declaration.type}\\nIf you were attempting to create a nilable attribute, all attributes are considered nilable by default.\\n\\nTry this...\\n\\n attribute #{type_declaration.var} : #{type_declaration.type.types.first} #{default_value.id}\\n\\nRead more on attributes: https://luckyframework.org/guides/database/validating-saving\") %}\n {% end %}\n\n\n \n{% ATTRIBUTES << type_declaration %}\n\n\n \n{% type = type_declaration.type %}\n\n \n{% name = type_declaration.var %}\n\n \n{% default_value = if type_declaration.value.is_a?(Nop)\n nil\nelse\n type_declaration.value\nend %}\n\n @_\n{{ name }}\n : Avram::Attribute(\n{{ type }}\n)?\n\n \nensure_base_attributes_method_is_present\n\n def attributes\n ([\n{{ name }}\n] + previous_def + super).uniq\n \nend\n\n def \n{{ name }}\n\n _\n{{ name }}\n.permitted\n \nend\n\n private def _\n{{ name }}\n\n @_\n{{ name }}\n ||= Avram::Attribute(\n{{ type }}\n).new(\n name: \n{{ name.id.symbolize }}\n,\n value: \n{{ default_value }}\n,\n param_key: self.class.param_key\n ).tap do |attribute|\n attribute.extract(params)\n \nend\n \nend\n \n"}},{"html_id":"ensure_base_attributes_method_is_present-macro","name":"ensure_base_attributes_method_is_present","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L2"},"def":{"name":"ensure_base_attributes_method_is_present","visibility":"Public","body":" \n{% if !(@type.methods.map(&.name).includes?((:attributes).id)) %}\n def attributes\n [] of Avram::PermittedAttribute(Nil)\n end\n {% end %}\n\n \n"}},{"html_id":"file_attribute(key)-macro","name":"file_attribute","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/define_attribute.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L90"},"def":{"name":"file_attribute","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" \n{% if key.is_a?(SymbolLiteral) %}{% else %}\n {% raise(\"file_attribute must be declared with a Symbol\") %}\n {% end %}\n\n\n attribute \n{{ key.id }}\n : Avram::Uploadable\n \n"}},{"html_id":"inherit_attributes-macro","name":"inherit_attributes","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L18"},"def":{"name":"inherit_attributes","visibility":"Public","body":" \n\\{% if\n !@type.constant(:ATTRIBUTES) %}\n ATTRIBUTES = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n attribute in @type.ancestors.first.constant :ATTRIBUTES %}\n \n\\{% \nATTRIBUTES << attribute %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_attributes\n \nend\n \n"}}]},{"html_id":"avram/Avram/DeleteOperation","path":"Avram/DeleteOperation.html","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L34"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"T.name.underscore"}}],"instance_methods":[{"html_id":"after_delete(_record:T)-instance-method","name":"after_delete","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/delete_operation.cr","line_number":89,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L89"},"def":{"name":"after_delete","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"before_delete-instance-method","name":"before_delete","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L87"},"def":{"name":"before_delete","visibility":"Public","body":""}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"delete:Bool-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L38"},"def":{"name":"delete","return_type":"Bool","visibility":"Public","body":"before_delete\nif valid?\n result = delete_or_soft_delete(@record)\n @record = result\n after_delete(@record)\n publish_delete_success_event\n mark_as_deleted\nelse\n publish_delete_failed_event\n mark_as_failed\nend\n"}},{"html_id":"delete!-instance-method","name":"delete!","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":53,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L53"},"def":{"name":"delete!","visibility":"Public","body":"if delete\n @record\nelse\n raise(Avram::InvalidOperationError.new(operation: self))\nend"}},{"html_id":"deleted?:Bool-instance-method","name":"deleted?","doc":"Returns true if the operation has run and saved the record successfully","summary":"

Returns true if the operation has run and saved the record successfully

","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L78"},"def":{"name":"deleted?","return_type":"Bool","visibility":"Public","body":"delete_status == OperationStatus::Deleted"}},{"html_id":"mark_as_deleted:Bool-instance-method","name":"mark_as_deleted","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L72"},"def":{"name":"mark_as_deleted","return_type":"Bool","visibility":"Public","body":"self.delete_status = OperationStatus::Deleted\ntrue\n"}},{"html_id":"mark_as_failed:Bool-instance-method","name":"mark_as_failed","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L82"},"def":{"name":"mark_as_failed","return_type":"Bool","visibility":"Public","body":"self.delete_status = OperationStatus::DeleteFailed\nfalse\n"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L67"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}}],"types":[{"html_id":"avram/Avram/DeleteOperation/OperationStatus","path":"Avram/DeleteOperation/OperationStatus.html","kind":"enum","full_name":"Avram::DeleteOperation::OperationStatus","name":"OperationStatus","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L19"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Deleted","name":"Deleted","value":"0"},{"id":"DeleteFailed","name":"DeleteFailed","value":"1"},{"id":"Unperformed","name":"Unperformed","value":"2"}],"namespace":{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},"instance_methods":[{"html_id":"delete_failed?-instance-method","name":"delete_failed?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L21"},"def":{"name":"delete_failed?","visibility":"Public","body":"self == DeleteFailed"}},{"html_id":"deleted?-instance-method","name":"deleted?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L20"},"def":{"name":"deleted?","visibility":"Public","body":"self == Deleted"}},{"html_id":"unperformed?-instance-method","name":"unperformed?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L22"},"def":{"name":"unperformed?","visibility":"Public","body":"self == Unperformed"}}]}]},{"html_id":"avram/Avram/DeleteOperationTemplate","path":"Avram/DeleteOperationTemplate.html","kind":"class","full_name":"Avram::DeleteOperationTemplate","name":"DeleteOperationTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, *args, **named_args)","args_html":"(type, columns, *args, **named_args)","location":{"filename":"src/avram/delete_operation_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":2,"visibility":"Public","body":" def delete_operation_class : ::\n{{ type }}\n::DeleteOperation.class\n ::\n{{ type }}\n::DeleteOperation\n \nend\n\n class ::\n{{ type }}\n::DeleteOperation < Avram::DeleteOperation(\n{{ type }}\n)\n\n add_column_attributes(\n{{ columns }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/Events","path":"Avram/Events.html","kind":"module","full_name":"Avram::Events","name":"Events","abstract":false,"locations":[{"filename":"src/avram/events/delete_failed_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Events/DeleteFailedEvent","path":"Avram/Events/DeleteFailedEvent.html","kind":"class","full_name":"Avram::Events::DeleteFailedEvent","name":"DeleteFailedEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/delete_failed_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,errors:Hash(Symbol,Array(String)))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Hash(Symbol, Array(String))"}],"args_string":"(operation_class : String, errors : Hash(Symbol, Array(String)))","args_html":"(operation_class : String, errors : Hash(Symbol, Array(String)))","location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Hash(Symbol, Array(String))"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, errors)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"error_messages_as_string-instance-method","name":"error_messages_as_string","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L10"},"def":{"name":"error_messages_as_string","visibility":"Public","body":"String.build do |msg|\n errors.each do |key, messages|\n msg << \"#{key} #{messages.join(\", \")}\"\n end\nend"}},{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L2"},"def":{"name":"errors","visibility":"Public","body":"@errors"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/DeleteSuccessEvent","path":"Avram/Events/DeleteSuccessEvent.html","kind":"class","full_name":"Avram::Events::DeleteSuccessEvent","name":"DeleteSuccessEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/delete_success_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_success_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String)-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"}],"args_string":"(operation_class : String)","args_html":"(operation_class : String)","location":{"filename":"src/avram/events/delete_success_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_success_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/delete_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_success_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/FailedQueryEvent","path":"Avram/Events/FailedQueryEvent.html","kind":"class","full_name":"Avram::Events::FailedQueryEvent","name":"FailedQueryEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/failed_query_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(error_message:String,query:String,args:String|Nil,queryable:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"error_message","external_name":"error_message","restriction":"String"},{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(error_message : String, query : String, args : String | Nil, queryable : String | Nil = nil)","args_html":"(error_message : String, query : String, args : String | Nil, queryable : String | Nil = nil)","location":{"filename":"src/avram/events/failed_query_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L4"},"def":{"name":"new","args":[{"name":"error_message","external_name":"error_message","restriction":"String"},{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(error_message, query, args, queryable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:String?-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"args","visibility":"Public","body":"@args"}},{"html_id":"error_message:String-instance-method","name":"error_message","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"error_message","visibility":"Public","body":"@error_message"}},{"html_id":"query:String-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"query","visibility":"Public","body":"@query"}},{"html_id":"queryable:String?-instance-method","name":"queryable","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"queryable","visibility":"Public","body":"@queryable"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/QueryEvent","path":"Avram/Events/QueryEvent.html","kind":"class","full_name":"Avram::Events::QueryEvent","name":"QueryEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/TimedEvent","kind":"class","full_name":"Pulsar::TimedEvent","name":"TimedEvent"},"ancestors":[{"html_id":"avram/Pulsar/TimedEvent","kind":"class","full_name":"Pulsar::TimedEvent","name":"TimedEvent"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/query_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(query:String,args:String|Nil,queryable:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query : String, args : String | Nil, queryable : String | Nil = nil)","args_html":"(query : String, args : String | Nil, queryable : String | Nil = nil)","location":{"filename":"src/avram/events/query_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L4"},"def":{"name":"new","args":[{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(query, args, queryable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:String?-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L2"},"def":{"name":"args","visibility":"Public","body":"@args"}},{"html_id":"query:String-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L2"},"def":{"name":"query","visibility":"Public","body":"@query"}},{"html_id":"queryable:String?-instance-method","name":"queryable","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L2"},"def":{"name":"queryable","visibility":"Public","body":"@queryable"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/SaveFailedEvent","path":"Avram/Events/SaveFailedEvent.html","kind":"class","full_name":"Avram::Events::SaveFailedEvent","name":"SaveFailedEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/save_failed_event.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,attributes:Array(Avram::GenericAttribute))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"args_string":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","args_html":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","location":{"filename":"src/avram/events/save_failed_event.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L7"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, attributes)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attributes:Array(Avram::GenericAttribute)-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L5"},"def":{"name":"attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"@attributes"}},{"html_id":"error_messages_as_string:String-instance-method","name":"error_messages_as_string","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L17"},"def":{"name":"error_messages_as_string","return_type":"String","visibility":"Public","body":"invalid_attributes.join(\". \") do |attribute|\n \"#{attribute.name} #{attribute.errors.join(\", \")}\"\nend"}},{"html_id":"invalid_attributes:Array(Avram::GenericAttribute)-instance-method","name":"invalid_attributes","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L13"},"def":{"name":"invalid_attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"attributes.reject(&.valid?)"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L4"},"def":{"name":"operation_class","return_type":"String","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/SaveSuccessEvent","path":"Avram/Events/SaveSuccessEvent.html","kind":"class","full_name":"Avram::Events::SaveSuccessEvent","name":"SaveSuccessEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/save_success_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_success_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,attributes:Array(Avram::GenericAttribute))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"args_string":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","args_html":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","location":{"filename":"src/avram/events/save_success_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_success_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, attributes)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attributes:Array(Avram::GenericAttribute)-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/events/save_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_success_event.cr#L2"},"def":{"name":"attributes","visibility":"Public","body":"@attributes"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/save_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_success_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]}]},{"html_id":"avram/Avram/ExtractCriteria","path":"Avram/ExtractCriteria.html","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/extract_criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria_extensions/extract_criteria.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Factory","path":"Avram/Factory.html","kind":"class","full_name":"Avram::Factory","name":"Factory","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/factory.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SEQUENCES","name":"SEQUENCES","value":"{} of String => Int32"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"build_attributes(&)-class-method","name":"build_attributes","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L66"},"def":{"name":"build_attributes","yields":1,"block_arity":1,"visibility":"Public","body":"(yield(new)).attributes"}},{"html_id":"build_attributes-class-method","name":"build_attributes","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L70"},"def":{"name":"build_attributes","visibility":"Public","body":"new.attributes"}},{"html_id":"create-class-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L74"},"def":{"name":"create","visibility":"Public","body":"new.create"}},{"html_id":"create(&)-class-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L78"},"def":{"name":"create","yields":1,"block_arity":1,"visibility":"Public","body":"(yield(new)).create"}},{"html_id":"create_pair-class-method","name":"create_pair","doc":"Returns an array with 2 instances of the model from the Factory.\n\nUsage:\n\n```\ntags = TagFactory.create_pair\ntypeof(tags) # => Array(Tag)\ntags.size # => 2\n```","summary":"

Returns an array with 2 instances of the model from the Factory.

","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L97"},"def":{"name":"create_pair","visibility":"Public","body":"create_pair do |factory|\n factory\nend"}},{"html_id":"create_pair(&)-class-method","name":"create_pair","doc":"Similar to `create_pair`, but accepts a block which yields the factory instance.\n\nBoth factories receive the same argument values.\n\nUsage:\n\n```\nTagFactory.create_pair do |factory|\n # set both factories name to \"test\"\n factory.name(\"test\")\nend\n```","summary":"

Similar to .create_pair, but accepts a block which yields the factory instance.

","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":113,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L113"},"def":{"name":"create_pair","yields":1,"block_arity":1,"visibility":"Public","body":"[1, 2].map do |n|\n self.create do |factory|\n yield(factory)\n end\nend"}}],"instance_methods":[{"html_id":"create-instance-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L82"},"def":{"name":"create","visibility":"Public","body":"run_before_save_callbacks\nrecord = operation.save!\nrun_after_save_callbacks(record)\n"}},{"html_id":"operation-instance-method","name":"operation","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L2"},"def":{"name":"operation","visibility":"Public","body":"@operation"}},{"html_id":"sequence(value:String):String-instance-method","name":"sequence","doc":"Returns a value with a number to use for unique values.\n\nUsage:\n\n```\nclass UserFactory < Avram::Factory\n def initialize\n username sequence(\"username\") # => username-1, username-2, etc.\n email \"#{sequence(\"email\")}@example.com\" # => email-1@example.com, email-2@example.com, etc.\n end\nend\n```","summary":"

Returns a value with a number to use for unique values.

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/factory.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L131"},"def":{"name":"sequence","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"__temp_91 = value\n__temp_92 = SEQUENCES\n__temp_92[__temp_91]? || (__temp_92[__temp_91] = 0)\n__temp_93 = value\n__temp_94 = SEQUENCES\n__temp_94[__temp_93] = __temp_94[__temp_93] + 1\n\"#{value}-#{SEQUENCES[value]}\"\n"}}],"macros":[{"html_id":"setup_attribute_shortcuts(operation)-macro","name":"setup_attribute_shortcuts","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/factory.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L20"},"def":{"name":"setup_attribute_shortcuts","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":" \n{% for attribute in operation.resolve.constant(:COLUMN_ATTRIBUTES) %}\n def {{ attribute[:name] }}(value : {{ attribute[:type] }}{% if attribute[:nilable] %}?{% end %})\n operation.{{ attribute[:name] }}.value = value\n self\n end\n {% end %}\n\n \n"}},{"html_id":"setup_attributes(operation)-macro","name":"setup_attributes","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/factory.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L29"},"def":{"name":"setup_attributes","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":" def attributes\n \n{\n \n{% for attribute in operation.resolve.constant(:COLUMN_ATTRIBUTES) %}\n {{ attribute[:name] }}: operation.{{ attribute[:name] }}.value,\n {% end %}\n\n }\n \nend\n \n"}},{"html_id":"setup_callbacks(model_name)-macro","name":"setup_callbacks","abstract":false,"args":[{"name":"model_name","external_name":"model_name","restriction":""}],"args_string":"(model_name)","args_html":"(model_name)","location":{"filename":"src/avram/factory.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L39"},"def":{"name":"setup_callbacks","args":[{"name":"model_name","external_name":"model_name","restriction":""}],"visibility":"Public","body":" \n# Run `block` before the record is created\n\n def before_save(&block : -> Nil) : self\n @before_saves << block\n\n self\n \nend\n\n \n# Run `block` after the record is created.\n\n \n# The block will yield the created record instance\n\n def after_save(&block : \n{{ model_name.id }}\n -> Nil) : self\n @after_saves << block\n\n self\n \nend\n\n private def run_before_save_callbacks\n @before_saves.each(&.call)\n \nend\n\n private def run_after_save_callbacks(record : \n{{ model_name.id }}\n)\n @after_saves.each(&.call(record))\n\n record\n \nend\n \n"}}]},{"html_id":"avram/Avram/FailedMigration","path":"Avram/FailedMigration.html","kind":"class","full_name":"Avram::FailedMigration","name":"FailedMigration","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":160,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L160"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(migration:String,statements:Array(String),cause:Exception)-class-method","name":"new","abstract":false,"args":[{"name":"migration","external_name":"migration","restriction":"String"},{"name":"statements","external_name":"statements","restriction":"Array(String)"},{"name":"cause","external_name":"cause","restriction":"Exception"}],"args_string":"(migration : String, statements : Array(String), cause : Exception)","args_html":"(migration : String, statements : Array(String), cause : Exception)","location":{"filename":"src/avram/errors.cr","line_number":164,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L164"},"def":{"name":"new","args":[{"name":"migration","external_name":"migration","restriction":"String"},{"name":"statements","external_name":"statements","restriction":"Array(String)"},{"name":"cause","external_name":"cause","restriction":"Exception"}],"visibility":"Public","body":"_ = allocate\n_.initialize(migration, statements, cause)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"migration:String-instance-method","name":"migration","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":161,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L161"},"def":{"name":"migration","return_type":"String","visibility":"Public","body":"@migration"}},{"html_id":"statements:Array(String)-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L162"},"def":{"name":"statements","return_type":"Array(String)","visibility":"Public","body":"@statements"}}]},{"html_id":"avram/Avram/FailedOperation","path":"Avram/FailedOperation.html","kind":"class","full_name":"Avram::FailedOperation","name":"FailedOperation","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":157,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L157"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Used when `Avram::Operation` fails.","summary":"

Used when Avram::Operation fails.

"},{"html_id":"avram/Avram/GenericAttribute","path":"Avram/GenericAttribute.html","kind":"class","full_name":"Avram::GenericAttribute","name":"GenericAttribute","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/generic_attribute.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"A generic version of `Avram::Attribute` that is used for reporting and metrics.\n\nThis is a data only version of an `Avram::Atribute`. It is purely for\nretrieving and reporting on data. For example, `Avram::GenericAttribute` is\nused by `Avram::Events::SaveFailedEvent` so that subscribers can\nget information about attributes that failed to save.","summary":"

A generic version of Avram::Attribute that is used for reporting and metrics.

","constructors":[{"html_id":"new(name:Symbol,param:String|Nil,original_value:String|Nil,value:String|Nil,param_key:String,errors:Array(String))-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"Symbol"},{"name":"param","external_name":"param","restriction":"String | ::Nil"},{"name":"original_value","external_name":"original_value","restriction":"String | ::Nil"},{"name":"value","external_name":"value","restriction":"String | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Array(String)"}],"args_string":"(name : Symbol, param : String | Nil, original_value : String | Nil, value : String | Nil, param_key : String, errors : Array(String))","args_html":"(name : Symbol, param : String | Nil, original_value : String | Nil, value : String | Nil, param_key : String, errors : Array(String))","location":{"filename":"src/avram/generic_attribute.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L15"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"Symbol"},{"name":"param","external_name":"param","restriction":"String | ::Nil"},{"name":"original_value","external_name":"original_value","restriction":"String | ::Nil"},{"name":"value","external_name":"value","restriction":"String | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Array(String)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, param, original_value, value, param_key, errors)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"errors:Array(String)-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L13"},"def":{"name":"errors","return_type":"Array(String)","visibility":"Public","body":"@errors"}},{"html_id":"name:Symbol-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L8"},"def":{"name":"name","return_type":"Symbol","visibility":"Public","body":"@name"}},{"html_id":"original_value:String|Nil-instance-method","name":"original_value","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L10"},"def":{"name":"original_value","return_type":"String | ::Nil","visibility":"Public","body":"@original_value"}},{"html_id":"param:String|Nil-instance-method","name":"param","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L9"},"def":{"name":"param","return_type":"String | ::Nil","visibility":"Public","body":"@param"}},{"html_id":"param_key:String-instance-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L12"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"@param_key"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L25"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"errors.empty?"}},{"html_id":"value:String|Nil-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L11"},"def":{"name":"value","return_type":"String | ::Nil","visibility":"Public","body":"@value"}}]},{"html_id":"avram/Avram/HabitatSettings","path":"Avram/HabitatSettings.html","kind":"class","full_name":"Avram::HabitatSettings","name":"HabitatSettings","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"database_to_migrate:Avram::Database.class-class-method","name":"database_to_migrate","abstract":false,"def":{"name":"database_to_migrate","return_type":"Avram::Database.class","visibility":"Public","body":"@@database_to_migrate.not_nil!"}},{"html_id":"database_to_migrate=(value:Avram::Database.class)-class-method","name":"database_to_migrate=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::Database.class"}],"args_string":"(value : Avram::Database.class)","args_html":"(value : Avram::Database.class)","def":{"name":"database_to_migrate=","args":[{"name":"value","external_name":"value","restriction":"Avram::Database.class"}],"visibility":"Public","body":"@@database_to_migrate = value"}},{"html_id":"database_to_migrate?-class-method","name":"database_to_migrate?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use database_to_migrate in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use database_to_migrate in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"database_to_migrate?","visibility":"Public","body":"@@database_to_migrate"}},{"html_id":"i18n_backend:Avram::I18nBackend-class-method","name":"i18n_backend","abstract":false,"def":{"name":"i18n_backend","return_type":"Avram::I18nBackend","visibility":"Public","body":"@@i18n_backend.not_nil!"}},{"html_id":"i18n_backend=(value:Avram::I18nBackend)-class-method","name":"i18n_backend=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::I18nBackend"}],"args_string":"(value : Avram::I18nBackend)","args_html":"(value : Avram::I18nBackend)","def":{"name":"i18n_backend=","args":[{"name":"value","external_name":"value","restriction":"Avram::I18nBackend"}],"visibility":"Public","body":"@@i18n_backend = value"}},{"html_id":"i18n_backend?-class-method","name":"i18n_backend?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use i18n_backend in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use i18n_backend in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"i18n_backend?","visibility":"Public","body":"@@i18n_backend"}},{"html_id":"lazy_load_enabled:Bool-class-method","name":"lazy_load_enabled","abstract":false,"def":{"name":"lazy_load_enabled","return_type":"Bool","visibility":"Public","body":"@@lazy_load_enabled.not_nil!"}},{"html_id":"lazy_load_enabled=(value:Bool)-class-method","name":"lazy_load_enabled=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","def":{"name":"lazy_load_enabled=","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"@@lazy_load_enabled = value"}},{"html_id":"lazy_load_enabled?-class-method","name":"lazy_load_enabled?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use lazy_load_enabled in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use lazy_load_enabled in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"lazy_load_enabled?","visibility":"Public","body":"@@lazy_load_enabled"}},{"html_id":"query_cache_enabled:Bool-class-method","name":"query_cache_enabled","abstract":false,"def":{"name":"query_cache_enabled","return_type":"Bool","visibility":"Public","body":"@@query_cache_enabled.not_nil!"}},{"html_id":"query_cache_enabled=(value:Bool)-class-method","name":"query_cache_enabled=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","def":{"name":"query_cache_enabled=","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"@@query_cache_enabled = value"}},{"html_id":"query_cache_enabled?-class-method","name":"query_cache_enabled?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use query_cache_enabled in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use query_cache_enabled in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"query_cache_enabled?","visibility":"Public","body":"@@query_cache_enabled"}},{"html_id":"time_formats:Array(String)-class-method","name":"time_formats","abstract":false,"def":{"name":"time_formats","return_type":"Array(String)","visibility":"Public","body":"@@time_formats.not_nil!"}},{"html_id":"time_formats=(value:Array(String))-class-method","name":"time_formats=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Array(String)"}],"args_string":"(value : Array(String))","args_html":"(value : Array(String))","def":{"name":"time_formats=","args":[{"name":"value","external_name":"value","restriction":"Array(String)"}],"visibility":"Public","body":"@@time_formats = value"}},{"html_id":"time_formats?-class-method","name":"time_formats?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use time_formats in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use time_formats in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"time_formats?","visibility":"Public","body":"@@time_formats"}},{"html_id":"to_h-class-method","name":"to_h","doc":"Generates a hash using the provided values","summary":"

Generates a hash using the provided values

","abstract":false,"def":{"name":"to_h","visibility":"Public","body":"{\"lazy_load_enabled\" => lazy_load_enabled, \"database_to_migrate\" => database_to_migrate, \"time_formats\" => time_formats, \"i18n_backend\" => i18n_backend, \"query_cache_enabled\" => query_cache_enabled}"}}]},{"html_id":"avram/Avram/I18n","path":"Avram/I18n.html","kind":"struct","full_name":"Avram::I18n","name":"I18n","abstract":false,"superclass":{"html_id":"avram/Avram/I18nBackend","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend"},"ancestors":[{"html_id":"avram/Avram/I18nBackend","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/i18n_backend.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L5"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"get(key:String|Symbol):String-instance-method","name":"get","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"args_string":"(key : String | Symbol) : String","args_html":"(key : String | Symbol) : String","location":{"filename":"src/avram/i18n_backend.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L6"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"return_type":"String","visibility":"Public","body":"{validate_acceptance_of: \"must be accepted\", validate_at_most_one_filled: \"must be blank\", validate_confirmation_of: \"must match\", validate_exact_size_of: \"must be exactly %d characters long\", validate_exactly_one_filled: \"at least one must be filled\", validate_format_of: \"is invalid\", validate_inclusion_of: \"is not included in the list\", validate_max_size_of: \"must not have more than %d characters\", validate_min_size_of: \"must have at least %d characters\", validate_numeric_max: \"must be no more than %s\", validate_numeric_min: \"must be at least %s\", validate_numeric_nil: \"must not be nil\", validate_required: \"is required\", validate_uniqueness_of: \"is already taken\"}[key]"}}]},{"html_id":"avram/Avram/I18nBackend","path":"Avram/I18nBackend.html","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend","abstract":true,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/I18n","kind":"struct","full_name":"Avram::I18n","name":"I18n"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L1"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"get(key:String|Symbol):String-instance-method","name":"get","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"args_string":"(key : String | Symbol) : String","args_html":"(key : String | Symbol) : String","location":{"filename":"src/avram/i18n_backend.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L2"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"return_type":"String","visibility":"Public","body":""}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L1"},"def":{"name":"initialize","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/ImpossibleValidation","path":"Avram/ImpossibleValidation.html","kind":"class","full_name":"Avram::ImpossibleValidation","name":"ImpossibleValidation","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L50"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when a validation is expecting an impossible constraint","summary":"

Raised when a validation is expecting an impossible constraint

","constructors":[{"html_id":"new(attribute:Symbol,message:String=\"animpossiblevalidation\")-class-method","name":"new","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Symbol"},{"name":"message","default_value":"\"an impossible validation\"","external_name":"message","restriction":"String"}],"args_string":"(attribute : Symbol, message : String = \"an impossible validation\")","args_html":"(attribute : Symbol, message : String = "an impossible validation")","location":{"filename":"src/avram/errors.cr","line_number":53,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L53"},"def":{"name":"new","args":[{"name":"attribute","external_name":"attribute","restriction":"Symbol"},{"name":"message","default_value":"\"an impossible validation\"","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(attribute, message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attribute:Symbol-instance-method","name":"attribute","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L51"},"def":{"name":"attribute","return_type":"Symbol","visibility":"Public","body":"@attribute"}}]},{"html_id":"avram/Avram/IncludesCriteria","path":"Avram/IncludesCriteria.html","kind":"module","full_name":"Avram::IncludesCriteria(T, V)","name":"IncludesCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/includes_criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria_extensions/includes_criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/String/Lucky/Criteria","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/UUID/Lucky/Criteria","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/InheritColumnAttributes","path":"Avram/InheritColumnAttributes.html","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes","abstract":false,"locations":[{"filename":"src/avram/inherit_column_attributes.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/inherit_column_attributes.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"inherit_column_attributes-macro","name":"inherit_column_attributes","abstract":false,"location":{"filename":"src/avram/inherit_column_attributes.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/inherit_column_attributes.cr#L8"},"def":{"name":"inherit_column_attributes","visibility":"Public","body":" \n\\{% if\n !@type.constant(:COLUMN_ATTRIBUTES) %}\n COLUMN_ATTRIBUTES = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n attribute in @type.ancestors.first.constant :COLUMN_ATTRIBUTES %}\n \n\\{% \nCOLUMN_ATTRIBUTES << attribute %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_column_attributes\n \nend\n \n"}}]},{"html_id":"avram/Avram/Insert","path":"Avram/Insert.html","kind":"class","full_name":"Avram::Insert","name":"Insert","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/insert.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(table:TableName,params:Params,column_names:Array(Symbol)=[]ofSymbol)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"params","external_name":"params","restriction":"Params"},{"name":"column_names","default_value":"[] of Symbol","external_name":"column_names","restriction":"Array(Symbol)"}],"args_string":"(table : TableName, params : Params, column_names : Array(Symbol) = [] of Symbol)","args_html":"(table : TableName, params : Params, column_names : Array(Symbol) = [] of Symbol)","location":{"filename":"src/avram/insert.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L4"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"params","external_name":"params","restriction":"Params"},{"name":"column_names","default_value":"[] of Symbol","external_name":"column_names","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, params, column_names)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/insert.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L19"},"def":{"name":"args","visibility":"Public","body":"@params.values"}},{"html_id":"statement:String-instance-method","name":"statement","abstract":false,"location":{"filename":"src/avram/insert.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L7"},"def":{"name":"statement","return_type":"String","visibility":"Public","body":"\"insert into #{@table}(#{fields}) values(#{values_placeholders}) returning #{returning}\""}}],"types":[{"html_id":"avram/Avram/Insert/Params","path":"Avram/Insert/Params.html","kind":"alias","full_name":"Avram::Insert::Params","name":"Params","abstract":false,"locations":[{"filename":"src/avram/insert.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Hash(Symbol, Nil) | Hash(Symbol, String | Nil) | Hash(Symbol, String))","aliased_html":"Hash(Symbol, Nil) | Hash(Symbol, String?) | Hash(Symbol, String)","const":false,"namespace":{"html_id":"avram/Avram/Insert","kind":"class","full_name":"Avram::Insert","name":"Insert"}}]},{"html_id":"avram/Avram/InvalidDatabaseNameError","path":"Avram/InvalidDatabaseNameError.html","kind":"class","full_name":"Avram::InvalidDatabaseNameError","name":"InvalidDatabaseNameError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":150,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L150"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/InvalidOperationError","path":"Avram/InvalidOperationError.html","kind":"class","full_name":"Avram::InvalidOperationError","name":"InvalidOperationError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Lucky/RenderableError","kind":"module","full_name":"Lucky::RenderableError","name":"RenderableError"},{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L59"},{"filename":"src/lucky/ext/avram/errors.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/RenderableError","kind":"module","full_name":"Lucky::RenderableError","name":"RenderableError"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when using the create!, update!, or delete! methods on an operation when it does not have the proper attributes","summary":"

Raised when using the create!, update!, or delete! methods on an operation when it does not have the proper attributes

","constructors":[{"html_id":"new(operation)-class-method","name":"new","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/errors.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L62"},"def":{"name":"new","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L60"},"def":{"name":"errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@errors"}},{"html_id":"invalid_attribute_name:String-instance-method","name":"invalid_attribute_name","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L17"},"def":{"name":"invalid_attribute_name","return_type":"String","visibility":"Public","body":"invalid_attribute[0].to_s"}},{"html_id":"renderable_details:String-instance-method","name":"renderable_details","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L13"},"def":{"name":"renderable_details","return_type":"String","visibility":"Public","body":"\"#{invalid_attribute_name} #{validation_messages.first}\""}},{"html_id":"renderable_message:String-instance-method","name":"renderable_message","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L9"},"def":{"name":"renderable_message","return_type":"String","visibility":"Public","body":"\"Invalid params\""}},{"html_id":"renderable_status:Int32-instance-method","name":"renderable_status","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L5"},"def":{"name":"renderable_status","return_type":"Int32","visibility":"Public","body":"400"}}]},{"html_id":"avram/Avram/InvalidQueryError","path":"Avram/InvalidQueryError.html","kind":"class","full_name":"Avram::InvalidQueryError","name":"InvalidQueryError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L153"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Join","path":"Avram/Join.html","kind":"module","full_name":"Avram::Join","name":"Join","abstract":false,"locations":[{"filename":"src/avram/join.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Join/Full","path":"Avram/Join/Full.html","kind":"class","full_name":"Avram::Join::Full","name":"Full","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L63"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L64"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"FULL\""}}]},{"html_id":"avram/Avram/Join/Inner","path":"Avram/Join/Inner.html","kind":"class","full_name":"Avram::Join::Inner","name":"Inner","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L46"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"INNER\""}}]},{"html_id":"avram/Avram/Join/Left","path":"Avram/Join/Left.html","kind":"class","full_name":"Avram::Join::Left","name":"Left","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L51"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L52"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"LEFT\""}}]},{"html_id":"avram/Avram/Join/Right","path":"Avram/Join/Right.html","kind":"class","full_name":"Avram::Join::Right","name":"Right","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L57"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L58"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"RIGHT\""}}]},{"html_id":"avram/Avram/Join/SqlClause","path":"Avram/Join/SqlClause.html","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Join/Full","kind":"class","full_name":"Avram::Join::Full","name":"Full"},{"html_id":"avram/Avram/Join/Inner","kind":"class","full_name":"Avram::Join::Inner","name":"Inner"},{"html_id":"avram/Avram/Join/Left","kind":"class","full_name":"Avram::Join::Left","name":"Left"},{"html_id":"avram/Avram/Join/Right","kind":"class","full_name":"Avram::Join::Right","name":"Right"}],"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"constructors":[{"html_id":"new(from:TableName,to:TableName,primary_key:Symbol|Nil=nil,foreign_key:Symbol|Nil=nil,comparison:String|Nil=\"=\",using:Array(Symbol)=[]ofSymbol)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"primary_key","default_value":"nil","external_name":"primary_key","restriction":"Symbol | ::Nil"},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":"Symbol | ::Nil"},{"name":"comparison","default_value":"\"=\"","external_name":"comparison","restriction":"String | ::Nil"},{"name":"using","default_value":"[] of Symbol","external_name":"using","restriction":"Array(Symbol)"}],"args_string":"(from : TableName, to : TableName, primary_key : Symbol | Nil = nil, foreign_key : Symbol | Nil = nil, comparison : String | Nil = \"=\", using : Array(Symbol) = [] of Symbol)","args_html":"(from : TableName, to : TableName, primary_key : Symbol | Nil = nil, foreign_key : Symbol | Nil = nil, comparison : String | Nil = "=", using : Array(Symbol) = [] of Symbol)","location":{"filename":"src/avram/join.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L8"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"primary_key","default_value":"nil","external_name":"primary_key","restriction":"Symbol | ::Nil"},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":"Symbol | ::Nil"},{"name":"comparison","default_value":"\"=\"","external_name":"comparison","restriction":"String | ::Nil"},{"name":"using","default_value":"[] of Symbol","external_name":"using","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, to, primary_key, foreign_key, comparison, using)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone:self-instance-method","name":"clone","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L40"},"def":{"name":"clone","return_type":"self","visibility":"Public","body":"self"}},{"html_id":"default_foreign_key:String-instance-method","name":"default_foreign_key","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L36"},"def":{"name":"default_foreign_key","return_type":"String","visibility":"Public","body":"(Wordsmith::Inflector.singularize(@from)) + \"_id\""}},{"html_id":"from:TableName-instance-method","name":"from","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L5"},"def":{"name":"from","return_type":"TableName","visibility":"Public","body":"@from"}},{"html_id":"from_column:String-instance-method","name":"from_column","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L28"},"def":{"name":"from_column","return_type":"String","visibility":"Public","body":"\"#{@from}.#{@primary_key || \"id\"}\""}},{"html_id":"join_type:String-instance-method","name":"join_type","abstract":true,"location":{"filename":"src/avram/join.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L18"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":""}},{"html_id":"to:TableName-instance-method","name":"to","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L6"},"def":{"name":"to","return_type":"TableName","visibility":"Public","body":"@to"}},{"html_id":"to_column:String-instance-method","name":"to_column","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L32"},"def":{"name":"to_column","return_type":"String","visibility":"Public","body":"\"#{@to}.#{@foreign_key || default_foreign_key}\""}},{"html_id":"to_sql:String-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L20"},"def":{"name":"to_sql","return_type":"String","visibility":"Public","body":"if !@using.empty?\n \"#{join_type} JOIN #{@to} USING (#{@using.join(\", \")})\"\nelse\n \"#{join_type} JOIN #{@to} ON #{from_column} #{@comparison} #{to_column}\"\nend"}}]}]},{"html_id":"avram/Avram/LazyLoadError","path":"Avram/LazyLoadError.html","kind":"class","full_name":"Avram::LazyLoadError","name":"LazyLoadError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L16"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when trying to access a record that was not preloaded and lazy load\nis disabled.","summary":"

Raised when trying to access a record that was not preloaded and lazy load is disabled.

","constructors":[{"html_id":"new(model:String,association:String)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"String"},{"name":"association","external_name":"association","restriction":"String"}],"args_string":"(model : String, association : String)","args_html":"(model : String, association : String)","location":{"filename":"src/avram/errors.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L20"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"String"},{"name":"association","external_name":"association","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, association)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"association:String-instance-method","name":"association","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L18"},"def":{"name":"association","return_type":"String","visibility":"Public","body":"@association"}},{"html_id":"model:String-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L17"},"def":{"name":"model","return_type":"String","visibility":"Public","body":"@model"}}]},{"html_id":"avram/Avram/MarkAsFailed","path":"Avram/MarkAsFailed.html","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed","abstract":false,"locations":[{"filename":"src/avram/mark_as_failed.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/mark_as_failed.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"mark_as_failed:Nil-instance-method","name":"mark_as_failed","abstract":false,"location":{"filename":"src/avram/mark_as_failed.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/mark_as_failed.cr#L2"},"def":{"name":"mark_as_failed","return_type":"Nil","visibility":"Public","body":"self.save_status = Avram::SaveOperation::OperationStatus::SaveFailed"}}]},{"html_id":"avram/Avram/Migrator","path":"Avram/Migrator.html","kind":"module","full_name":"Avram::Migrator","name":"Migrator","abstract":false,"locations":[{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L1"},{"filename":"src/avram/migrator/migrator.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migrator.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"run(&)-class-method","name":"run","abstract":false,"location":{"filename":"src/avram/migrator/migrator.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migrator.cr#L2"},"def":{"name":"run","yields":0,"block_arity":0,"visibility":"Public","body":"begin\n yield\nrescue e\n puts(e.inspect_with_backtrace)\n exit(1)\nend"}}],"types":[{"html_id":"avram/Avram/Migrator/AlterExtensionStatement","path":"Avram/Migrator/AlterExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::AlterExtensionStatement","name":"AlterExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,to:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"args_string":"(name : String, to : String | Nil = nil)","args_html":"(name : String, to : String | Nil = nil)","location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, to)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"String.build do |sql|\n sql << \"ALTER EXTENSION \\\"#{@name}\\\" UPDATE\"\n if @to\n sql << to_version\n end\n sql << \";\"\nend"}},{"html_id":"to_version-instance-method","name":"to_version","abstract":false,"location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L13"},"def":{"name":"to_version","visibility":"Public","body":"\" TO '#{@to}'\""}}]},{"html_id":"avram/Avram/Migrator/AlterTableStatement","path":"Avram/Migrator/AlterTableStatement.html","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L15"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_change_default_statement(column:Avram::Migrator::Columns::Base)-instance-method","name":"add_change_default_statement","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"args_string":"(column : Avram::Migrator::Columns::Base)","args_html":"(column : Avram::Migrator::Columns::Base)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L86"},"def":{"name":"add_change_default_statement","args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"visibility":"Public","body":"change_default_statements << (column.build_change_default_statement(@table_name))"}},{"html_id":"add_change_type_statement(column:Avram::Migrator::Columns::Base)-instance-method","name":"add_change_type_statement","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"args_string":"(column : Avram::Migrator::Columns::Base)","args_html":"(column : Avram::Migrator::Columns::Base)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L82"},"def":{"name":"add_change_type_statement","args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"visibility":"Public","body":"change_type_statements << (column.build_change_type_statement(@table_name))"}},{"html_id":"add_fill_existing_with_statements(column:Symbol|String,type,value,nilable)-instance-method","name":"add_fill_existing_with_statements","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol | String"},{"name":"type","external_name":"type","restriction":""},{"name":"value","external_name":"value","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""}],"args_string":"(column : Symbol | String, type, value, nilable)","args_html":"(column : Symbol | String, type, value, nilable)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L250"},"def":{"name":"add_fill_existing_with_statements","args":[{"name":"column","external_name":"column","restriction":"Symbol | String"},{"name":"type","external_name":"type","restriction":""},{"name":"value","external_name":"value","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""}],"visibility":"Public","body":"@fill_existing_with_statements << \"UPDATE #{@table_name} SET #{column} = #{value};\"\nif nilable\nelse\n @fill_existing_with_statements << \"ALTER TABLE #{@table_name} ALTER COLUMN #{column} SET NOT NULL;\"\nend\n"}},{"html_id":"alter_statements:Array(String)-instance-method","name":"alter_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":119,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L119"},"def":{"name":"alter_statements","return_type":"Array(String)","visibility":"Public","body":"alterations = renamed_rows.map do |statement|\n \"ALTER TABLE #{@table_name} #{statement};\"\nend\nif (rows + dropped_rows).empty?\nelse\n alterations << String.build do |statement|\n statement << \"ALTER TABLE #{@table_name}\"\n statement << \"\\n\"\n statement << ((rows + dropped_rows).join(\",\\n\"))\n statement << ';'\n end\nend\nalterations\n"}},{"html_id":"build(&)-instance-method","name":"build","doc":"Accepts a block to alter a table using the `add` method. The generated sql\nstatements are aggregated in the `statements` getter.\n\n## Usage\n\n```\nbuilt = Avram::Migrator::AlterTableStatement.new(:users).build do\n add name : String\n add age : Int32\n remove old_field\nend\n\nbuilt.statements\n# => [\n\"ALTER TABLE users\n ADD name text NOT NULL,\n ADD age int NOT NULL,\n DROP old_field\"\n]\n```","summary":"

Accepts a block to alter a table using the add method.

","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":110,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L110"},"def":{"name":"build","yields":0,"block_arity":0,"visibility":"Public","body":"with self yield\nself\n"}},{"html_id":"change_default_statements:Array(String)-instance-method","name":"change_default_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L13"},"def":{"name":"change_default_statements","visibility":"Public","body":"@change_default_statements"}},{"html_id":"change_type_statements:Array(String)-instance-method","name":"change_type_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L12"},"def":{"name":"change_type_statements","visibility":"Public","body":"@change_type_statements"}},{"html_id":"dropped_rows:Array(String)-instance-method","name":"dropped_rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L10"},"def":{"name":"dropped_rows","visibility":"Public","body":"@dropped_rows"}},{"html_id":"fill_existing_with_statements:Array(String)-instance-method","name":"fill_existing_with_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L11"},"def":{"name":"fill_existing_with_statements","visibility":"Public","body":"@fill_existing_with_statements"}},{"html_id":"renamed_rows:Array(String)-instance-method","name":"renamed_rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L9"},"def":{"name":"renamed_rows","visibility":"Public","body":"@renamed_rows"}},{"html_id":"rows:Array(String)-instance-method","name":"rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L8"},"def":{"name":"rows","visibility":"Public","body":"@rows"}},{"html_id":"statements-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":115,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L115"},"def":{"name":"statements","visibility":"Public","body":"(((alter_statements + change_default_statements) + change_type_statements) + index_statements) + fill_existing_with_statements"}}],"macros":[{"html_id":"add(type_declaration,index=false,using=:btree,unique=false,default=nil,fill_existing_with=nil,**type_options)-macro","name":"add","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""}],"args_string":"(type_declaration, index = false, using = :btree, unique = false, default = nil, fill_existing_with = nil, **type_options)","args_html":"(type_declaration, index = false, using = :btree, unique = false, default = nil, fill_existing_with = nil, **type_options)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":181,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L181"},"def":{"name":"add","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% type = type_declaration.type.resolve %}\n\n \n{% nilable = false %}\n\n \n{% array = false %}\n\n \n{% should_fill_existing = (!(fill_existing_with == nil)) && (fill_existing_with != (:nothing)) %}\n\n\n \n{% if type.nilable? %}\n {% type = type.union_types.reject(&.==(Nil)).first %}\n {% nilable = true %}\n {% end %}\n\n \n{% if type < Array %}\n {% type = type.type_vars.first %}\n {% array = true %}\n {% end %}\n\n\n \n{% if ((!nilable) && (default == nil)) && (fill_existing_with == nil) %}\n {% raise(\"\\nYou must provide a default value or use fill_existing_with when adding a required column to an existing table.\\n\\nTry one of these...\\n\\n ▸ add #{type_declaration}, default: \\\"Something\\\"\\n ▸ add #{type_declaration}, fill_existing_with: \\\"Something\\\"\\n ▸ add #{type_declaration}, fill_existing_with: :nothing\") %}\n {% end %}\n\n\n \n{% if (default != nil) && (fill_existing_with != nil) %}\n {% type_declaration.raise(\"\\nCannot use both 'default' and 'fill_existing_with' arguments for add(#{type_declaration}).\\n\\nTry this...\\n\\n ▸ Use `default` to set the default value, and backfill existing columns\\n ▸ Use `fill_existing_with` to backfill existing columns without a default value\") %}\n {% end %}\n\n\n rows << Avram::Migrator::Columns::\n{{ type }}\nColumn(\n \n{% if array %}Array({{ type }}){% else %}{{ type }}{% end %}\n\n ).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable || should_fill_existing }}\n,\n default: \n{{ default }}\n,\n \n{{ type_options.double_splat }}\n\n )\n \n{% if array %}\n .array!\n {% end %}\n\n .build_add_statement_for_alter\n\n \n{% if should_fill_existing %}\n add_fill_existing_with_statements(\n column: {{ type_declaration.var.stringify }},\n type: {{ type }},\n value: Avram::Migrator::Columns::{{ type }}Column.prepare_value_for_database({{ fill_existing_with }}),\n nilable: {{ nilable }}\n )\n {% end %}\n\n\n \n{% if index || unique %}\n add_index :{{ type_declaration.var }}, using: {{ using }}, unique: {{ unique }}\n {% end %}\n\n \n"}},{"html_id":"add_belongs_to(type_declaration,on_delete,references=nil,foreign_key_type=Int64,fill_existing_with=nil,unique=false)-macro","name":"add_belongs_to","doc":"Adds a references column and index given a model class and references option.","summary":"

Adds a references column and index given a model class and references option.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"args_string":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, fill_existing_with = nil, unique = false)","args_html":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, fill_existing_with = nil, unique = false)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L135"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.is_a?(TypeDeclaration) %}{% else %}\n {% raise(\"add_belongs_to expected a type declaration like 'user : User', instead got: '#{type_declaration}'\") %}\n {% end %}\n\n \n{% if (type_declaration.type.stringify =~ (/\\w::\\w/)) && references.nil? %}\n {% raise(\"Namespaced models must include the `references` option with the name of the table.\\n\\nTry this...\\n\\n ▸ add_belongs_to(#{type_declaration}, on_delete: #{on_delete}, references: :the_table_name)\") %}\n {% end %}\n\n \n{% optional = type_declaration.type.is_a?(Union) %}\n\n\n \n{% if optional %}\n {% underscored_class = type_declaration.type.types.first %}\n {% else %}\n {% underscored_class = type_declaration.type %}\n {% end %}\n\n \n{% underscored_class = underscored_class.stringify.underscore.gsub(/::/, \"_\") %}\n\n\n \n{% foreign_key_name = type_declaration.var + \"_id\" %}\n\n \n%table_name\n = \n{{ references }}\n || Wordsmith::Inflector.pluralize(\n{{ underscored_class }}\n)\n\n rows << ::Avram::Migrator::Columns::\n{{ foreign_key_type }}\nColumn(\n{{ foreign_key_type }}\n).new(\n name: \n{{ foreign_key_name.stringify }}\n,\n nilable: \n{{ optional }}\n,\n default: nil\n )\n .set_references(references: \n%table_name\n.to_s, on_delete: \n{{ on_delete }}\n)\n .build_add_statement_for_alter\n\n \n{% if (!(fill_existing_with == nil)) && (fill_existing_with != (:nothing)) %}\n add_fill_existing_with_statements(\n column: {{ foreign_key_name.stringify }},\n type: {{ foreign_key_type }},\n value: Avram::Migrator::Columns::{{ foreign_key_type }}Column.prepare_value_for_database({{ fill_existing_with }}),\n nilable: {{ optional }}\n )\n {% end %}\n\n\n add_index :\n{{ foreign_key_name }}\n, unique: \n{{ unique }}\n\n \n"}},{"html_id":"change_default(type_declaration,default)-macro","name":"change_default","doc":"Change the columns' default value to `default`\n```\nalter table_for(Post) do\n change_default published_at, default: :now\nend\n```","summary":"

Change the columns' default value to default alter table_for(Post) do change_default published_at, default: :now end

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(type_declaration, default)","args_html":"(type_declaration, default)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L68"},"def":{"name":"change_default","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":" \n{% if !type_declaration.is_a?(TypeDeclaration)\n raise(\"Must pass a type declaration to 'change_default'. Example: change_default count : Int32, default: 1\")\nend %}\n\n \n%column\n = ::Avram::Migrator::Columns::\n{{ type_declaration.type }}\nColumn(\n{{ type_declaration.type }}\n).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: false,\n default: \n{{ default }}\n\n )\n add_change_default_statement \n%column\n\n \n"}},{"html_id":"change_type(type_declaration,**type_options)-macro","name":"change_type","doc":"Change the column's type from whatever it is currently to\n`type_declaration.type`. The only exceptions are when changing\nfrom `text` to `citext` with `String` using `case_sensitive`, or changing to\na `Float64` column which requires setting the `precision`, and `scale`.\n```\nalter table_for(User) do\n change_type email : String, case_sensitive: false\nend\n```","summary":"

Change the column's type from whatever it is currently to type_declaration.type.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration, **type_options)","args_html":"(type_declaration, **type_options)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L27"},"def":{"name":"change_type","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% if !type_declaration.is_a?(TypeDeclaration)\n raise(\"Must pass a type declaration to 'change_type'. Example: change_type age : Int32\")\nelse\n if type_options.keys.includes?(\"default\".id)\n raise(\"Cannot change the default value from `change_type`. Use `change_default` instead.\")\n end\nend %}\n\n \n{% type = type_declaration.type.resolve\nnilable = false\nbytes = false\n %}\n\n \n{% if type.nilable?\n type = type.union_types.reject(&.==(Nil)).first\n nilable = true\nend %}\n\n \n{% if type < Slice\n type = \"Bytes\".id\n bytes = true\nend %}\n\n\n \n%column\n = ::Avram::Migrator::Columns::\n{{ type }}\nColumn(\n{{ type }}\n).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable }}\n,\n default: nil,\n \n{{ type_options.double_splat }}\n\n )\n add_change_type_statement \n%column\n\n \n"}},{"html_id":"remove(name)-macro","name":"remove","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name)","args_html":"(name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":294,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L294"},"def":{"name":"remove","args":[{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":" \n{% if name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"remove\", {{ name }})\n {% end %}\n\n dropped_rows << \" DROP #{\n{{ name }}\n}\"\n \n"}},{"html_id":"remove_belongs_to(association_name)-macro","name":"remove_belongs_to","abstract":false,"args":[{"name":"association_name","external_name":"association_name","restriction":""}],"args_string":"(association_name)","args_html":"(association_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":301,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L301"},"def":{"name":"remove_belongs_to","args":[{"name":"association_name","external_name":"association_name","restriction":""}],"visibility":"Public","body":" \n{% if association_name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"remove_belongs_to\", {{ name }})\n {% end %}\n\n remove \n{{ association_name }}\n_id\n \n"}},{"html_id":"rename(old_name,new_name)-macro","name":"rename","abstract":false,"args":[{"name":"old_name","external_name":"old_name","restriction":""},{"name":"new_name","external_name":"new_name","restriction":""}],"args_string":"(old_name, new_name)","args_html":"(old_name, new_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":276,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L276"},"def":{"name":"rename","args":[{"name":"old_name","external_name":"old_name","restriction":""},{"name":"new_name","external_name":"new_name","restriction":""}],"visibility":"Public","body":" \n{% for name in {old_name, new_name} %}\n {% if name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"rename\", {{ name }})\n {% end %}\n {% end %}\n\n renamed_rows << \"RENAME COLUMN #{\n{{ old_name }}\n} TO #{\n{{ new_name }}\n}\"\n \n"}},{"html_id":"rename_belongs_to(old_association_name,new_association_name)-macro","name":"rename_belongs_to","abstract":false,"args":[{"name":"old_association_name","external_name":"old_association_name","restriction":""},{"name":"new_association_name","external_name":"new_association_name","restriction":""}],"args_string":"(old_association_name, new_association_name)","args_html":"(old_association_name, new_association_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":285,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L285"},"def":{"name":"rename_belongs_to","args":[{"name":"old_association_name","external_name":"old_association_name","restriction":""},{"name":"new_association_name","external_name":"new_association_name","restriction":""}],"visibility":"Public","body":" \n{% for association_name in {old_association_name, new_association_name} %}\n {% if association_name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"rename_belongs_to\", {{ name }})\n {% end %}\n {% end %}\n\n rename \n{{ old_association_name }}\n_id, \n{{ new_association_name }}\n_id\n \n"}},{"html_id":"symbol_expected_error(action,name)-macro","name":"symbol_expected_error","abstract":false,"args":[{"name":"action","external_name":"action","restriction":""},{"name":"name","external_name":"name","restriction":""}],"args_string":"(action, name)","args_html":"(action, name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":255,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L255"},"def":{"name":"symbol_expected_error","args":[{"name":"action","external_name":"action","restriction":""},{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":" \n{% if name.is_a?(TypeDeclaration) %}\n {% example = name.var %}\n {% else %}\n {% example = name.id %}\n {% end %}\n\n\n \n{% raise(\"\\n#{action} expected a symbol like :#{example}, instead got: #{name}.\\n\\nin: #{name.filename}:#{name.line_number}:#{name.column_number}\\n\\nTry replacing...\\n\\n ▸ #{name} with :#{example}\") %}\n\n \n"}}]},{"html_id":"avram/Avram/Migrator/BuildReferenceFragment","path":"Avram/Migrator/BuildReferenceFragment.html","kind":"class","full_name":"Avram::Migrator::BuildReferenceFragment","name":"BuildReferenceFragment","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/build_reference_fragment.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(references:String|Symbol|Nil,on_delete:Symbol|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"::String | ::Symbol | ::Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"args_string":"(references : String | Symbol | Nil, on_delete : Symbol | Nil)","args_html":"(references : String | Symbol | Nil, on_delete : Symbol | Nil)","location":{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/build_reference_fragment.cr#L7"},"def":{"name":"new","args":[{"name":"references","external_name":"references","restriction":"::String | ::Symbol | ::Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(references, on_delete)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/build_reference_fragment.cr#L10"},"def":{"name":"build","visibility":"Public","body":"if on_delete == (:do_nothing)\n \" REFERENCES #{references}\"\nelse\n (\" REFERENCES #{references}\" + \" ON DELETE \") + on_delete_sql\nend"}}]},{"html_id":"avram/Avram/Migrator/ChangeNullStatement","path":"Avram/Migrator/ChangeNullStatement.html","kind":"class","full_name":"Avram::Migrator::ChangeNullStatement","name":"ChangeNullStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/change_null_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/change_null_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for changing a columns NOT NULL status.\n\n### Usage\n\n```\nChangeNullStatement.new(:users, :email, make: :optional).build\n# => \"ALTER TABLE users ALTER COLUMN email DROP NOT NULL;\"\n```","summary":"

Builds an SQL statement for changing a columns NOT NULL status.

","constructors":[{"html_id":"new(table:TableName,column:Symbol,required:Bool)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"required","external_name":"required","restriction":"Bool"}],"args_string":"(table : TableName, column : Symbol, required : Bool)","args_html":"(table : TableName, column : Symbol, required : Bool)","location":{"filename":"src/avram/migrator/change_null_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/change_null_statement.cr#L10"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"required","external_name":"required","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, column, required)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/change_null_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/change_null_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"if @required\n change = \"SET\"\nelse\n change = \"DROP\"\nend\nString.build do |index|\n index << \"ALTER TABLE #{@table}\"\n index << \" ALTER COLUMN #{@column}\"\n index << \" #{change} NOT NULL;\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/Columns","path":"Avram/Migrator/Columns.html","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L1"},{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bool_column.cr#L3"},{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bytes_column.cr#L3"},{"filename":"src/avram/migrator/columns/float_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L3"},{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int16_column.cr#L3"},{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int32_column.cr#L3"},{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int64_column.cr#L3"},{"filename":"src/avram/migrator/columns/string_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/string_column.cr#L3"},{"filename":"src/avram/migrator/columns/time_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L3"},{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/uuid_column.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"types":[{"html_id":"avram/Avram/Migrator/Columns/Base","path":"Avram/Migrator/Columns/Base.html","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/BoolColumn","kind":"class","full_name":"Avram::Migrator::Columns::BoolColumn(T)","name":"BoolColumn"},{"html_id":"avram/Avram/Migrator/Columns/BytesColumn","kind":"class","full_name":"Avram::Migrator::Columns::BytesColumn(T)","name":"BytesColumn"},{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn(T)","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Int16Column","kind":"class","full_name":"Avram::Migrator::Columns::Int16Column(T)","name":"Int16Column"},{"html_id":"avram/Avram/Migrator/Columns/Int32Column","kind":"class","full_name":"Avram::Migrator::Columns::Int32Column(T)","name":"Int32Column"},{"html_id":"avram/Avram/Migrator/Columns/Int64Column","kind":"class","full_name":"Avram::Migrator::Columns::Int64Column(T)","name":"Int64Column"},{"html_id":"avram/Avram/Migrator/Columns/JSON/AnyColumn","kind":"class","full_name":"Avram::Migrator::Columns::JSON::AnyColumn(T)","name":"AnyColumn"},{"html_id":"avram/Avram/Migrator/Columns/StringColumn","kind":"class","full_name":"Avram::Migrator::Columns::StringColumn(T)","name":"StringColumn"},{"html_id":"avram/Avram/Migrator/Columns/TimeColumn","kind":"class","full_name":"Avram::Migrator::Columns::TimeColumn(T)","name":"TimeColumn"},{"html_id":"avram/Avram/Migrator/Columns/UUIDColumn","kind":"class","full_name":"Avram::Migrator::Columns::UUIDColumn(T)","name":"UUIDColumn"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"class_methods":[{"html_id":"escape_literal(value)-class-method","name":"escape_literal","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L78"},"def":{"name":"escape_literal","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"PG::EscapeHelper.escape_literal(value)"}},{"html_id":"prepare_value_for_database(value:Array)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Array"}],"args_string":"(value : Array)","args_html":"(value : Array)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L74"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":"Array"}],"visibility":"Public","body":"escape_literal(PQ::Param.encode_array(value))"}},{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L70"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"escape_literal(value.to_s)"}}],"constructors":[{"html_id":"new(name)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name)","args_html":"(name)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"array!-instance-method","name":"array!","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L28"},"def":{"name":"array!","visibility":"Public","body":"@array = true\nself\n"}},{"html_id":"as_array_type:String-instance-method","name":"as_array_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L49"},"def":{"name":"as_array_type","return_type":"String","visibility":"Public","body":"@array ? \"[]\" : \"\""}},{"html_id":"build_add_statement_for_alter:String-instance-method","name":"build_add_statement_for_alter","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L41"},"def":{"name":"build_add_statement_for_alter","return_type":"String","visibility":"Public","body":"\" ADD \" + build_add_statement"}},{"html_id":"build_add_statement_for_create:String-instance-method","name":"build_add_statement_for_create","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L45"},"def":{"name":"build_add_statement_for_create","return_type":"String","visibility":"Public","body":"\" \" + build_add_statement"}},{"html_id":"build_change_default_statement(table_name:TableName):String-instance-method","name":"build_change_default_statement","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName) : String","args_html":"(table_name : TableName) : String","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L37"},"def":{"name":"build_change_default_statement","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"return_type":"String","visibility":"Public","body":"\"ALTER TABLE ONLY #{table_name} ALTER COLUMN #{name} SET#{default_fragment};\""}},{"html_id":"build_change_type_statement(table_name:TableName):String-instance-method","name":"build_change_type_statement","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName) : String","args_html":"(table_name : TableName) : String","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L33"},"def":{"name":"build_change_type_statement","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"return_type":"String","visibility":"Public","body":"\"ALTER TABLE #{table_name} ALTER COLUMN #{name} SET DATA TYPE #{column_type};\""}},{"html_id":"column_type:String-instance-method","name":"column_type","abstract":true,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L64"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":""}},{"html_id":"set_references(references:String,on_delete:Symbol)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"String"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"}],"args_string":"(references : String, on_delete : Symbol)","args_html":"(references : String, on_delete : Symbol)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L16"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"String"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\nself\n"}},{"html_id":"set_references(references:Nil,on_delete:Nil)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"Nil"}],"args_string":"(references : Nil, on_delete : Nil)","args_html":"(references : Nil, on_delete : Nil)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L20"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"Nil"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\nself\n"}},{"html_id":"set_references(references:Nil|String,on_delete:Symbol|Nil)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"::Nil | ::String"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"args_string":"(references : Nil | String, on_delete : Symbol | Nil)","args_html":"(references : Nil | String, on_delete : Symbol | Nil)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L24"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"::Nil | ::String"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\n{% raise(\"When setting a reference you must set the reference table and the 'on_delete' option.\") %}\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/BoolColumn","path":"Avram/Migrator/Columns/BoolColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::BoolColumn(T)","name":"BoolColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bool_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bool_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = BoolColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bool_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"boolean\""}}]},{"html_id":"avram/Avram/Migrator/Columns/BytesColumn","path":"Avram/Migrator/Columns/BytesColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::BytesColumn(T)","name":"BytesColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bytes_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Slice(UInt8)|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Slice(::UInt8) | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Slice(UInt8) | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Slice(UInt8) | T | Nil)","location":{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bytes_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Slice(::UInt8) | T | ::Nil"}],"visibility":"Public","body":"_ = BytesColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bytes_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bytea\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Float32Column","path":"Avram/Migrator/Columns/Float32Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Float32Column(T)","name":"Float32Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name,nilable,default,precision,scale)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"args_string":"(name, nilable, default, precision, scale)","args_html":"(name, nilable, default, precision, scale)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"visibility":"Public","body":"_ = Float32Column(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name,nilable,default)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(name, nilable, default)","args_html":"(name, nilable, default)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":"_ = Float32Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/Float64Column","path":"Avram/Migrator/Columns/Float64Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Float64Column(T)","name":"Float64Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L29"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name,nilable,default,precision,scale)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"args_string":"(name, nilable, default, precision, scale)","args_html":"(name, nilable, default, precision, scale)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"visibility":"Public","body":"_ = Float64Column(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name,nilable,default)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(name, nilable, default)","args_html":"(name, nilable, default)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":"_ = Float64Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","path":"Avram/Migrator/Columns/FloatColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn(T)","name":"FloatColumn","abstract":true,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/Float32Column","kind":"class","full_name":"Avram::Migrator::Columns::Float32Column(T)","name":"Float32Column"},{"html_id":"avram/Avram/Migrator/Columns/Float64Column","kind":"class","full_name":"Avram::Migrator::Columns::Float64Column(T)","name":"Float64Column"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Float32|T|Nil,precision:Int32|Nil,scale:Int32|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"},{"name":"precision","external_name":"precision","restriction":"::Int32 | ::Nil"},{"name":"scale","external_name":"scale","restriction":"::Int32 | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil, precision : Int32 | Nil, scale : Int32 | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil, precision : Int32 | Nil, scale : Int32 | Nil)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"},{"name":"precision","external_name":"precision","restriction":"::Int32 | ::Nil"},{"name":"scale","external_name":"scale","restriction":"::Int32 | ::Nil"}],"visibility":"Public","body":"_ = FloatColumn(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name:String,nilable:Bool|Nil,default:Float32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"}],"visibility":"Public","body":"_ = FloatColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L17"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"if precision && scale\n \"decimal(#{precision},#{scale})\"\nelse\n \"decimal\"\nend"}}]},{"html_id":"avram/Avram/Migrator/Columns/Int16Column","path":"Avram/Migrator/Columns/Int16Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int16Column(T)","name":"Int16Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int16_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Int32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int16_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"visibility":"Public","body":"_ = Int16Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int16_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"smallint\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Int32Column","path":"Avram/Migrator/Columns/Int32Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int32Column(T)","name":"Int32Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int32_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int32_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = Int32Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int32_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"int4\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Int64Column","path":"Avram/Migrator/Columns/Int64Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int64Column(T)","name":"Int64Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int64_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Int32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int64_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"visibility":"Public","body":"_ = Int64Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int64_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bigint\""}}]},{"html_id":"avram/Avram/Migrator/Columns/JSON","path":"Avram/Migrator/Columns/JSON.html","kind":"module","full_name":"Avram::Migrator::Columns::JSON","name":"JSON","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/json_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"types":[{"html_id":"avram/Avram/Migrator/Columns/JSON/AnyColumn","path":"Avram/Migrator/Columns/JSON/AnyColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::JSON::AnyColumn(T)","name":"AnyColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/json_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/JSON","kind":"module","full_name":"Avram::Migrator::Columns::JSON","name":"JSON"},"class_methods":[{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L14"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"escape_literal(value.to_json)"}}],"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:::JSON::Any|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::JSON::Any | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : ::JSON::Any | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : ::JSON::Any | Nil)","location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::JSON::Any | ::Nil"}],"visibility":"Public","body":"_ = AnyColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"jsonb\""}}]}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","path":"Avram/Migrator/Columns/PrimaryKeys.html","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/base.cr#L1"},{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"types":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","path":"Avram/Migrator/Columns/PrimaryKeys/Base.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/base.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int16PrimaryKey","name":"Int16PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int32PrimaryKey","name":"Int32PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int64PrimaryKey","name":"Int64PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::UUIDPrimaryKey","name":"UUIDPrimaryKey"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"instance_methods":[{"html_id":"build:String-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/base.cr#L8"},"def":{"name":"build","return_type":"String","visibility":"Public","body":"\" #{name} #{column_type} PRIMARY KEY\""}},{"html_id":"column_type-instance-method","name":"column_type","abstract":true,"location":{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/base.cr#L6"},"def":{"name":"column_type","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int16PrimaryKey","name":"Int16PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"smallserial\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int32PrimaryKey","name":"Int32PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"serial4\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int64PrimaryKey","name":"Int64PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bigserial\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::UUIDPrimaryKey","name":"UUIDPrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build:String-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L12"},"def":{"name":"build","return_type":"String","visibility":"Public","body":"\" #{name} #{column_type} PRIMARY KEY DEFAULT gen_random_uuid()\""}},{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"uuid\""}}]}]},{"html_id":"avram/Avram/Migrator/Columns/StringColumn","path":"Avram/Migrator/Columns/StringColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::StringColumn(T)","name":"StringColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/string_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/string_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil,case_sensitive:Bool=true)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"},{"name":"case_sensitive","default_value":"true","external_name":"case_sensitive","restriction":"::Bool"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil, case_sensitive : Bool = true)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil, case_sensitive : Bool = true)","location":{"filename":"src/avram/migrator/columns/string_column.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/string_column.cr#L8"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"},{"name":"case_sensitive","default_value":"true","external_name":"case_sensitive","restriction":"::Bool"}],"visibility":"Public","body":"_ = StringColumn(T).allocate\n_.initialize(name, nilable, default, case_sensitive)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","doc":"If `case_sensitive?` is false then the column type is set to `citext`\nwhich requires the `citext` extension to be enabled\notherwise the type is `text`","summary":"

If case_sensitive? is false then the column type is set to citext which requires the citext extension to be enabled otherwise the type is text

","abstract":false,"location":{"filename":"src/avram/migrator/columns/string_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/string_column.cr#L14"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"case_sensitive? ? \"text\" : \"citext\""}}]},{"html_id":"avram/Avram/Migrator/Columns/TimeColumn","path":"Avram/Migrator/Columns/TimeColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::TimeColumn(T)","name":"TimeColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/time_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"class_methods":[{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L14"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"if value == (:now)\n \"NOW()\"\nelse\n if value.is_a?(Time)\n escape_literal(value.to_utc.to_s)\n else\n raise(\"Unrecognized value :#{value} for a timestamptz. Please use a Time object or :now for current timestamp.\")\n end\nend"}}],"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Symbol|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Symbol | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Symbol | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Symbol | T | Nil)","location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Symbol | T | ::Nil"}],"visibility":"Public","body":"_ = TimeColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"timestamptz\""}}]},{"html_id":"avram/Avram/Migrator/Columns/UUIDColumn","path":"Avram/Migrator/Columns/UUIDColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::UUIDColumn(T)","name":"UUIDColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/uuid_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/uuid_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = UUIDColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/uuid_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"uuid\""}}]}]},{"html_id":"avram/Avram/Migrator/CreateExtensionStatement","path":"Avram/Migrator/CreateExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::CreateExtensionStatement","name":"CreateExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"CREATE EXTENSION IF NOT EXISTS \\\"#{@name}\\\";\""}}]},{"html_id":"avram/Avram/Migrator/CreateForeignKeyStatement","path":"Avram/Migrator/CreateForeignKeyStatement.html","kind":"class","full_name":"Avram::Migrator::CreateForeignKeyStatement","name":"CreateForeignKeyStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_foreign_key_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Generates an ALTER TABLE statement for adding a foreign key constraint on a table.\n\n### Usage\n\n```\nCreateForeignKeyStatement.new(from: :comments, to: :users, column: :author_id, primary_key: :uid, on_delete: :cascade).build\n# => \"ALTER TABLE comments ADD CONSTRAINT comments_author_id_fk FOREIGN KEY (author_id) REFERENCES users (uid) ON DELETE CASCADE;\"\n```","summary":"

Generates an ALTER TABLE statement for adding a foreign key constraint on a table.

","constructors":[{"html_id":"new(from:TableName,to:TableName,on_delete:Symbol,column:Symbol|Nil=nil,primary_key:Symbol=:id)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":"::Symbol"}],"args_string":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil = nil, primary_key : Symbol = :id)","args_html":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil = nil, primary_key : Symbol = :id)","location":{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_foreign_key_statement.cr#L10"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":"::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, to, on_delete, column, primary_key)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_foreign_key_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"foreign_key = @column || ((Wordsmith::Inflector.singularize(@to.to_s)) + \"_id\")\nString.build do |index|\n index << \"ALTER TABLE\"\n index << \" #{@from}\"\n index << \" ADD CONSTRAINT #{@from}_#{foreign_key}_fk\"\n index << \" FOREIGN KEY (#{foreign_key})\"\n index << (BuildReferenceFragment.new(\"#{@to} (#{@primary_key})\", @on_delete)).build\n index << \";\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/CreateFunctionStatement","path":"Avram/Migrator/CreateFunctionStatement.html","kind":"class","full_name":"Avram::Migrator::CreateFunctionStatement","name":"CreateFunctionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_function_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_function_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,body:String,returns:String=\"trigger\")-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"args_string":"(name : String, body : String, returns : String = \"trigger\")","args_html":"(name : String, body : String, returns : String = "trigger")","location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_function_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, body, returns)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_function_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"\"CREATE OR REPLACE FUNCTION #{function_name}\\n RETURNS #{@returns} AS $$\\nBEGIN\\n #{@body}\\nEND\\n$$ LANGUAGE 'plpgsql';\""}},{"html_id":"function_name-instance-method","name":"function_name","abstract":false,"location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_function_statement.cr#L5"},"def":{"name":"function_name","visibility":"Public","body":"if @name.ends_with?(')')\n @name\nelse\n \"#{@name}()\"\nend"}}]},{"html_id":"avram/Avram/Migrator/CreateIndexStatement","path":"Avram/Migrator/CreateIndexStatement.html","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_index_statement.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L28"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for creating an index using table name, column\nname(s), index type and unique flag.\n\n### Usage\n\nFor a single column:\n\n```\nCreateIndexStatement.new(:users, columns: :email, using: :btree, unique: true).build\n# => \"CREATE UNIQUE INDEX users_email_index ON users USING btree (email);\"\n```\n\nFor multiple columns:\n\n```\nCreateIndexStatement.new(:users, columns: [:email, :username], using: :btree, unique: true).build\n# => \"CREATE UNIQUE INDEX users_email_username_index ON users USING btree (email, username);\"\n```\n\nWith custom name:\n\n```\nCreateIndexStatement.new(:users, columns: [:email, :username], name: :custom_index_name).build\n# => \"CREATE INDEX custom_index_name ON users USING btree (email, username);\"\n```","summary":"

Builds an SQL statement for creating an index using table name, column name(s), index type and unique flag.

","constructors":[{"html_id":"new(table:TableName,columns:Columns,using:Symbol=:btree,unique:Bool=false,name:String|Nil|Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":"::Bool"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table : TableName, columns : Columns, using : Symbol = :btree, unique : Bool = false, name : String | Nil | Symbol | Nil = nil)","args_html":"(table : TableName, columns : Columns, using : Symbol = :btree, unique : Bool = false, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L39"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":"::Bool"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, columns, using, unique, name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L44"},"def":{"name":"build","visibility":"Public","body":"index_name = @name\nindex_name || (index_name = \"#{@table}_#{columns.join(\"_\")}_index\")\nString.build do |index|\n index << \"CREATE\"\n if @unique\n index << \" UNIQUE\"\n end\n index << \" INDEX #{index_name}\"\n index << \" ON #{@table}\"\n index << \" USING #{@using.to_s.downcase}\"\n index << \" (#{columns.join(\", \")});\"\nend\n"}}],"types":[{"html_id":"avram/Avram/Migrator/CreateIndexStatement/IndexTypes","path":"Avram/Migrator/CreateIndexStatement/IndexTypes.html","kind":"enum","full_name":"Avram::Migrator::CreateIndexStatement::IndexTypes","name":"IndexTypes","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_index_statement.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L31"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Btree","name":"Btree","value":"0"},{"id":"Hash","name":"Hash","value":"1"},{"id":"Gist","name":"Gist","value":"2"},{"id":"Gin","name":"Gin","value":"3"},{"id":"Brin","name":"Brin","value":"4"}],"namespace":{"html_id":"avram/Avram/Migrator/CreateIndexStatement","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement"},"instance_methods":[{"html_id":"brin?-instance-method","name":"brin?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L36"},"def":{"name":"brin?","visibility":"Public","body":"self == Brin"}},{"html_id":"btree?-instance-method","name":"btree?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L32"},"def":{"name":"btree?","visibility":"Public","body":"self == Btree"}},{"html_id":"gin?-instance-method","name":"gin?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L35"},"def":{"name":"gin?","visibility":"Public","body":"self == Gin"}},{"html_id":"gist?-instance-method","name":"gist?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L34"},"def":{"name":"gist?","visibility":"Public","body":"self == Gist"}},{"html_id":"hash?-instance-method","name":"hash?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L33"},"def":{"name":"hash?","visibility":"Public","body":"self == Hash"}}]}]},{"html_id":"avram/Avram/Migrator/CreateTableStatement","path":"Avram/Migrator/CreateTableStatement.html","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_table_statement.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L11"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build(&):CreateTableStatement-instance-method","name":"build","doc":"Accepts a block to build a table and indices using `add` and `add_index` methods.\n\nThe generated sql statements are aggregated in the `statements` method.\n\n## Usage\n\n```\nbuilt = Avram::Migrator::CreateTableStatement.new(:users).build do\n add_belongs_to Account, on_delete: :cascade\n add :email : String, unique: true\nend\n\nbuilt.statements\n# => [\n \"CREATE TABLE users (\n id serial PRIMARY KEY,\n created_at timestamptz NOT NULL,\n updated_at timestamptz NOT NULL,\n account_id bigint NOT NULL REFERENCES accounts (id) ON DELETE CASCADE,\n email text NOT NULL);\",\n \"CREATE UNIQUE INDEX users_email_index ON users USING btree (email);\"\n]\n```\n\nAn optional second argument can toggle between the usage of a numeric or uuid\nbased id column.\n\n```\nbuilt = Avram::Migrator::CreateTableStatement.new(:users, PrimaryKeyType::UUID).build do\n add :email : String, unique: true\nend\n```","summary":"

Accepts a block to build a table and indices using add and add_index methods.

","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L46"},"def":{"name":"build","yields":0,"block_arity":0,"return_type":"CreateTableStatement","visibility":"Public","body":"with self yield\nself\n"}},{"html_id":"statements-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L51"},"def":{"name":"statements","visibility":"Public","body":"[table_statement] + index_statements"}}],"macros":[{"html_id":"add(type_declaration,default=nil,index=false,unique=false,using=:btree,**type_options)-macro","name":"add","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""}],"args_string":"(type_declaration, default = nil, index = false, unique = false, using = :btree, **type_options)","args_html":"(type_declaration, default = nil, index = false, unique = false, using = :btree, **type_options)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":89,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L89"},"def":{"name":"add","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% type = type_declaration.type.resolve\nnilable = false\narray = false\nbytes = false\n %}\n\n \n{% if type.nilable?\n type = type.union_types.reject(&.==(Nil)).first\n nilable = true\nend %}\n\n \n{% if type < Array\n type = type.type_vars.first\n array = true\nend %}\n\n \n{% if type < Slice\n type = \"Bytes\".id\n bytes = true\nend %}\n\n\n\n rows << Avram::Migrator::Columns::\n{{ type }}\nColumn(\n \n{% if array %}Array({{ type }}){% else %}{{ type }}{% end %}\n\n ).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable }}\n,\n default: \n{{ default }}\n,\n \n{{ type_options.double_splat }}\n\n )\n \n{% if array %}\n .array!\n {% end %}\n\n .build_add_statement_for_create\n\n \n{% if index || unique %}\n add_index :{{ type_declaration.var }}, using: {{ using }}, unique: {{ unique }}\n {% end %}\n\n \n"}},{"html_id":"add_belongs_to(type_declaration,on_delete,references=nil,foreign_key_type=Int64,unique=false)-macro","name":"add_belongs_to","doc":"Adds a references column and index given a model class and references option.","summary":"

Adds a references column and index given a model class and references option.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"args_string":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, unique = false)","args_html":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, unique = false)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L135"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.is_a?(TypeDeclaration) %}{% else %}\n {% raise(\"add_belongs_to expected a type declaration like 'user : User', instead got: '#{type_declaration}'\") %}\n {% end %}\n\n \n{% if (type_declaration.type.stringify =~ (/\\w::\\w/)) && references.nil? %}\n {% raise(\"Namespaced models must include the `references` option with the name of the table.\\n\\nTry this...\\n\\n ▸ add_belongs_to(#{type_declaration}, on_delete: #{on_delete}, references: :the_table_name)\") %}\n {% end %}\n\n \n{% optional = type_declaration.type.is_a?(Union) %}\n\n\n \n{% if optional %}\n {% underscored_class = type_declaration.type.types.first %}\n {% else %}\n {% underscored_class = type_declaration.type %}\n {% end %}\n\n \n{% underscored_class = underscored_class.stringify.underscore.gsub(/::/, \"_\") %}\n\n\n \n{% foreign_key_name = type_declaration.var + \"_id\" %}\n\n \n%table_name\n = \n{{ references }}\n || Wordsmith::Inflector.pluralize(\n{{ underscored_class }}\n)\n\n rows << Avram::Migrator::Columns::\n{{ foreign_key_type }}\nColumn(\n{{ foreign_key_type }}\n).new(\n name: \n{{ foreign_key_name.stringify }}\n,\n nilable: \n{{ optional }}\n,\n default: nil,\n )\n .set_references(references: \n%table_name\n.to_s, on_delete: \n{{ on_delete }}\n)\n .build_add_statement_for_create\n\n add_index :\n{{ foreign_key_name }}\n, unique: \n{{ unique }}\n\n \n"}},{"html_id":"add_timestamps-macro","name":"add_timestamps","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":84,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L84"},"def":{"name":"add_timestamps","visibility":"Public","body":" add created_at : Time, default: :now\n add updated_at : Time, default: :now\n "}},{"html_id":"belongs_to(type_declaration,*args,**named_args)-macro","name":"belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type_declaration, *args, **named_args)","args_html":"(type_declaration, *args, **named_args)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":172,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L172"},"def":{"name":"belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% raise(\"Unexpected call to `belongs_to` in a migration.\\nFound in #{type_declaration.filename.id}:#{type_declaration.line_number}:#{type_declaration.column_number}.\\n\\nDid you mean to use 'add_belongs_to'?\\n\\n'add_belongs_to #{type_declaration}, ...'\") %}\n\n \n"}},{"html_id":"composite_primary_key(*columns)-macro","name":"composite_primary_key","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""}],"args_string":"(*columns)","args_html":"(*columns)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L77"},"def":{"name":"composite_primary_key","args":[{"name":"columns","external_name":"columns","restriction":""}],"splat_index":0,"visibility":"Public","body":" \n{% if columns.size < 2 %}\n {% raise(\"composite_primary_key expected at least two primary keys, instead got #{columns.size}\") %}\n {% end %}\n\n constraints << \" PRIMARY KEY (\n{{ (columns.join(\", \")).id }}\n)\"\n \n"}},{"html_id":"primary_key(type_declaration)-macro","name":"primary_key","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L71"},"def":{"name":"primary_key","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" rows << Avram::Migrator::Columns::PrimaryKeys::\n{{ type_declaration.type }}\nPrimaryKey\n .new(name: \n{{ type_declaration.var.stringify }}\n)\n .build\n \n"}}]},{"html_id":"avram/Avram/Migrator/CreateTriggerStatement","path":"Avram/Migrator/CreateTriggerStatement.html","kind":"class","full_name":"Avram::Migrator::CreateTriggerStatement","name":"CreateTriggerStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_trigger_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName,trigger_name:String,function:String,callbacktrigger_when:Symbol=:before,ontrigger_operation:Array(Symbol)=[:update])-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"},{"name":"function","external_name":"function","restriction":"String"},{"name":"trigger_when","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"trigger_operation","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"args_string":"(table_name : TableName, trigger_name : String, function : String, callback trigger_when : Symbol = :before, on trigger_operation : Array(Symbol) = [:update])","args_html":"(table_name : TableName, trigger_name : String, function : String, callback trigger_when : Symbol = :before, on trigger_operation : Array(Symbol) = [:update])","location":{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_trigger_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"},{"name":"function","external_name":"function","restriction":"String"},{"name":"trigger_when","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"trigger_operation","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, trigger_name, function, trigger_when, trigger_operation)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_trigger_statement.cr#L11"},"def":{"name":"build","visibility":"Public","body":"\"CREATE TRIGGER #{@trigger_name}\\n#{@trigger_when.to_s.upcase} #{operation_statement} ON #{@table_name}\\nFOR EACH ROW\\nEXECUTE PROCEDURE #{@function}();\""}}]},{"html_id":"avram/Avram/Migrator/DropExtensionStatement","path":"Avram/Migrator/DropExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::DropExtensionStatement","name":"DropExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP EXTENSION IF EXISTS \\\"#{@name}\\\" CASCADE;\""}}]},{"html_id":"avram/Avram/Migrator/DropForeignKeyStatement","path":"Avram/Migrator/DropForeignKeyStatement.html","kind":"class","full_name":"Avram::Migrator::DropForeignKeyStatement","name":"DropForeignKeyStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_foreign_key_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Generates an ALTER TABLE statement for dropping a foreign key constraint on a table.\n\n### Usage\n\n```\nDropForeignKeyStatement.new(from: :comments, references: :users, column: :author_id).build\n# => \"ALTER TABLE comments DROP CONSTRAINT comments_author_id_fk;\"\n```","summary":"

Generates an ALTER TABLE statement for dropping a foreign key constraint on a table.

","constructors":[{"html_id":"new(from:TableName,references:TableName,column:Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"}],"args_string":"(from : TableName, references : TableName, column : Symbol | Nil = nil)","args_html":"(from : TableName, references : TableName, column : Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_foreign_key_statement.cr#L10"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, references, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_foreign_key_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"foreign_key = @column || ((Wordsmith::Inflector.singularize(@references.to_s)) + \"_id\")\nString.build do |index|\n index << \"ALTER TABLE\"\n index << \" #{@from}\"\n index << \" DROP CONSTRAINT #{@from}_#{foreign_key}_fk\"\n index << \";\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/DropFunctionStatement","path":"Avram/Migrator/DropFunctionStatement.html","kind":"class","full_name":"Avram::Migrator::DropFunctionStatement","name":"DropFunctionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_function_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_function_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_function_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP FUNCTION IF EXISTS \\\"#{@name}\\\" CASCADE;\""}}]},{"html_id":"avram/Avram/Migrator/DropIndexStatement","path":"Avram/Migrator/DropIndexStatement.html","kind":"class","full_name":"Avram::Migrator::DropIndexStatement","name":"DropIndexStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_index_statement.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ALLOWED_ON_DELETE_STRATEGIES","name":"ALLOWED_ON_DELETE_STRATEGIES","value":"[:cascade, :restrict] of ::Symbol"}],"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for dropping an index by inferring it's name using table name and column(s).\n\n### Usage\n\nFor a single column index:\n\n```\nDropIndexStatement.new(:users, :email, if_exists: true, on_delete: :cascade).build\n# => \"DROP INDEX IF EXISTS users_email_index CASCADE;\"\n```\n\nFor multiple column index:\n\n```\nDropIndexStatement.new(:users, [:email, :username] if_exists: true, on_delete: :cascade).build\n# => \"DROP INDEX IF EXISTS users_email_username_index CASCADE;\"\n```\n\nFor index by name:\n\n```\nDropIndexStatement.new(:users, name: :custom_index_name).build\n# => \"DROP INDEX custom_index_name;\"\n```","summary":"

Builds an SQL statement for dropping an index by inferring it's name using table name and column(s).

","constructors":[{"html_id":"new(table:TableName,columns:Columns|Nil=nil,if_exists:Bool=false,on_delete:Symbol=:do_nothing,name:String|Nil|Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":"::Bool"},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":"::Symbol"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table : TableName, columns : Columns | Nil = nil, if_exists : Bool = false, on_delete : Symbol = :do_nothing, name : String | Nil | Symbol | Nil = nil)","args_html":"(table : TableName, columns : Columns | Nil = nil, if_exists : Bool = false, on_delete : Symbol = :do_nothing, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_index_statement.cr#L32"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":"::Bool"},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":"::Symbol"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, columns, if_exists, on_delete, name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_index_statement.cr#L35"},"def":{"name":"build","visibility":"Public","body":"String.build do |index|\n index << \"DROP INDEX\"\n if @if_exists\n index << \" IF EXISTS\"\n end\n index << \" #{index_name}\"\n index << (on_delete_strategy(@on_delete))\nend"}},{"html_id":"on_delete_strategy(on_delete=:do_nothing)-instance-method","name":"on_delete_strategy","abstract":false,"args":[{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""}],"args_string":"(on_delete = :do_nothing)","args_html":"(on_delete = :do_nothing)","location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_index_statement.cr#L44"},"def":{"name":"on_delete_strategy","args":[{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""}],"visibility":"Public","body":"if on_delete == (:do_nothing)\n \";\"\nelse\n if ALLOWED_ON_DELETE_STRATEGIES.includes?(on_delete)\n \" #{on_delete};\".upcase\n else\n raise(\"on_delete: :#{on_delete} is not supported. Please use :do_nothing, :cascade or :restrict\")\n end\nend"}}]},{"html_id":"avram/Avram/Migrator/DropTableStatement","path":"Avram/Migrator/DropTableStatement.html","kind":"class","full_name":"Avram::Migrator::DropTableStatement","name":"DropTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_table_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_table_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_table_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP TABLE #{@table_name}\""}}]},{"html_id":"avram/Avram/Migrator/DropTriggerStatement","path":"Avram/Migrator/DropTriggerStatement.html","kind":"class","full_name":"Avram::Migrator::DropTriggerStatement","name":"DropTriggerStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_trigger_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName,trigger_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"}],"args_string":"(table_name : TableName, trigger_name : String)","args_html":"(table_name : TableName, trigger_name : String)","location":{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_trigger_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, trigger_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_trigger_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP TRIGGER IF EXISTS #{@trigger_name} ON #{@table_name};\""}}]},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","path":"Avram/Migrator/IndexStatementHelpers.html","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers","abstract":false,"locations":[{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/index_statement_helpers.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/AlterTableStatement","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement"},{"html_id":"avram/Avram/Migrator/CreateIndexStatement","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement"},{"html_id":"avram/Avram/Migrator/CreateTableStatement","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement"},{"html_id":"avram/Avram/Migrator/DropIndexStatement","kind":"class","full_name":"Avram::Migrator::DropIndexStatement","name":"DropIndexStatement"},{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"instance_methods":[{"html_id":"add_index(column:Symbol,unique=false,using:Symbol=:btree)-instance-method","name":"add_index","doc":"Generates raw sql for adding an index to a table column. Accepts 'unique' and 'using' options.","summary":"

Generates raw sql for adding an index to a table column.

","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"}],"args_string":"(column : Symbol, unique = false, using : Symbol = :btree)","args_html":"(column : Symbol, unique = false, using : Symbol = :btree)","location":{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/index_statement_helpers.cr#L7"},"def":{"name":"add_index","args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"}],"visibility":"Public","body":"index = (CreateIndexStatement.new(@table_name, column, using, unique)).build\nif index_added?(index, column)\nelse\n index_statements << index\nend\n"}},{"html_id":"index_added?(index:String,column:Symbol)-instance-method","name":"index_added?","doc":"Returns false unless matching index exists. Ignores UNIQUE","summary":"

Returns false unless matching index exists.

","abstract":false,"args":[{"name":"index","external_name":"index","restriction":"String"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(index : String, column : Symbol)","args_html":"(index : String, column : Symbol)","location":{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/index_statement_helpers.cr#L13"},"def":{"name":"index_added?","args":[{"name":"index","external_name":"index","restriction":"String"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"if (index_statements.includes?(index)) || (index_statements.includes?(index.gsub(\" UNIQUE\", \"\")))\nelse\n return false\nend\nraise(\"index on #{@table_name}.#{column} already exists\")\n"}}],"types":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers/Columns","path":"Avram/Migrator/IndexStatementHelpers/Columns.html","kind":"alias","full_name":"Avram::Migrator::IndexStatementHelpers::Columns","name":"Columns","abstract":false,"locations":[{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/index_statement_helpers.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Array(Symbol) | Symbol)","aliased_html":"Array(Symbol) | Symbol","const":false,"namespace":{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}}]},{"html_id":"avram/Avram/Migrator/Migration","path":"Avram/Migrator/Migration.html","kind":"module","full_name":"Avram::Migrator::Migration","name":"Migration","abstract":false,"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"types":[{"html_id":"avram/Avram/Migrator/Migration/V1","path":"Avram/Migrator/Migration/V1.html","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"},{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator/Migration","kind":"module","full_name":"Avram::Migrator::Migration","name":"Migration"},"instance_methods":[{"html_id":"down(quiet=false)-instance-method","name":"down","doc":"Same as #up except calls rollback method in migration.","summary":"

Same as #up except calls rollback method in migration.

","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"args_string":"(quiet = false)","args_html":"(quiet = false)","location":{"filename":"src/avram/migrator/migration.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L48"},"def":{"name":"down","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"visibility":"Public","body":"suppress_logging do\n if pending?\n puts(\"Already rolled back #{self.class.name.colorize(:cyan)}\")\n else\n reset_prepared_statements\n rollback\n execute_in_transaction(@prepared_statements) do |tx|\n untrack_migration(tx)\n if quiet\n else\n puts(\"Rolled back #{self.class.name.colorize(:green)}\")\n end\n end\n end\nend"}},{"html_id":"migrate-instance-method","name":"migrate","abstract":true,"location":{"filename":"src/avram/migrator/migration.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L21"},"def":{"name":"migrate","visibility":"Public","body":""}},{"html_id":"migrated?-instance-method","name":"migrated?","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L69"},"def":{"name":"migrated?","visibility":"Public","body":"suppress_logging do\n Avram.settings.database_to_migrate.query_one?(\"SELECT id FROM migrations WHERE version = $1\", version, as: MigrationId)\nend"}},{"html_id":"pending?-instance-method","name":"pending?","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L65"},"def":{"name":"pending?","visibility":"Public","body":"!migrated?"}},{"html_id":"prepared_statements:Array(String)-instance-method","name":"prepared_statements","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L24"},"def":{"name":"prepared_statements","visibility":"Public","body":"@prepared_statements"}},{"html_id":"reset_prepared_statements-instance-method","name":"reset_prepared_statements","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":110,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L110"},"def":{"name":"reset_prepared_statements","visibility":"Public","body":"@prepared_statements = [] of String"}},{"html_id":"up(quiet=false)-instance-method","name":"up","doc":"Unless already migrated, calls migrate which in turn calls statement\nhelpers to generate and collect SQL statements in the\n@prepared_statements array. Each statement is then executed in a\ntransaction and tracked upon completion.","summary":"

Unless already migrated, calls migrate which in turn calls statement helpers to generate and collect SQL statements in the @prepared_statements array.

","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"args_string":"(quiet = false)","args_html":"(quiet = false)","location":{"filename":"src/avram/migrator/migration.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L30"},"def":{"name":"up","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"visibility":"Public","body":"suppress_logging do\n if migrated?\n puts(\"Already migrated #{self.class.name.colorize(:cyan)}\")\n else\n reset_prepared_statements\n migrate\n execute_in_transaction(@prepared_statements) do |tx|\n track_migration(tx)\n if quiet\n else\n puts(\"Migrated #{self.class.name.colorize(:green)}\")\n end\n end\n end\nend"}},{"html_id":"version:Int64-instance-method","name":"version","abstract":true,"location":{"filename":"src/avram/migrator/migration.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L22"},"def":{"name":"version","return_type":"Int64","visibility":"Public","body":""}}],"types":[{"html_id":"avram/Avram/Migrator/Migration/V1/MigrationId","path":"Avram/Migrator/Migration/V1/MigrationId.html","kind":"alias","full_name":"Avram::Migrator::Migration::V1::MigrationId","name":"MigrationId","abstract":false,"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Int32 | Int64)","aliased_html":"Int32 | Int64","const":false,"namespace":{"html_id":"avram/Avram/Migrator/Migration/V1","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1"}}]}]},{"html_id":"avram/Avram/Migrator/MigrationGenerator","path":"Avram/Migrator/MigrationGenerator.html","kind":"class","full_name":"Avram::Migrator::MigrationGenerator","name":"MigrationGenerator","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,migrate_contents:String,rollback_contents:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"migrate_contents","external_name":"migrate_contents","restriction":"String"},{"name":"rollback_contents","external_name":"rollback_contents","restriction":"String"}],"args_string":"(name : String, migrate_contents : String, rollback_contents : String)","args_html":"(name : String, migrate_contents : String, rollback_contents : String)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L17"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"migrate_contents","external_name":"migrate_contents","restriction":"String"},{"name":"rollback_contents","external_name":"rollback_contents","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, migrate_contents, rollback_contents)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"formatted_migrate_contents:String|Nil-instance-method","name":"formatted_migrate_contents","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L32"},"def":{"name":"formatted_migrate_contents","return_type":"String | ::Nil","visibility":"Public","body":"@migrate_contents.try do |contents|\n pad_contents(contents)\nend"}},{"html_id":"formatted_rollback_contents:String|Nil-instance-method","name":"formatted_rollback_contents","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L38"},"def":{"name":"formatted_rollback_contents","return_type":"String | ::Nil","visibility":"Public","body":"@rollback_contents.try do |contents|\n pad_contents(contents)\nend"}},{"html_id":"generate(_version:Nil|String=@_version)-instance-method","name":"generate","abstract":false,"args":[{"name":"_version","default_value":"@_version","external_name":"_version","restriction":"::Nil | ::String"}],"args_string":"(_version : Nil | String = @_version)","args_html":"(_version : Nil | String = @_version)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L20"},"def":{"name":"generate","args":[{"name":"_version","default_value":"@_version","external_name":"_version","restriction":"::Nil | ::String"}],"visibility":"Public","body":"@_version = _version\nensure_camelcase_name\nmake_migrations_folder_if_missing\nensure_unique\nFile.write(file_path, contents)\nio.puts(\"Created #{migration_class_name.colorize(:green)} in .#{relative_file_path.colorize(:green)}\")\n"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L7"},"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"to_s(__io__:IO):Nil-instance-method","name":"to_s","doc":"Appends a short String representation of this object\nwhich includes its class name and its object address.\n\n```\nclass Person\n def initialize(@name : String, @age : Int32)\n end\nend\n\nPerson.new(\"John\", 32).to_s # => #\n```","summary":"

Appends a short String representation of this object which includes its class name and its object address.

","abstract":false,"args":[{"name":"__io__","external_name":"__io__","restriction":"IO"}],"args_string":"(__io__ : IO) : Nil","args_html":"(__io__ : IO) : Nil","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L12"},"def":{"name":"to_s","args":[{"name":"__io__","external_name":"__io__","restriction":"IO"}],"return_type":"Nil","visibility":"Public","body":"ECR.embed(\"/home/runner/work/avram/avram/src/avram/tasks/gen/migration.ecr\", \"__io__\")"}}]},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","path":"Avram/Migrator/MissingOnDeleteWithBelongsToError.html","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError","abstract":false,"locations":[{"filename":"src/avram/migrator/missing_on_delete_with_belongs_to_error.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/missing_on_delete_with_belongs_to_error.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/AlterTableStatement","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement"},{"html_id":"avram/Avram/Migrator/CreateTableStatement","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"macros":[{"html_id":"add_belongs_to(type_declaration,references=nil)-macro","name":"add_belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""}],"args_string":"(type_declaration, references = nil)","args_html":"(type_declaration, references = nil)","location":{"filename":"src/avram/migrator/missing_on_delete_with_belongs_to_error.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/missing_on_delete_with_belongs_to_error.cr#L2"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""}],"visibility":"Public","body":" \n{% raise(\"Must use 'on_delete' with 'add_belongs_to'\\n\\nTry this...\\n\\n ▸ add_belongs_to #{type_declaration}, on_delete: :cascade\\n\\nYou can also use :restrict, :nullify, or :do_nothing\\n\\nRead more at: https://luckyframework.org/guides/database/migrations#associations\\n\\n\") %}\n\n \n"}}]},{"html_id":"avram/Avram/Migrator/Runner","path":"Avram/Migrator/Runner.html","kind":"class","full_name":"Avram::Migrator::Runner","name":"Runner","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/runner.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"MIGRATIONS_TABLE_NAME","name":"MIGRATIONS_TABLE_NAME","value":"\"migrations\""}],"extended_modules":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"class_methods":[{"html_id":"cmd_args-class-method","name":"cmd_args","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L40"},"def":{"name":"cmd_args","visibility":"Public","body":"String.build do |args|\n if self.db_user\n args << \"-U #{self.db_user}\"\n end\n if self.db_host\n args << \" -h #{self.db_host}\"\n end\n if self.db_port\n args << \" -p #{self.db_port}\"\n end\n args << \" #{self.db_name}\"\nend"}},{"html_id":"create_db(quiet?:Bool=false)-class-method","name":"create_db","abstract":false,"args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"args_string":"(quiet? : Bool = false)","args_html":"(quiet? : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L58"},"def":{"name":"create_db","args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"visibility":"Public","body":"begin\n DB.connect(\"#{credentials.connection_string}/#{db_user}\") do |db|\n db.exec(\"CREATE DATABASE #{db_name}\")\n end\n if quiet?\n else\n puts(\"Done creating #{db_name.colorize(:green)}\")\n end\nrescue e : DB::ConnectionRefused\n message = e.message.to_s\n if message.blank?\n raise(ConnectionError.new(URI.parse(credentials.url_without_query_params), Avram.settings.database_to_migrate))\n else\n raise(e)\n end\nrescue e : Exception\n message = e.message.to_s\n if message.includes?(\"\\\"#{self.db_name}\\\" already exists\")\n if quiet?\n else\n puts(\"Already created #{self.db_name.colorize(:green)}\")\n end\n else\n if message.includes?(\"Cannot establish connection\")\n raise(PGNotRunningError.new(message))\n else\n raise(e)\n end\n end\nend"}},{"html_id":"credentials-class-method","name":"credentials","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L36"},"def":{"name":"credentials","visibility":"Public","body":"Avram.settings.database_to_migrate.credentials"}},{"html_id":"db_host-class-method","name":"db_host","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L20"},"def":{"name":"db_host","visibility":"Public","body":"credentials.hostname"}},{"html_id":"db_name-class-method","name":"db_name","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L16"},"def":{"name":"db_name","visibility":"Public","body":"credentials.database"}},{"html_id":"db_password-class-method","name":"db_password","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L32"},"def":{"name":"db_password","visibility":"Public","body":"credentials.password"}},{"html_id":"db_port-class-method","name":"db_port","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L24"},"def":{"name":"db_port","visibility":"Public","body":"credentials.port"}},{"html_id":"db_user-class-method","name":"db_user","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L28"},"def":{"name":"db_user","visibility":"Public","body":"credentials.username"}},{"html_id":"drop_db(quiet?:Bool=false)-class-method","name":"drop_db","abstract":false,"args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"args_string":"(quiet? : Bool = false)","args_html":"(quiet? : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L49"},"def":{"name":"drop_db","args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"visibility":"Public","body":"DB.connect(\"#{credentials.connection_string}/#{db_user}\") do |db|\n db.exec(\"DROP DATABASE IF EXISTS #{db_name}\")\nend\nif quiet?\nelse\n puts(\"Done dropping #{Avram::Migrator::Runner.db_name.colorize(:green)}\")\nend\n"}},{"html_id":"dump_db(dump_to:String=\"db/structure.sql\",quiet:Bool=false)-class-method","name":"dump_db","doc":"Creates a new file at `dump_to` with your database schema,\nand includes the migtation data.","summary":"

Creates a new file at dump_to with your database schema, and includes the migtation data.

","abstract":false,"args":[{"name":"dump_to","default_value":"\"db/structure.sql\"","external_name":"dump_to","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(dump_to : String = \"db/structure.sql\", quiet : Bool = false)","args_html":"(dump_to : String = "db/structure.sql", quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":98,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L98"},"def":{"name":"dump_db","args":[{"name":"dump_to","default_value":"\"db/structure.sql\"","external_name":"dump_to","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"Db::VerifyConnection.new(quiet: true).run_task\nrun(\"pg_dump -s #{cmd_args} > #{dump_to}; pg_dump -t migrations --data-only #{cmd_args} >> #{dump_to}\")\nif quiet\nelse\n puts(\"Done dumping #{db_name.colorize(:green)}\")\nend\n"}},{"html_id":"migrations-class-method","name":"migrations","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L11"},"def":{"name":"migrations","visibility":"Public","body":"@@migrations"}},{"html_id":"restore_db(restore_file:String,quiet:Bool=false)-class-method","name":"restore_db","abstract":false,"args":[{"name":"restore_file","external_name":"restore_file","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(restore_file : String, quiet : Bool = false)","args_html":"(restore_file : String, quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L85"},"def":{"name":"restore_db","args":[{"name":"restore_file","external_name":"restore_file","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"if File.exists?(restore_file)\n run(\"psql -q #{cmd_args} -v ON_ERROR_STOP=1 < #{restore_file}\")\n if quiet\n else\n puts(\"Done restoring #{db_name.colorize(:green)}\")\n end\nelse\n raise(\"Unable to locate the restore file: #{restore_file}\")\nend"}},{"html_id":"run(command:String,output:IO=STDOUT)-class-method","name":"run","abstract":false,"args":[{"name":"command","external_name":"command","restriction":"String"},{"name":"output","default_value":"STDOUT","external_name":"output","restriction":"IO"}],"args_string":"(command : String, output : IO = STDOUT)","args_html":"(command : String, output : IO = STDOUT)","location":{"filename":"src/avram/migrator/runner.cr","line_number":130,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L130"},"def":{"name":"run","args":[{"name":"command","external_name":"command","restriction":"String"},{"name":"output","default_value":"STDOUT","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"error_messages = IO::Memory.new\nif self.db_password\n ENV[\"PGPASSWORD\"] = self.db_password\nend\nresult = Process.run(command, shell: true, output: output, error: error_messages)\nif self.db_password\n ENV.delete(\"PGPASSWORD\")\nend\nif result.success?\nelse\n raise(error_messages.to_s)\nend\n"}},{"html_id":"setup_migration_tracking_tables-class-method","name":"setup_migration_tracking_tables","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L106"},"def":{"name":"setup_migration_tracking_tables","visibility":"Public","body":"suppress_logging do\n db = Avram.settings.database_to_migrate\n db.exec(create_table_for_tracking_migrations)\n db.exec(create_unique_index_for_migrations)\nend"}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L13"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"ensure_migrated!-instance-method","name":"ensure_migrated!","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":184,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L184"},"def":{"name":"ensure_migrated!","visibility":"Public","body":"if !pending_migrations.empty?\n display_migration_error_banner\n Process.signal(:term, Process.ppid)\n exit(1)\nend"}},{"html_id":"rollback_all-instance-method","name":"rollback_all","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":161,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L161"},"def":{"name":"rollback_all","visibility":"Public","body":"self.class.setup_migration_tracking_tables\nmigrated_migrations.reverse.each do |__arg1|\n __arg1.new.down\nend\n"}},{"html_id":"rollback_one-instance-method","name":"rollback_one","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":166,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L166"},"def":{"name":"rollback_one","visibility":"Public","body":"self.class.setup_migration_tracking_tables\nif migrated_migrations.empty?\n puts(\"Did not roll anything back because the database has no migrations.\".colorize(:green))\nelse\n migrated_migrations.last.new.down\nend\n"}},{"html_id":"rollback_to(last_version:Int64)-instance-method","name":"rollback_to","abstract":false,"args":[{"name":"last_version","external_name":"last_version","restriction":"Int64"}],"args_string":"(last_version : Int64)","args_html":"(last_version : Int64)","location":{"filename":"src/avram/migrator/runner.cr","line_number":175,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L175"},"def":{"name":"rollback_to","args":[{"name":"last_version","external_name":"last_version","restriction":"Int64"}],"visibility":"Public","body":"self.class.setup_migration_tracking_tables\nsubset = migrated_migrations.select do |mm|\n mm.new.version > last_version\nend\nsubset.reverse.each do |__arg2|\n __arg2.new.down\nend\nputs(\"Done rolling back to #{last_version}\".colorize(:green))\n"}},{"html_id":"run_next_migration-instance-method","name":"run_next_migration","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L155"},"def":{"name":"run_next_migration","visibility":"Public","body":"prepare_for_migration do\n pending_migrations.first.new.up\nend"}},{"html_id":"run_pending_migrations-instance-method","name":"run_pending_migrations","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":149,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L149"},"def":{"name":"run_pending_migrations","visibility":"Public","body":"prepare_for_migration do\n pending_migrations.each do |__arg0|\n __arg0.new.up(@quiet)\n end\nend"}}]},{"html_id":"avram/Avram/Migrator/StatementHelpers","path":"Avram/Migrator/StatementHelpers.html","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers","abstract":false,"ancestors":[{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"locations":[{"filename":"src/avram/migrator/statement_helpers.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"}],"including_types":[{"html_id":"avram/Avram/Migrator/Migration/V1","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"instance_methods":[{"html_id":"create_foreign_key(from:TableName,to:TableName,on_delete:Symbol,column:Symbol|Nil,primary_key=:id)-instance-method","name":"create_foreign_key","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":""}],"args_string":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil, primary_key = :id)","args_html":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil, primary_key = :id)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L31"},"def":{"name":"create_foreign_key","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":""}],"visibility":"Public","body":"prepared_statements << (CreateForeignKeyStatement.new(from, to, on_delete, column, primary_key)).build"}},{"html_id":"create_function(name:String,body:String,returns:String=\"trigger\")-instance-method","name":"create_function","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"args_string":"(name : String, body : String, returns : String = \"trigger\")","args_html":"(name : String, body : String, returns : String = "trigger")","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L67"},"def":{"name":"create_function","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::CreateFunctionStatement.new(name, body: body, returns: returns)).build"}},{"html_id":"create_index(table_name:TableName,columns:Columns,unique=false,using=:btree,name:String|Nil|Symbol|Nil=nil)-instance-method","name":"create_index","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table_name : TableName, columns : Columns, unique = false, using = :btree, name : String | Nil | Symbol | Nil = nil)","args_html":"(table_name : TableName, columns : Columns, unique = false, using = :btree, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L39"},"def":{"name":"create_index","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (CreateIndexStatement.new(table_name, columns, using, unique, name)).build"}},{"html_id":"create_trigger(table_name:TableName,name:String,function_name:String,callback:Symbol=:before,on:Array(Symbol)=[:update])-instance-method","name":"create_trigger","doc":"Drop any existing trigger by this name first before creating.\nPostgres does not support updating or replacing a trigger as of version 12\n\nCreates a new TRIGGER named `name` on the table `table_name`.\n`function_name` - The PG function to run from this trigger.\n`callback` - When to run this trigger (BEFORE or AFTER). Default `:before`\n`on` - The operation(s) for this trigger (INSERT, UPDATE, DELETE). Default is `[:update]`\n\n```\ncreate_trigger(:users, \"trigger_set_timestamps\", \"set_timestamps\")\n# => CREATE TRIGGER trigger_set_timestamps BEFORE UPDATE ON users FOR EACH ROW EXECUTE PROCEDURE set_timestamps();\n```","summary":"

Drop any existing trigger by this name first before creating.

","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"},{"name":"function_name","external_name":"function_name","restriction":"String"},{"name":"callback","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"on","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"args_string":"(table_name : TableName, name : String, function_name : String, callback : Symbol = :before, on : Array(Symbol) = [:update])","args_html":"(table_name : TableName, name : String, function_name : String, callback : Symbol = :before, on : Array(Symbol) = [:update])","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L87"},"def":{"name":"create_trigger","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"},{"name":"function_name","external_name":"function_name","restriction":"String"},{"name":"callback","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"on","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"visibility":"Public","body":"drop_trigger(table_name, name)\nprepared_statements << (Avram::Migrator::CreateTriggerStatement.new(table_name, name, function_name, callback, on)).build\n"}},{"html_id":"disable_extension(name:String)-instance-method","name":"disable_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L59"},"def":{"name":"disable_extension","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropExtensionStatement.new(name)).build"}},{"html_id":"drop(table_name)-instance-method","name":"drop","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L17"},"def":{"name":"drop","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropTableStatement.new(table_name)).build"}},{"html_id":"drop_foreign_key(from:TableName,references:TableName,column:Symbol|Nil)-instance-method","name":"drop_foreign_key","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"}],"args_string":"(from : TableName, references : TableName, column : Symbol | Nil)","args_html":"(from : TableName, references : TableName, column : Symbol | Nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L35"},"def":{"name":"drop_foreign_key","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (DropForeignKeyStatement.new(from, references, column)).build"}},{"html_id":"drop_function(name:String)-instance-method","name":"drop_function","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L71"},"def":{"name":"drop_function","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropFunctionStatement.new(name)).build"}},{"html_id":"drop_index(table_name:TableName,columns:Columns|Nil=nil,if_exists=false,on_delete=:do_nothing,name:String|Nil|Symbol|Nil=nil)-instance-method","name":"drop_index","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":""},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table_name : TableName, columns : Columns | Nil = nil, if_exists = false, on_delete = :do_nothing, name : String | Nil | Symbol | Nil = nil)","args_html":"(table_name : TableName, columns : Columns | Nil = nil, if_exists = false, on_delete = :do_nothing, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L43"},"def":{"name":"drop_index","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":""},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropIndexStatement.new(table_name, columns, if_exists, on_delete, name)).build"}},{"html_id":"drop_trigger(table_name:TableName,name:String)-instance-method","name":"drop_trigger","doc":"Drop the tigger `name` for the table `table_name`","summary":"

Drop the tigger name for the table table_name

","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(table_name : TableName, name : String)","args_html":"(table_name : TableName, name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":93,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L93"},"def":{"name":"drop_trigger","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropTriggerStatement.new(table_name, name)).build"}},{"html_id":"enable_extension(name:String)-instance-method","name":"enable_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L55"},"def":{"name":"enable_extension","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::CreateExtensionStatement.new(name)).build"}},{"html_id":"make_optional(table:TableName,column:Symbol)-instance-method","name":"make_optional","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(table : TableName, column : Symbol)","args_html":"(table : TableName, column : Symbol)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L51"},"def":{"name":"make_optional","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::ChangeNullStatement.new(table, column, required: false)).build"}},{"html_id":"make_required(table:TableName,column:Symbol)-instance-method","name":"make_required","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(table : TableName, column : Symbol)","args_html":"(table : TableName, column : Symbol)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L47"},"def":{"name":"make_required","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::ChangeNullStatement.new(table, column, required: true)).build"}},{"html_id":"update_extension(name:String,to:String|Nil=nil)-instance-method","name":"update_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"args_string":"(name : String, to : String | Nil = nil)","args_html":"(name : String, to : String | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L63"},"def":{"name":"update_extension","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::AlterExtensionStatement.new(name, to: to)).build"}}],"macros":[{"html_id":"alter(table_name)-macro","name":"alter","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L21"},"def":{"name":"alter","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":" statements = Avram::Migrator::AlterTableStatement.new(\n{{ table_name }}\n).build do\n \n{{ yield }}\n\n \nend.statements\n\n statements.each do |statement|\n prepared_statements << statement\n \nend\n \n"}},{"html_id":"create(table_name)-macro","name":"create","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L7"},"def":{"name":"create","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":" statements = Avram::Migrator::CreateTableStatement.new(\n{{ table_name }}\n).build do\n \n{{ yield }}\n\n \nend.statements\n\n statements.each do |statement|\n prepared_statements << statement\n \nend\n \n"}}]}]},{"html_id":"avram/Avram/MissingRequiredAssociationError","path":"Avram/MissingRequiredAssociationError.html","kind":"class","full_name":"Avram::MissingRequiredAssociationError","name":"MissingRequiredAssociationError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(model:Avram::Model.class,association:Avram::Model.class)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"Avram::Model.class"},{"name":"association","external_name":"association","restriction":"Avram::Model.class"}],"args_string":"(model : Avram::Model.class, association : Avram::Model.class)","args_html":"(model : Avram::Model.class, association : Avram::Model.class)","location":{"filename":"src/avram/errors.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L44"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"Avram::Model.class"},{"name":"association","external_name":"association","restriction":"Avram::Model.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, association)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"association:Avram::Model.class-instance-method","name":"association","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L42"},"def":{"name":"association","return_type":"Avram::Model.class","visibility":"Public","body":"@association"}},{"html_id":"model:Avram::Model.class-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L41"},"def":{"name":"model","return_type":"Avram::Model.class","visibility":"Public","body":"@model"}}]},{"html_id":"avram/Avram/Model","path":"Avram/Model.html","kind":"class","full_name":"Avram::Model","name":"Model","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},{"html_id":"avram/Avram/Polymorphic","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic"},{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/model.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},{"html_id":"avram/Avram/Polymorphic","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic"},{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"database_table_info:Avram::Database::TableInfo|Nil-class-method","name":"database_table_info","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L28"},"def":{"name":"database_table_info","return_type":"Avram::Database::TableInfo | ::Nil","visibility":"Public","body":"database.database_info.table(table_name.to_s)"}},{"html_id":"primary_key_name:Symbol|Nil-class-method","name":"primary_key_name","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L24"},"def":{"name":"primary_key_name","return_type":"Symbol | ::Nil","visibility":"Public","body":"nil"}}],"instance_methods":[{"html_id":"delete-instance-method","name":"delete","doc":"Refer to `PrimaryKeyMethods#delete`","summary":"

Refer to PrimaryKeyMethods#delete

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L52"},"def":{"name":"delete","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#delete on #{@type.name} because it does not have a primary key. Add a primary key or define your own `delete` method.\") %}"}},{"html_id":"model_name:String-instance-method","name":"model_name","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L32"},"def":{"name":"model_name","return_type":"String","visibility":"Public","body":"self.class.name"}},{"html_id":"reload:self-instance-method","name":"reload","doc":"Refer to `PrimaryKeyMethods#reload`","summary":"

Refer to PrimaryKeyMethods#reload

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L37"},"def":{"name":"reload","return_type":"self","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#reload on #{@type.name} because it does not have a primary key. Add a primary key or define your own `reload` method.\") %}"}},{"html_id":"reload(&):self-instance-method","name":"reload","doc":"Refer to `PrimaryKeyMethods#reload`","summary":"

Refer to PrimaryKeyMethods#reload

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L42"},"def":{"name":"reload","yields":0,"block_arity":0,"return_type":"self","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#reload on #{@type.name} because it does not have a primary key. Add a primary key or define your own `reload` method.\") %}"}},{"html_id":"to_param:String-instance-method","name":"to_param","doc":"Refer to `PrimaryKeyMethods#to_param`","summary":"

Refer to PrimaryKeyMethods#to_param

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L47"},"def":{"name":"to_param","return_type":"String","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#to_param on #{@type.name} because it does not have a primary key. Add a primary key or define your own `to_param` method.\") %}"}}],"macros":[{"html_id":"association(assoc_name,type,relationship_type,foreign_key=nil,through=nil)-macro","name":"association","abstract":false,"args":[{"name":"assoc_name","external_name":"assoc_name","restriction":""},{"name":"type","external_name":"type","restriction":""},{"name":"relationship_type","external_name":"relationship_type","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""}],"args_string":"(assoc_name, type, relationship_type, foreign_key = nil, through = nil)","args_html":"(assoc_name, type, relationship_type, foreign_key = nil, through = nil)","location":{"filename":"src/avram/model.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L281"},"def":{"name":"association","args":[{"name":"assoc_name","external_name":"assoc_name","restriction":""},{"name":"type","external_name":"type","restriction":""},{"name":"relationship_type","external_name":"relationship_type","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""}],"visibility":"Public","body":" \n{% ASSOCIATIONS << {type: type, assoc_name: assoc_name.id, foreign_key: foreign_key, relationship_type: relationship_type, through: through} %}\n\n \n"}},{"html_id":"column(type_declaration,autogenerated=false,serializeis_serialized=false,allow_blank=false)-macro","name":"column","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"autogenerated","default_value":"false","external_name":"autogenerated","restriction":""},{"name":"is_serialized","default_value":"false","external_name":"serialize","restriction":""},{"name":"allow_blank","default_value":"false","external_name":"allow_blank","restriction":""}],"args_string":"(type_declaration, autogenerated = false, serialize is_serialized = false, allow_blank = false)","args_html":"(type_declaration, autogenerated = false, serialize is_serialized = false, allow_blank = false)","location":{"filename":"src/avram/model.cr","line_number":246,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L246"},"def":{"name":"column","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"autogenerated","default_value":"false","external_name":"autogenerated","restriction":""},{"name":"is_serialized","default_value":"false","external_name":"serialize","restriction":""},{"name":"allow_blank","default_value":"false","external_name":"allow_blank","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.type.is_a?(Union) %}\n {% data_type = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% data_type = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n \n{% if type_declaration.value || (type_declaration.value == false) %}\n {% value = type_declaration.value %}\n {% else %}\n {% value = nil %}\n {% end %}\n\n\n \n{% COLUMNS << {name: type_declaration.var, type: data_type, nilable: nilable.id, autogenerated: autogenerated, value: value, serialized: is_serialized, allow_blank: allow_blank} %}\n\n \n"}},{"html_id":"default_columns-macro","name":"default_columns","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L137"},"def":{"name":"default_columns","visibility":"Public","body":" primary_key id : Int64\n timestamps\n "}},{"html_id":"primary_key(type_declaration)-macro","name":"primary_key","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/model.cr","line_number":100,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L100"},"def":{"name":"primary_key","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" PRIMARY_KEY_TYPE = \n{{ type_declaration.type }}\n\n PRIMARY_KEY_NAME = \n{{ type_declaration.var.symbolize }}\n\n column \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n, autogenerated: true\n alias PrimaryKeyType = \n{{ type_declaration.type }}\n\n\n def self.primary_key_name : Symbol?\n :\n{{ type_declaration.var.stringify }}\n\n \nend\n\n include Avram::PrimaryKeyMethods\n\n \n# If not using default 'id' primary key\n\n \n{% if type_declaration.var.id != \"id\".id %}\n # Then point 'id' to the primary key\n def id\n {{ type_declaration.var.id }}\n end\n {% end %}\n\n \n"}},{"html_id":"setup(step)-macro","name":"setup","abstract":false,"args":[{"name":"step","external_name":"step","restriction":""}],"args_string":"(step)","args_html":"(step)","location":{"filename":"src/avram/model.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L152"},"def":{"name":"setup","args":[{"name":"step","external_name":"step","restriction":""}],"visibility":"Public","body":" \n{{ step.id }}\n(\n type: \n{{ @type }}\n,\n columns: \n{{ COLUMNS }}\n,\n associations: \n{{ ASSOCIATIONS }}\n\n )\n \n"}},{"html_id":"setup_association_queries(associations,*args,**named_args)-macro","name":"setup_association_queries","abstract":false,"args":[{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(associations, *args, **named_args)","args_html":"(associations, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":209,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L209"},"def":{"name":"setup_association_queries","args":[{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% for assoc in associations %}\n def {{ assoc[:assoc_name] }}_query\n {% if assoc[:relationship_type] == (:has_many) %}\n {{ assoc[:type] }}::BaseQuery.new.{{ assoc[:foreign_key].id }}(id)\n {% else %}{% if assoc[:relationship_type] == (:belongs_to) %}\n {{ assoc[:type] }}::BaseQuery.new.id({{ assoc[:foreign_key].id }})\n {% else %}\n {{ assoc[:type] }}::BaseQuery.new\n {% end %}{% end %}\n end\n {% end %}\n\n \n"}},{"html_id":"setup_column_info_methods(columns,*args,**named_args)-macro","name":"setup_column_info_methods","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L263"},"def":{"name":"setup_column_info_methods","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" def self.column_names : Array(Symbol)\n columns.map \n{ |column| column[:name] }\n \nend\n\n def self.columns : Array(\n{name: Symbol, nilable: Bool, type: String})\n [\n \n{% for column in columns %}\n {\n name: {{ column[:name].id.symbolize }},\n nilable: {{ column[:nilable] }},\n type: {{ column[:type].id }}.name\n },\n {% end %}\n\n ]\n \nend\n \n"}},{"html_id":"setup_db_mapping(columns,*args,**named_args)-macro","name":"setup_db_mapping","doc":"Setup [database mapping](http://crystal-lang.github.io/crystal-db/api/latest/DB.html) for the model's columns.\n\nNOTE: Avram::Migrator saves `Float` columns as numeric which are converted\nin the avram/charms/float64_extensions.cr file","summary":"

Setup database mapping for the model's columns.

","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":189,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L189"},"def":{"name":"setup_db_mapping","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" DB.mapping(\n{\n \n{% for column in columns %}\n {{ column[:name] }}: {\n {% if column[:type].id == Array(Float64).id %}\n type: Array(PG::Numeric),\n {% else %}{% if column[:type].is_a?(Generic) || column[:serialized] %}\n type: {{ column[:type] }},\n {% else %}\n type: {{ column[:type] }}::Lucky::ColumnType,\n {% end %}{% end %}\n nilable: {{ column[:nilable] }},\n {% if column[:serialized] %}\n converter: JSONConverter({{ column[:type] }}),\n {% end %}\n },\n {% end %}\n\n })\n \n"}},{"html_id":"setup_getters(columns,*args,**named_args)-macro","name":"setup_getters","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":233,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L233"},"def":{"name":"setup_getters","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% for column in columns %}\n def {{ column[:name] }} : {{ column[:type] }}{{ (column[:nilable] ? \"?\" : \"\").id }}\n {{ column[:type] }}.adapter.from_db!(@{{ column[:name] }})\n end\n {% if column[:type].id == Bool.id %}\n def {{ column[:name] }}? : Bool\n !!{{ column[:name] }}\n end\n {% end %}\n {% end %}\n\n \n"}},{"html_id":"setup_initialize(columns,*args,**named_args)-macro","name":"setup_initialize","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":176,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L176"},"def":{"name":"setup_initialize","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" def initialize(\n \n{% for column in columns %}\n @{{ column[:name] }},\n {% end %}\n\n )\n \nend\n \n"}},{"html_id":"setup_table_schema_enforcer_validations(type,*args,**named_args)-macro","name":"setup_table_schema_enforcer_validations","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":223,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L223"},"def":{"name":"setup_table_schema_enforcer_validations","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" schema_enforcer_validations << EnsureExistingTable.new(model_class: \n{{ type.id }}\n)\n schema_enforcer_validations << EnsureMatchingColumns.new(model_class: \n{{ type.id }}\n)\n \n"}},{"html_id":"setup_view_schema_enforcer_validations(type,*args,**named_args)-macro","name":"setup_view_schema_enforcer_validations","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":228,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L228"},"def":{"name":"setup_view_schema_enforcer_validations","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" schema_enforcer_validations << EnsureExistingTable.new(model_class: \n{{ type.id }}\n)\n schema_enforcer_validations << EnsureMatchingColumns.new(model_class: \n{{ type.id }}\n, check_required: false)\n \n"}},{"html_id":"skip_default_columns-macro","name":"skip_default_columns","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L142"},"def":{"name":"skip_default_columns","visibility":"Public","body":" macro default_columns\n \nend\n \n"}},{"html_id":"table(table_name=nil)-macro","name":"table","abstract":false,"args":[{"name":"table_name","default_value":"nil","external_name":"table_name","restriction":""}],"args_string":"(table_name = nil)","args_html":"(table_name = nil)","location":{"filename":"src/avram/model.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L56"},"def":{"name":"table","args":[{"name":"table_name","default_value":"nil","external_name":"table_name","restriction":""}],"visibility":"Public","body":" default_columns\n\n \n{{ yield }}\n\n\n validate_columns(\"table\")\n validate_primary_key\n\n \n{% if table_name %}\n class_getter table_name : String = {{ table_name.id.stringify }}\n {% else %}\n class_getter table_name : String = Avram::TableFor.table_for({{ @type.id }})\n {% end %}\n\n setup(Avram::Model.setup_initialize)\n setup(Avram::Model.setup_db_mapping)\n setup(Avram::Model.setup_getters)\n setup(Avram::Model.setup_column_info_methods)\n setup(Avram::Model.setup_association_queries)\n setup(Avram::Model.setup_table_schema_enforcer_validations)\n setup(Avram::BaseQueryTemplate.setup)\n setup(Avram::SaveOperationTemplate.setup)\n setup(Avram::DeleteOperationTemplate.setup)\n setup(Avram::SchemaEnforcer.setup)\n \n"}},{"html_id":"timestamps-macro","name":"timestamps","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L147"},"def":{"name":"timestamps","visibility":"Public","body":" column created_at : Time, autogenerated: true\n column updated_at : Time, autogenerated: true\n "}},{"html_id":"validate_columns(model_type)-macro","name":"validate_columns","abstract":false,"args":[{"name":"model_type","external_name":"model_type","restriction":""}],"args_string":"(model_type)","args_html":"(model_type)","location":{"filename":"src/avram/model.cr","line_number":160,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L160"},"def":{"name":"validate_columns","args":[{"name":"model_type","external_name":"model_type","restriction":""}],"visibility":"Public","body":" \n{% if COLUMNS.empty? %}\n {% raise(\"#{@type} must define at least one column.\\n\\nExample:\\n\\n #{model_type.id} do\\n primary_key id : Int64\\n ...\\n end\") %}\n {% end %}\n\n \n"}},{"html_id":"validate_primary_key-macro","name":"validate_primary_key","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":121,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L121"},"def":{"name":"validate_primary_key","visibility":"Public","body":" \n{% if !(@type.has_constant?(\"PRIMARY_KEY_TYPE\")) %}\n \\{% raise <<-ERROR\n No primary key was specified.\n\n Example:\n\n table do\n primary_key id : Int64\n ...\n end\n ERROR\n %}\n {% end %}\n\n \n"}},{"html_id":"view(view_name=nil)-macro","name":"view","abstract":false,"args":[{"name":"view_name","default_value":"nil","external_name":"view_name","restriction":""}],"args_string":"(view_name = nil)","args_html":"(view_name = nil)","location":{"filename":"src/avram/model.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L81"},"def":{"name":"view","args":[{"name":"view_name","default_value":"nil","external_name":"view_name","restriction":""}],"visibility":"Public","body":" \n{{ yield }}\n\n\n validate_columns(\"view\")\n \n{% if view_name %}\n class_getter table_name : String = {{ view_name.id.stringify }}\n {% else %}\n class_getter table_name : String = Avram::TableFor.table_for({{ @type.id }})\n {% end %}\n\n setup(Avram::Model.setup_initialize)\n setup(Avram::Model.setup_db_mapping)\n setup(Avram::Model.setup_getters)\n setup(Avram::Model.setup_column_info_methods)\n setup(Avram::Model.setup_association_queries)\n setup(Avram::Model.setup_view_schema_enforcer_validations)\n setup(Avram::BaseQueryTemplate.setup)\n setup(Avram::SchemaEnforcer.setup)\n \n"}}],"types":[{"html_id":"avram/Avram/Model/JSONConverter","path":"Avram/Model/JSONConverter.html","kind":"module","full_name":"Avram::Model::JSONConverter(T)","name":"JSONConverter","abstract":false,"locations":[{"filename":"src/avram/model.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L11"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"},"class_methods":[{"html_id":"from_rs(rs:DB::ResultSet)-class-method","name":"from_rs","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/model.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L12"},"def":{"name":"from_rs","args":[{"name":"rs","external_name":"rs","restriction":"DB::ResultSet"}],"visibility":"Public","body":"value = rs.read(::Union(JSON::PullParser, ::Nil))\nif value\n T.new(value)\nend\n"}}]}]},{"html_id":"avram/Avram/NeedyInitializer","path":"Avram/NeedyInitializer.html","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer","abstract":false,"locations":[{"filename":"src/avram/needy_initializer.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L68"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializers-macro","name":"generate_initializers","abstract":false,"location":{"filename":"src/avram/needy_initializer.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L37"},"def":{"name":"generate_initializers","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L15"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# This is called at the end so @type will be of the subclass,\n\n \n# and not the parent abstract class.\n\n generate_initializers\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n property \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n \n"}}]},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","path":"Avram/NeedyInitializerAndDeleteMethods.html","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods","abstract":false,"locations":[{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_delete(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_delete","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":94,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L94"},"def":{"name":"generate_delete","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.delete\n{% if with_bang %}!{% end %}\n(\n record : T,\n params : Hash,\n **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:delete\n{% if with_bang %}!{% end %}\n, additional_args: \"record, \")\n \nend\n\n def self.delete\n{% if with_bang %}!{% end %}\n(\n record : T,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n record,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.delete!\n {% else %}\n operation.delete\n yield operation, operation.record\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_delete_methods(attribute_method_args,attribute_params)-macro","name":"generate_delete_methods","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L133"},"def":{"name":"generate_delete_methods","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n \n"}},{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L140"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @record : T,\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @record : T,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \nextract_changes_from_params\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n unless {{ attribute[:name] }}.is_a? Avram::Nothing\n self.{{ attribute[:name] }}.value = {{ attribute[:name] }}\n end\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer_and_delete_methods-macro","name":"generate_initializer_and_delete_methods","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L37"},"def":{"name":"generate_initializer_and_delete_methods","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# These method arguments can be used in macros for generating delete/new\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute[:name]} : #{attribute[:type]} | Avram::Nothing\" %}\n {% if attribute[:nilable] %}{% attribute_method_args = attribute_method_args + \" | Nil\" %}{% end %}\n {% attribute_method_args = attribute_method_args + \" = Avram::Nothing.new,\\n\" %}\n\n {% attribute_params = attribute_params + \"#{attribute[:name]}: #{attribute[:name]},\\n\" %}\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n generate_delete_methods(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"hash_is_not_allowed_helpful_error(method,additional_args=nil)-macro","name":"hash_is_not_allowed_helpful_error","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"args_string":"(method, additional_args = nil)","args_html":"(method, additional_args = nil)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L81"},"def":{"name":"hash_is_not_allowed_helpful_error","args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"visibility":"Public","body":" \n{% raise(\"You can't pass a Hash directly to #{method.id}. Instead pass named arguments, or convert the hash to params.\\n\\nTry this...\\n\\n * Use named arguments (recommended) - #{@type}.#{method.id}(#{if additional_args\n additional_args.id\nend}title: \\\"My Title\\\")\\n * Convert hash to params (not as safe) - Avram::Params.new({\\\"title\\\" => \\\"My Title\\\"})\\n\") %}\n\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L15"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# This is called at the end so @type will be of the subclass,\n\n \n# and not the parent abstract class.\n\n generate_initializer_and_delete_methods\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n property \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n \n"}}]},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","path":"Avram/NeedyInitializerAndSaveMethods.html","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods","abstract":false,"locations":[{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_create(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_create","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":96,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L96"},"def":{"name":"generate_create","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.create\n{% if with_bang %}!{% end %}\n(\n params : Hash, **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:create\n{% if with_bang %}!{% end %}\n)\n \nend\n\n def self.create\n{% if with_bang %}!{% end %}\n(\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.save!\n {% else %}\n if operation.save\n yield operation, operation.record\n else\n yield operation, nil\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":185,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L185"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @record : T,\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @record = nil\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @record : T,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @record = nil\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \nextract_changes_from_params\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n unless {{ attribute[:name] }}.is_a? Avram::Nothing\n self.{{ attribute[:name] }}.value = {{ attribute[:name] }}\n end\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer_and_save_methods-macro","name":"generate_initializer_and_save_methods","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L39"},"def":{"name":"generate_initializer_and_save_methods","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# These method arguments can be used in macros fro generating create/update/new\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute[:name]} : #{attribute[:type]} | Avram::Nothing\" %}\n {% if attribute[:nilable] %}{% attribute_method_args = attribute_method_args + \" | Nil\" %}{% end %}\n {% attribute_method_args = attribute_method_args + \" = Avram::Nothing.new,\\n\" %}\n\n {% attribute_params = attribute_params + \"#{attribute[:name]}: #{attribute[:name]},\\n\" %}\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n generate_save_methods(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"generate_save_methods(attribute_method_args,attribute_params)-macro","name":"generate_save_methods","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":173,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L173"},"def":{"name":"generate_save_methods","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n \n"}},{"html_id":"generate_update(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_update","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":134,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L134"},"def":{"name":"generate_update","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.update\n{% if with_bang %}!{% end %}\n(\n record : T,\n params : Hash,\n **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:update\n{% if with_bang %}!{% end %}\n, additional_args: \"record, \")\n \nend\n\n def self.update\n{% if with_bang %}!{% end %}\n(\n record : T,\n \n{% if with_params %}with params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n record,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.update!\n {% else %}\n operation.save\n yield operation, operation.record.not_nil!\n {% end %}\n\n \nend\n \n"}},{"html_id":"hash_is_not_allowed_helpful_error(method,additional_args=nil)-macro","name":"hash_is_not_allowed_helpful_error","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"args_string":"(method, additional_args = nil)","args_html":"(method, additional_args = nil)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":83,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L83"},"def":{"name":"hash_is_not_allowed_helpful_error","args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"visibility":"Public","body":" \n{% raise(\"You can't pass a Hash directly to #{method.id}. Instead pass named arguments, or convert the hash to params.\\n\\nTry this...\\n\\n * Use named arguments (recommended) - #{@type}.#{method.id}(#{if additional_args\n additional_args.id\nend}title: \\\"My Title\\\")\\n * Convert hash to params (not as safe) - Avram::Params.new({\\\"title\\\" => [\\\"My Title\\\"]})\\n\") %}\n\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L16"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# @type is not correct in this method, but is in the macro we call below\n\n \n# That is why this extrac macro was extracted. We need @type to get the\n\n \n# attributes for this SaveOperation\n\n generate_initializer_and_save_methods\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n @\n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n property \n{{ type_declaration.var }}\n\n \n"}}]},{"html_id":"avram/Avram/NestedSaveOperation","path":"Avram/NestedSaveOperation.html","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation","abstract":false,"locations":[{"filename":"src/avram/nested_save_operation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nested_save_operation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"mark_nested_save_operations_as_failed-instance-method","name":"mark_nested_save_operations_as_failed","abstract":false,"location":{"filename":"src/avram/nested_save_operation.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nested_save_operation.cr#L49"},"def":{"name":"mark_nested_save_operations_as_failed","visibility":"Public","body":"nested_save_operations.each do |operation|\n (operation.as(Avram::MarkAsFailed)).mark_as_failed\nend"}},{"html_id":"nested_save_operations-instance-method","name":"nested_save_operations","abstract":false,"location":{"filename":"src/avram/nested_save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nested_save_operation.cr#L55"},"def":{"name":"nested_save_operations","visibility":"Public","body":"[] of Avram::MarkAsFailed"}}],"macros":[{"html_id":"has_one(type_declaration)-macro","name":"has_one","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/nested_save_operation.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nested_save_operation.cr#L2"},"def":{"name":"has_one","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% name = type_declaration.var %}\n\n \n{% type = type_declaration.type.resolve %}\n\n\n \n{% model_type = type.ancestors.find do |t|\n t.stringify.starts_with?(\"Avram::SaveOperation(\")\nend.type_vars.first %}\n\n\n \n{% assoc = (T.constant(:ASSOCIATIONS)).find do |assoc|\n (assoc[:relationship_type] == (:has_one)) && (assoc[:type].resolve.name == model_type.name)\nend %}\n\n\n \n{% if assoc %}{% else %}\n {% raise(\"#{T} must have a has_one association with #{model_type}\") %}\n {% end %}\n\n\n @_\n{{ name }}\n : \n{{ type }}\n | Nil\n\n after_save save_\n{{ name }}\n\n\n def save_\n{{ name }}\n(saved_record)\n \n{{ name }}\n.\n{{ (@type.constant(:FOREIGN_KEY)).id }}\n.value = saved_record.id\n\n unless \n{{ name }}\n.save\n add_error(:\n{{ name }}\n, \"failed\")\n mark_nested_save_operations_as_failed\n database.rollback\n \nend\n \nend\n\n def \n{{ name }}\n\n @_\n{{ name }}\n ||= if new_record?\n \n{{ type }}\n.new(params)\n \nelse\n \n{{ type }}\n.new(record.not_nil!.\n{{ assoc[:assoc_name].id }}\n!, params)\n \nend\n \nend\n\n def nested_save_operations\n \n{% if @type.methods.map(&.name).includes?((:nested_save_operations).id) %}\n previous_def +\n {% end %}\n\n [\n{{ name }}\n]\n \nend\n \n"}}]},{"html_id":"avram/Avram/Nothing","path":"Avram/Nothing.html","kind":"class","full_name":"Avram::Nothing","name":"Nothing","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/nothing.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nothing.cr#L5"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"This class is used in various places\nwhere the question of \"Did I not pass in anything or did I pass in nil?\"\nneeds to be answered.\n:nodoc:","summary":"

This class is used in various places where the question of "Did I not pass in anything or did I pass in nil?" needs to be answered.

"},{"html_id":"avram/Avram/Operation","path":"Avram/Operation.html","kind":"class","full_name":"Avram::Operation","name":"Operation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializer","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/operation.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializer","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L104"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"name.underscore"}},{"html_id":"run(params:Avram::Paramable,*args,**named_args,&)-class-method","name":"run","doc":"Yields the instance of the operation, and the return value from\nthe `run` instance method.\n\n```\nMyOperation.run(params) do |operation, value|\n # operation is complete\nend\n```","summary":"

Yields the instance of the operation, and the return value from the #run instance method.

","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"args_string":"(params : Avram::Paramable, *args, **named_args, &)","args_html":"(params : Avram::Paramable, *args, **named_args, &)","location":{"filename":"src/avram/operation.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L52"},"def":{"name":"run","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":2,"block_arity":2,"visibility":"Public","body":"operation = self.new(params, *args, **named_args)\nvalue = nil\noperation.before_run\nif operation.valid?\n value = operation.run\n operation.after_run(value)\nend\nyield operation, value\n"}},{"html_id":"run(*args,**named_args,&)-class-method","name":"run","doc":"Yields the instance of the operation, and the return value from\nthe `run` instance method.\n\n```\nMyOperation.run do |operation, value|\n # operation is complete\nend\n```","summary":"

Yields the instance of the operation, and the return value from the #run instance method.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args, &)","args_html":"(*args, **named_args, &)","location":{"filename":"src/avram/operation.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L26"},"def":{"name":"run","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"yields":2,"block_arity":2,"visibility":"Public","body":"params = Avram::Params.new\nrun(params, *args, **named_args) do |operation, value|\n yield operation, value\nend\n"}},{"html_id":"run!(params:Avram::Paramable,*args,**named_args)-class-method","name":"run!","doc":"Returns the value from the `run` instance method.\nor raise `Avram::FailedOperation` if the operation fails.\n\n```\nvalue = MyOperation.run!(params)\n```","summary":"

Returns the value from the #run instance method.

","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"args_string":"(params : Avram::Paramable, *args, **named_args)","args_html":"(params : Avram::Paramable, *args, **named_args)","location":{"filename":"src/avram/operation.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L72"},"def":{"name":"run!","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"run(params, *args, **named_args) do |_operation, value|\n if value\n else\n raise(Avram::FailedOperation.new(\"The operation failed to return a value\"))\n end\n value\nend"}},{"html_id":"run!(*args,**named_args)-class-method","name":"run!","doc":"Returns the value from the `run` instance method.\nor raise `Avram::FailedOperation` if the operation fails.\n\n```\nvalue = MyOperation.run!\n```","summary":"

Returns the value from the #run instance method.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/operation.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L39"},"def":{"name":"run!","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"params = Avram::Params.new\nrun!(params, *args, **named_args)\n"}}],"constructors":[{"html_id":"new(params:Avram::Paramable)-class-method","name":"new","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/operation.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L87"},"def":{"name":"new","args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"visibility":"Public","body":"_ = allocate\n_.initialize(params)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L90"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"after_run(_value)-instance-method","name":"after_run","abstract":false,"args":[{"name":"_value","external_name":"_value","restriction":""}],"args_string":"(_value)","args_html":"(_value)","location":{"filename":"src/avram/operation.cr","line_number":84,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L84"},"def":{"name":"after_run","args":[{"name":"_value","external_name":"_value","restriction":""}],"visibility":"Public","body":""}},{"html_id":"before_run-instance-method","name":"before_run","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L79"},"def":{"name":"before_run","visibility":"Public","body":""}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"params:Avram::Paramable-instance-method","name":"params","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L16"},"def":{"name":"params","return_type":"Avram::Paramable","visibility":"Public","body":"@params"}},{"html_id":"run-instance-method","name":"run","abstract":true,"location":{"filename":"src/avram/operation.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L82"},"def":{"name":"run","visibility":"Public","body":""}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":99,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L99"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/OperationErrors","path":"Avram/OperationErrors.html","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors","abstract":false,"locations":[{"filename":"src/avram/operation_errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation_errors.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"add_error(key:Symbol,message:String):Nil-instance-method","name":"add_error","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"Symbol"},{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(key : Symbol, message : String) : Nil","args_html":"(key : Symbol, message : String) : Nil","location":{"filename":"src/avram/operation_errors.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation_errors.cr#L19"},"def":{"name":"add_error","args":[{"name":"key","external_name":"key","restriction":"Symbol"},{"name":"message","external_name":"message","restriction":"String"}],"return_type":"Nil","visibility":"Public","body":"__temp_89 = key\n@custom_errors[__temp_89]? || (@custom_errors[__temp_89] = [] of String)\n@custom_errors[key].push(message)\n"}},{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/operation_errors.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation_errors.cr#L6"},"def":{"name":"errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"attr_errors = attributes.reduce({} of Symbol => Array(String)) do |errors_hash, attribute|\n if attribute.errors.empty?\n errors_hash\n else\n errors_hash[attribute.name] = attribute.errors\n errors_hash\n end\nend\nattr_errors.merge(@custom_errors)\n"}}]},{"html_id":"avram/Avram/OrderBy","path":"Avram/OrderBy.html","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy","abstract":false,"superclass":{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},"ancestors":[{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(column:String|Symbol,direction:Direction,nulls:NullSorting=:default)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"String | Symbol"},{"name":"direction","external_name":"direction","restriction":"Direction"},{"name":"nulls","default_value":":default","external_name":"nulls","restriction":"NullSorting"}],"args_string":"(column : String | Symbol, direction : Direction, nulls : NullSorting = :default)","args_html":"(column : String | Symbol, direction : Direction, nulls : NullSorting = :default)","location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L24"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":"String | Symbol"},{"name":"direction","external_name":"direction","restriction":"Direction"},{"name":"nulls","default_value":":default","external_name":"nulls","restriction":"NullSorting"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column, direction, nulls)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L18"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L20"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":"@column"}},{"html_id":"direction:Avram::OrderBy::Direction-instance-method","name":"direction","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L21"},"def":{"name":"direction","visibility":"Public","body":"@direction"}},{"html_id":"nulls:Avram::OrderBy::NullSorting-instance-method","name":"nulls","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L22"},"def":{"name":"nulls","visibility":"Public","body":"@nulls"}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L31"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":"String.build do |str|\n str << \"#{column} #{direction}\"\n if nulls.default?\n else\n str << \" #{nulls}\"\n end\nend"}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L38"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":"@direction = @direction.asc? ? Direction::DESC : Direction::ASC\nself\n"}}],"types":[{"html_id":"avram/Avram/OrderBy/Direction","path":"Avram/OrderBy/Direction.html","kind":"enum","full_name":"Avram::OrderBy::Direction","name":"Direction","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L13"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"ASC","name":"ASC","value":"0"},{"id":"DESC","name":"DESC","value":"1"}],"namespace":{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},"instance_methods":[{"html_id":"asc?-instance-method","name":"asc?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L14"},"def":{"name":"asc?","visibility":"Public","body":"self == ASC"}},{"html_id":"desc?-instance-method","name":"desc?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L15"},"def":{"name":"desc?","visibility":"Public","body":"self == DESC"}}]},{"html_id":"avram/Avram/OrderBy/NullSorting","path":"Avram/OrderBy/NullSorting.html","kind":"enum","full_name":"Avram::OrderBy::NullSorting","name":"NullSorting","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L3"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"DEFAULT","name":"DEFAULT","value":"0"},{"id":"NULLS_FIRST","name":"NULLS_FIRST","value":"1"},{"id":"NULLS_LAST","name":"NULLS_LAST","value":"2"}],"namespace":{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},"instance_methods":[{"html_id":"default?-instance-method","name":"default?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L4"},"def":{"name":"default?","visibility":"Public","body":"self == DEFAULT"}},{"html_id":"nulls_first?-instance-method","name":"nulls_first?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L5"},"def":{"name":"nulls_first?","visibility":"Public","body":"self == NULLS_FIRST"}},{"html_id":"nulls_last?-instance-method","name":"nulls_last?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L6"},"def":{"name":"nulls_last?","visibility":"Public","body":"self == NULLS_LAST"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"Returns a `String` representation of this enum member.\nIn the case of regular enums, this is just the name of the member.\nIn the case of flag enums, it's the names joined by vertical bars, or \"None\",\nif the value is zero.\n\nIf an enum's value doesn't match a member's value, the raw value\nis returned as a string.\n\n```\nColor::Red.to_s # => \"Red\"\nIOMode::None.to_s # => \"None\"\n(IOMode::Read | IOMode::Write).to_s # => \"Read | Write\"\n\nColor.new(10).to_s # => \"10\"\n```","summary":"

Returns a String representation of this enum member.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L8"},"def":{"name":"to_s","visibility":"Public","body":"super().gsub(\"_\", \" \")"}}]}]},{"html_id":"avram/Avram/OrderByClause","path":"Avram/OrderByClause.html","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},{"html_id":"avram/Avram/OrderByRandom","kind":"class","full_name":"Avram::OrderByRandom","name":"OrderByRandom"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L3"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":""}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L4"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":""}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L5"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/OrderByRandom","path":"Avram/OrderByRandom.html","kind":"class","full_name":"Avram::OrderByRandom","name":"OrderByRandom","abstract":false,"superclass":{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},"ancestors":[{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L3"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L5"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":"@column"}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L7"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":"\"RANDOM ()\""}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L11"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":"self"}}]},{"html_id":"avram/Avram/Paramable","path":"Avram/Paramable.html","kind":"module","full_name":"Avram::Paramable","name":"Paramable","abstract":false,"locations":[{"filename":"src/avram/paramable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Params","kind":"class","full_name":"Avram::Params","name":"Params"},{"html_id":"avram/Lucky/Params","kind":"class","full_name":"Lucky::Params","name":"Params"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"get(key:String)-instance-method","name":"get","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L9"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get?(key:String)-instance-method","name":"get?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L8"},"def":{"name":"get?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get_all(key:String)-instance-method","name":"get_all","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L11"},"def":{"name":"get_all","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get_all?(key:String)-instance-method","name":"get_all?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L10"},"def":{"name":"get_all?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"has_key_for?(operation:Avram::Operation.class|Avram::SaveOperation.class):Bool-instance-method","name":"has_key_for?","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":"Avram::Operation.class | Avram::SaveOperation.class"}],"args_string":"(operation : Avram::Operation.class | Avram::SaveOperation.class) : Bool","args_html":"(operation : Avram::Operation.class | Avram::SaveOperation.class) : Bool","location":{"filename":"src/avram/paramable.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L13"},"def":{"name":"has_key_for?","args":[{"name":"operation","external_name":"operation","restriction":"Avram::Operation.class | Avram::SaveOperation.class"}],"return_type":"Bool","visibility":"Public","body":"!(nested?(operation.param_key)).empty?"}},{"html_id":"many_nested(key:String):Array(Hash(String,String))-instance-method","name":"many_nested","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/paramable.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L7"},"def":{"name":"many_nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":""}},{"html_id":"many_nested?(key:String):Array(Hash(String,String))-instance-method","name":"many_nested?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/paramable.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L6"},"def":{"name":"many_nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":""}},{"html_id":"nested(key:String):Hash(String,String)-instance-method","name":"nested","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/paramable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L3"},"def":{"name":"nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":""}},{"html_id":"nested?(key:String):Hash(String,String)-instance-method","name":"nested?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/paramable.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L2"},"def":{"name":"nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":""}},{"html_id":"nested_arrays(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/paramable.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L5"},"def":{"name":"nested_arrays","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":""}},{"html_id":"nested_arrays?(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/paramable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L4"},"def":{"name":"nested_arrays?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/ParamKeyOverride","path":"Avram/ParamKeyOverride.html","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride","abstract":false,"locations":[{"filename":"src/avram/param_key_override.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/param_key_override.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"define_param_key_override-macro","name":"define_param_key_override","abstract":false,"location":{"filename":"src/avram/param_key_override.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/param_key_override.cr#L10"},"def":{"name":"define_param_key_override","visibility":"Public","body":" macro param_key(key)\n def self.param_key : String\n \n\\{\n{ key.id.stringify }}\n \nend\n \nend\n \n"}}]},{"html_id":"avram/Avram/Params","path":"Avram/Params.html","kind":"class","full_name":"Avram::Params","name":"Params","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Paramable","kind":"module","full_name":"Avram::Paramable","name":"Paramable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/params.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Paramable","kind":"module","full_name":"Avram::Paramable","name":"Paramable"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(hash:Hash(String,Array(String)|String)|Hash(String,Array(String))|Hash(String,String))-class-method","name":"new","abstract":false,"args":[{"name":"hash","external_name":"hash","restriction":"::Hash(::String, ::Array(::String) | ::String) | ::Hash(::String, ::Array(::String)) | ::Hash(::String, ::String)"}],"args_string":"(hash : Hash(String, Array(String) | String) | Hash(String, Array(String)) | Hash(String, String))","args_html":"(hash : Hash(String, Array(String) | String) | Hash(String, Array(String)) | Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L12"},"def":{"name":"new","args":[{"name":"hash","external_name":"hash","restriction":"::Hash(::String, ::Array(::String) | ::String) | ::Hash(::String, ::Array(::String)) | ::Hash(::String, ::String)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(hash)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/params.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L8"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"get(key:String)-instance-method","name":"get","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L51"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"(get?(key)).not_nil!"}},{"html_id":"get?(key:String)-instance-method","name":"get?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L47"},"def":{"name":"get?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"@hash[key]?.try do |value|\n if value.is_a?(String)\n value\n end\nend"}},{"html_id":"get_all(key:String)-instance-method","name":"get_all","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L59"},"def":{"name":"get_all","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"(get_all?(key)).not_nil!"}},{"html_id":"get_all?(key:String)-instance-method","name":"get_all?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L55"},"def":{"name":"get_all?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"@hash[key]?.try do |value|\n if value.is_a?(Array)\n value\n end\nend"}},{"html_id":"get_all_files(key:String)-instance-method","name":"get_all_files","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L71"},"def":{"name":"get_all_files","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"get_all(key)"}},{"html_id":"many_nested(key:String):Array(Hash(String,String))-instance-method","name":"many_nested","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L43"},"def":{"name":"many_nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":"[nested(key)]"}},{"html_id":"many_nested?(key:String):Array(Hash(String,String))-instance-method","name":"many_nested?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L39"},"def":{"name":"many_nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":"many_nested(key)"}},{"html_id":"nested(key:String):Hash(String,String)-instance-method","name":"nested","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L19"},"def":{"name":"nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"Hash(String, String).new.tap do |params|\n @hash.each do |_key, _value|\n if _value.is_a?(String)\n params[_key] = _value\n end\n end\nend"}},{"html_id":"nested?(key:String):Hash(String,String)-instance-method","name":"nested?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L15"},"def":{"name":"nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested(key)"}},{"html_id":"nested_arrays(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/params.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L31"},"def":{"name":"nested_arrays","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":"Hash(String, Array(String)).new.tap do |params|\n @hash.each do |_key, _value|\n if _value.is_a?(Array)\n params[_key] = _value\n end\n end\nend"}},{"html_id":"nested_arrays?(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/params.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L27"},"def":{"name":"nested_arrays?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":"nested_arrays(key)"}},{"html_id":"nested_file(key:String):Hash(String,String)-instance-method","name":"nested_file","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L67"},"def":{"name":"nested_file","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested(key)"}},{"html_id":"nested_file?(key:String):Hash(String,String)-instance-method","name":"nested_file?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L63"},"def":{"name":"nested_file?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested?(key)"}}]},{"html_id":"avram/Avram/PermittedAttribute","path":"Avram/PermittedAttribute.html","kind":"class","full_name":"Avram::PermittedAttribute(T)","name":"PermittedAttribute","abstract":false,"superclass":{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute","name":"Attribute"},"ancestors":[{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute","name":"Attribute"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/permitted_attribute.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/permitted_attribute.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(name,value:T|Nil,param_key,param=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":""},{"name":"param","default_value":"nil","external_name":"param","restriction":""}],"args_string":"(name, value : T | Nil, param_key, param = nil)","args_html":"(name, value : T | Nil, param_key, param = nil)","location":{"filename":"src/avram/attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":""},{"name":"param","default_value":"nil","external_name":"param","restriction":""}],"visibility":"Public","body":"_ = PermittedAttribute(T).allocate\n_.initialize(name, value, param_key, param)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/PGClientNotInstalledError","path":"Avram/PGClientNotInstalledError.html","kind":"class","full_name":"Avram::PGClientNotInstalledError","name":"PGClientNotInstalledError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L105"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(original_message:String)-class-method","name":"new","abstract":false,"args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"args_string":"(original_message : String)","args_html":"(original_message : String)","location":{"filename":"src/avram/errors.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L106"},"def":{"name":"new","args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(original_message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/PGNotRunningError","path":"Avram/PGNotRunningError.html","kind":"class","full_name":"Avram::PGNotRunningError","name":"PGNotRunningError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L131"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(original_message:String)-class-method","name":"new","abstract":false,"args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"args_string":"(original_message : String)","args_html":"(original_message : String)","location":{"filename":"src/avram/errors.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L132"},"def":{"name":"new","args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(original_message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Polymorphic","path":"Avram/Polymorphic.html","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic","abstract":false,"locations":[{"filename":"src/avram/polymorphic.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/polymorphic.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Helpers for defining polymorphic associations","summary":"

Helpers for defining polymorphic associations

","macros":[{"html_id":"polymorphic(polymorphic_name,associations,optional=false)-macro","name":"polymorphic","doc":"# Save a comment for this video\nvideo = VideoQuery.first\nComment::SaveOperation.create!(video_id: video.id)\n```","summary":"

\n \n \nSave a comment for this video video = VideoQuery.first Comment::SaveOperation.create!(video_id: video.id) ```

","abstract":false,"args":[{"name":"polymorphic_name","external_name":"polymorphic_name","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"optional","default_value":"false","external_name":"optional","restriction":""}],"args_string":"(polymorphic_name, associations, optional = false)","args_html":"(polymorphic_name, associations, optional = false)","location":{"filename":"src/avram/polymorphic.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/polymorphic.cr#L104"},"def":{"name":"polymorphic","args":[{"name":"polymorphic_name","external_name":"polymorphic_name","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"optional","default_value":"false","external_name":"optional","restriction":""}],"visibility":"Public","body":" \n{% polymorphic_name = polymorphic_name.id %}\n\n def \n{{ polymorphic_name }}\n\n \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable!\n\n \n# Generates something like: post || video\n\n \n{{ (associations.map(&.id).join(\" || \")).id }}\n{% if !optional %} || Avram::Polymorphic.raise_missing_polymorphic(:{{ polymorphic_name }}, self){% end %}\n\n \nend\n\n def \n{{ polymorphic_name }}\n!\n \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable!\n\n \n# Generates something like: post! || video!\n\n \n{% associations_with_a_bang = associations.map(&.id).map do |assoc|\n \"#{assoc}!\"\nend %}\n\n \n{{ (associations_with_a_bang.join(\" || \")).id }}\n{% if !optional %} || Avram::Polymorphic.raise_missing_polymorphic(:{{ polymorphic_name }}, self){% end %}\n\n \nend\n\n private def \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable! : Nil\n if should_check_polymorphism_at_runtime?\n \n{% associations_to_check = associations.map(&.id).map do |assoc|\n \"#{assoc}.as(Nil)\"\nend %}\n\n \n{{ (associations_to_check.join(\" || \")).id }}\n \n# Ensure polymorphic associations are nilable\n\n \nend\n \nend\n\n \n# This is a bit of a hack to get around Crystal's smart compiler :)\n\n \n# In the ensure_\n{assoc}_belongs_to_are_nilable! we need to check that the\n\n \n# compiler *can* cast to nil, but we don't want to *actually* check it at\n\n \n# runtime. The problem is that we can't do `if false` because Crystal realizes\n\n \n# That will never match and so doesn't even check the `as(Nil)`\n\n \n# We have to trick it by extracting the false to a method. That way\n\n \n# Crystal doesn't realize it is always 'false' and will still check\n\n \n# That the types can be cast to Nil at compile, without actually casting it\n\n \n# at runtime.\n\n private def should_check_polymorphism_at_runtime? : Bool\n false\n \nend\n\n macro finished\n class SaveOperation\n \n# These validations must be run after all of the `before_save`\n\n \n# in case anyone sets their polymorphic association in a callback.\n\n \n# These are ran in the SaveOperation#valid? method\n\n default_validations do\n \n{% list_of_foreign_keys = associations.map(&.id).map do |assoc|\n \"#{assoc.id}_id\".id\nend %}\n\n\n \n# TODO: Needs to actually get the foreign key from the ASSOCIATIONS constant\n\n \n{% if optional %}\n validate_at_most_one_filled {{ (list_of_foreign_keys.map(&.id).join(\", \")).id }}\n {% else %}\n validate_exactly_one_filled {{ (list_of_foreign_keys.map(&.id).join(\", \")).id }},\n message: \"at least one '{{ polymorphic_name.id }}' must be filled\"\n {% end %}\n\n \nend\n \nend\n\n class BaseQuery\n def preload_\n{{ polymorphic_name.id }}\n\n \n{% for association in associations %}\n preload_{{ association.id }}\n {% end %}\n\n \nend\n \nend\n \nend\n \n"}}]},{"html_id":"avram/Avram/PrimaryKeyMethods","path":"Avram/PrimaryKeyMethods.html","kind":"module","full_name":"Avram::PrimaryKeyMethods","name":"PrimaryKeyMethods","abstract":false,"locations":[{"filename":"src/avram/primary_key_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/avram/primary_key_methods.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L2"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if id == other.id\nelse\n return false\nend\nif model_name == other.model_name\nelse\n return false\nend\ntrue\n"}},{"html_id":"delete-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L75"},"def":{"name":"delete","visibility":"Public","body":"self.class.database.exec(\"DELETE FROM #{@@table_name} WHERE #{primary_key_name} = #{escape_primary_key(id)}\")"}},{"html_id":"primary_key_name:Symbol|Nil-instance-method","name":"primary_key_name","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L4"},"def":{"name":"primary_key_name","return_type":"Symbol | ::Nil","visibility":"Public","body":"self.class.primary_key_name"}},{"html_id":"reload:self-instance-method","name":"reload","doc":"Reload the model with the latest information from the database\n\nThis method will return a new model instance with the\nlatest data from the database. Note that this does\n**not** change the original instance, so you may need to\nassign the result to a variable or work directly with the return value.\n\nExample:\n\n```\nuser = SaveUser.create!(name: \"Original\")\nSaveUser.update!(user, name: \"Updated\")\n\n# Will be \"Original\"\nuser.name\n# Will return \"Updated\"\nuser.reload.name # Will be \"Updated\"\n# Will still be \"Original\" since the 'user' is the same model instance.\nuser.name\n\nInstead re-assign the variable. Now 'name' will return \"Updated\" since\n'user' references the reloaded model.\nuser = user.reload\nuser.name\n```","summary":"

Reload the model with the latest information from the database

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L33"},"def":{"name":"reload","return_type":"self","visibility":"Public","body":"base_query_class.find(id)"}},{"html_id":"reload(&):self-instance-method","name":"reload","doc":"Same as `reload` but allows passing a block to customize the query.\n\nThis is almost always used to preload additional relationships.\n\nExample:\n\n```\nuser = SaveUser.create(params)\n\n# We want to display the list of articles the user has commented on, so let's #\n# preload them to avoid N+1 performance issues\nuser = user.reload(&.preload_comments(CommentQuery.new.preload_article))\n\n# Now we can safely get all the comment authors\nuser.comments.map(&.article)\n```\n\nNote that the yielded query is the `BaseQuery` so it will not have any\nmethods defined on your customized query. This is usually fine since\ntypically reload only uses preloads.\n\nIf you do need to do something more custom you can manually reload:\n\n```\nuser = SaveUser.create!(name: \"Helen\")\nUserQuery.new.some_custom_preload_method.find(user.id)\n```","summary":"

Same as #reload but allows passing a block to customize the query.

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L64"},"def":{"name":"reload","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"query = yield base_query_class.new\nquery.find(id)\n"}},{"html_id":"to_param:String-instance-method","name":"to_param","doc":"For integration with Lucky\nThis allows an `Avram::Model` to be passed into a Lucky::Action to create a url/path","summary":"

For integration with Lucky This allows an Avram::Model to be passed into a Lucky::Action to create a url/path

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L71"},"def":{"name":"to_param","return_type":"String","visibility":"Public","body":"id.to_s"}}]},{"html_id":"avram/Avram/PrimaryKeyQueryable","path":"Avram/PrimaryKeyQueryable.html","kind":"module","full_name":"Avram::PrimaryKeyQueryable(T)","name":"PrimaryKeyQueryable","abstract":false,"locations":[{"filename":"src/avram/primary_key_queryable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_queryable.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/PrimaryKeyType","path":"Avram/PrimaryKeyType.html","kind":"enum","full_name":"Avram::PrimaryKeyType","name":"PrimaryKeyType","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/primary_key_type.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_type.cr#L1"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Serial","name":"Serial","value":"0"},{"id":"UUID","name":"UUID","value":"1"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"serial?-instance-method","name":"serial?","abstract":false,"location":{"filename":"src/avram/primary_key_type.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_type.cr#L2"},"def":{"name":"serial?","visibility":"Public","body":"self == Serial"}},{"html_id":"uuid?-instance-method","name":"uuid?","abstract":false,"location":{"filename":"src/avram/primary_key_type.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_type.cr#L3"},"def":{"name":"uuid?","visibility":"Public","body":"self == UUID"}}]},{"html_id":"avram/Avram/Queryable","path":"Avram/Queryable.html","kind":"module","full_name":"Avram::Queryable(T)","name":"Queryable","abstract":false,"ancestors":[{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"}],"locations":[{"filename":"src/avram/queryable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"add_preload(&block:Array(T)->Nil)-instance-method","name":"add_preload","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":273,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L273"},"def":{"name":"add_preload","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(Array(T) -> Nil)"},"visibility":"Public","body":"@preloads << block"}},{"html_id":"any?:Bool-instance-method","name":"any?","doc":"Returns `true` if at least one of the collection's members is truthy.\n\n```\n[nil, true, 99].any? # => true\n[nil, false].any? # => false\n```","summary":"

Returns true if at least one of the collection's members is truthy.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":223,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L223"},"def":{"name":"any?","return_type":"Bool","visibility":"Public","body":"cache_store.fetch(cache_key(:\"any?\"), as: Bool) do\n queryable = clone\n new_query = (queryable.query.limit(1)).select(\"1 AS one\")\n results = database.query_one?(new_query.statement, args: new_query.args, queryable: schema_class.name, as: ( Int32 | Int64))\n !results.nil?\nend"}},{"html_id":"cache_key(operation:Symbol):String-instance-method","name":"cache_key","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":"Symbol"}],"args_string":"(operation : Symbol) : String","args_html":"(operation : Symbol) : String","location":{"filename":"src/avram/queryable.cr","line_number":285,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L285"},"def":{"name":"cache_key","args":[{"name":"operation","external_name":"operation","restriction":"Symbol"}],"return_type":"String","visibility":"Public","body":"[cache_key, operation].join(':')"}},{"html_id":"cache_key:String-instance-method","name":"cache_key","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L281"},"def":{"name":"cache_key","return_type":"String","visibility":"Public","body":"[query.statement, query.args].join(':')"}},{"html_id":"cache_store-instance-method","name":"cache_store","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":277,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L277"},"def":{"name":"cache_store","visibility":"Public","body":"Fiber.current.query_cache"}},{"html_id":"database(*args,**options)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.database(*args, **options)"}},{"html_id":"database(*args,**options,&)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.database(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"delete:Int64-instance-method","name":"delete","doc":"Delete the records using the query's where clauses, or all records if no wheres are added.\n\nReturns the number of deleted records as `Int64`.\n\n```\n# DELETE FROM users WHERE age < 21\nUserQuery.new.age.lt(21).delete\n```","summary":"

Delete the records using the query's where clauses, or all records if no wheres are added.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L104"},"def":{"name":"delete","return_type":"Int64","visibility":"Public","body":"clone.delete!"}},{"html_id":"distinct:self-instance-method","name":"distinct","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L70"},"def":{"name":"distinct","return_type":"self","visibility":"Public","body":"clone.tap do |__arg0|\n __arg0.query.distinct\nend"}},{"html_id":"distinct_on(&):self-instance-method","name":"distinct_on","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L86"},"def":{"name":"distinct_on","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_distinct_on\n"}},{"html_id":"each(&)-instance-method","name":"each","doc":"Must yield this collection's elements to the block.","summary":"

Must yield this collection's elements to the block.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":265,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L265"},"def":{"name":"each","yields":1,"block_arity":1,"visibility":"Public","body":"results.each do |result|\n yield result\nend"}},{"html_id":"exec_scalar(&)-instance-method","name":"exec_scalar","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":303,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L303"},"def":{"name":"exec_scalar","yields":1,"block_arity":1,"visibility":"Public","body":"new_query = yield query.clone\ndatabase.scalar(new_query.statement, args: new_query.args, queryable: schema_class.name)\n"}},{"html_id":"first:T-instance-method","name":"first","doc":"Returns the first element in the collection. Raises `Enumerable::EmptyError`\nif the collection is empty.\n\n```\n([1, 2, 3]).first # => 1\n([] of Int32).first # raises Enumerable::EmptyError\n```","summary":"

Returns the first element in the collection.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":206,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L206"},"def":{"name":"first","return_type":"T","visibility":"Public","body":"first? || (raise(RecordNotFoundError.new(model: table_name, query: :first)))"}},{"html_id":"first?:T|Nil-instance-method","name":"first?","doc":"Returns the first element in the collection.\nWhen the collection is empty, returns `nil`.\n\n```\n([1, 2, 3]).first? # => 1\n([] of Int32).first? # => nil\n```","summary":"

Returns the first element in the collection.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":199,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L199"},"def":{"name":"first?","return_type":"T | ::Nil","visibility":"Public","body":"(with_ordered_query.limit(1)).results.first?"}},{"html_id":"group(&):self-instance-method","name":"group","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":182,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L182"},"def":{"name":"group","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_group\n"}},{"html_id":"group_count:Hash(Array(PGValue),Int64)-instance-method","name":"group_count","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":252,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L252"},"def":{"name":"group_count","return_type":"Hash(Array(PGValue), Int64)","visibility":"Public","body":"(database.query_all((query.select_direct(query.groups + [\"COUNT(*)\"])).statement, args: query.args, queryable: schema_class.name) do |rs|\n {query.groups.map do\n rs.read(PGValue)\n end, rs.read(Int64)}\nend).to_h"}},{"html_id":"join(join_clause:Avram::Join::SqlClause):self-instance-method","name":"join","abstract":false,"args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"args_string":"(join_clause : Avram::Join::SqlClause) : self","args_html":"(join_clause : Avram::Join::SqlClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":123,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L123"},"def":{"name":"join","args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg4|\n __arg4.query.join(join_clause)\nend"}},{"html_id":"last:T-instance-method","name":"last","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":219,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L219"},"def":{"name":"last","return_type":"T","visibility":"Public","body":"last? || (raise(RecordNotFoundError.new(model: table_name, query: :last)))"}},{"html_id":"last?:T|Nil-instance-method","name":"last?","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":210,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L210"},"def":{"name":"last?","return_type":"T | ::Nil","visibility":"Public","body":"(with_ordered_query.clone.tap() do |__arg19|\n __arg19.query.reverse_order\nend.limit(1)).results.first?"}},{"html_id":"limit(amount):self-instance-method","name":"limit","abstract":false,"args":[{"name":"amount","external_name":"amount","restriction":""}],"args_string":"(amount) : self","args_html":"(amount) : self","location":{"filename":"src/avram/queryable.cr","line_number":191,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L191"},"def":{"name":"limit","args":[{"name":"amount","external_name":"amount","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg17|\n __arg17.query.limit(amount)\nend"}},{"html_id":"merge_query(query_to_merge:Avram::QueryBuilder):self-instance-method","name":"merge_query","abstract":false,"args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"args_string":"(query_to_merge : Avram::QueryBuilder) : self","args_html":"(query_to_merge : Avram::QueryBuilder) : self","location":{"filename":"src/avram/queryable.cr","line_number":156,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L156"},"def":{"name":"merge_query","args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg12|\n __arg12.query.merge(query_to_merge)\nend"}},{"html_id":"none:self-instance-method","name":"none","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":187,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L187"},"def":{"name":"none","return_type":"self","visibility":"Public","body":"clone.tap do |__arg16|\n __arg16.query.where(Avram::Where::Equal.new(\"1\", \"0\"))\nend"}},{"html_id":"none?:Bool-instance-method","name":"none?","doc":"Returns `true` if all of the elements of the collection are falsey.\n\n```\n[nil, false].none? # => true\n[nil, false, true].none? # => false\n```\n\nIt's the opposite of `all?`.","summary":"

Returns true if all of the elements of the collection are falsey.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":232,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L232"},"def":{"name":"none?","return_type":"Bool","visibility":"Public","body":"!any?"}},{"html_id":"offset(amount):self-instance-method","name":"offset","abstract":false,"args":[{"name":"amount","external_name":"amount","restriction":""}],"args_string":"(amount) : self","args_html":"(amount) : self","location":{"filename":"src/avram/queryable.cr","line_number":195,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L195"},"def":{"name":"offset","args":[{"name":"amount","external_name":"amount","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg18|\n __arg18.query.offset(amount)\nend"}},{"html_id":"or(&):self-instance-method","name":"or","doc":"Run the `or` block first to grab the last WHERE clause and set its\nconjunction to OR. Then call yield to set the next set of ORs","summary":"

Run the #or block first to grab the last WHERE clause and set its conjunction to OR.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L162"},"def":{"name":"or","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"query.or(&.itself)\nyield self\n"}},{"html_id":"order_by(column,direction):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"column","external_name":"column","restriction":""},{"name":"direction","external_name":"direction","restriction":""}],"args_string":"(column, direction) : self","args_html":"(column, direction) : self","location":{"filename":"src/avram/queryable.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L167"},"def":{"name":"order_by","args":[{"name":"column","external_name":"column","restriction":""},{"name":"direction","external_name":"direction","restriction":""}],"return_type":"self","visibility":"Public","body":"begin\n direction = Avram::OrderBy::Direction.parse(direction.to_s)\n order_by(Avram::OrderBy.new(column, direction))\nrescue e : ArgumentError\n raise(\"#{e.message}. Accepted values are: :asc, :desc\")\nend"}},{"html_id":"order_by(order:Avram::OrderByClause):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"order","external_name":"order","restriction":"Avram::OrderByClause"}],"args_string":"(order : Avram::OrderByClause) : self","args_html":"(order : Avram::OrderByClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":174,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L174"},"def":{"name":"order_by","args":[{"name":"order","external_name":"order","restriction":"Avram::OrderByClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg14|\n __arg14.query.order_by(order)\nend"}},{"html_id":"preloads-instance-method","name":"preloads","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":271,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L271"},"def":{"name":"preloads","visibility":"Public","body":"@preloads"}},{"html_id":"primary_key_name(*args,**options)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.primary_key_name(*args, **options)"}},{"html_id":"primary_key_name(*args,**options,&)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.primary_key_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query:Avram::QueryBuilder-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L4"},"def":{"name":"query","return_type":"Avram::QueryBuilder","visibility":"Public","body":"if (value = @query).nil?\n @query = (Avram::QueryBuilder.new(table: table_name).select(schema_class.column_names))\nelse\n value\nend"}},{"html_id":"query=(query:Avram::QueryBuilder)-instance-method","name":"query=","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"Avram::QueryBuilder"}],"args_string":"(query : Avram::QueryBuilder)","args_html":"(query : Avram::QueryBuilder)","location":{"filename":"src/avram/queryable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L4"},"def":{"name":"query=","args":[{"name":"query","external_name":"query","restriction":"Avram::QueryBuilder"}],"visibility":"Public","body":"@query = query"}},{"html_id":"random_order:self-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":178,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L178"},"def":{"name":"random_order","return_type":"self","visibility":"Public","body":"clone.tap do |__arg15|\n __arg15.query.random_order\nend"}},{"html_id":"reset_limit:self-instance-method","name":"reset_limit","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L78"},"def":{"name":"reset_limit","return_type":"self","visibility":"Public","body":"clone.tap do |__arg2|\n __arg2.query.limit(nil)\nend"}},{"html_id":"reset_offset:self-instance-method","name":"reset_offset","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L82"},"def":{"name":"reset_offset","return_type":"self","visibility":"Public","body":"clone.tap do |__arg3|\n __arg3.query.offset(nil)\nend"}},{"html_id":"reset_order:self-instance-method","name":"reset_order","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L74"},"def":{"name":"reset_order","return_type":"self","visibility":"Public","body":"clone.tap do |__arg1|\n __arg1.query.reset_order\nend"}},{"html_id":"reset_where(&):self-instance-method","name":"reset_where","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":91,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L91"},"def":{"name":"reset_where","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_reset_where\n"}},{"html_id":"results:Array(T)-instance-method","name":"results","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":289,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L289"},"def":{"name":"results","return_type":"Array(T)","visibility":"Public","body":"cache_store.fetch(cache_key, as: Array(T)) do\n exec_query.tap do |records|\n preloads.each(&.call(records))\n end\nend"}},{"html_id":"schema_class:T.class-instance-method","name":"schema_class","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L66"},"def":{"name":"schema_class","return_type":"T.class","visibility":"Public","body":"T"}},{"html_id":"select_count:Int64-instance-method","name":"select_count","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":236,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L236"},"def":{"name":"select_count","return_type":"Int64","visibility":"Public","body":"cache_store.fetch(cache_key(:select_count), as: Int64) do\n begin\n table = \"(#{query.statement}) AS temp\"\n new_query = (Avram::QueryBuilder.new(table)).select_count\n result = database.scalar(new_query.statement, args: query.args, queryable: schema_class.name)\n result.as(Int64)\n rescue e : DB::NoResultsError\n 0_i64\n end\nend"}},{"html_id":"table_name(*args,**options)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.table_name(*args, **options)"}},{"html_id":"table_name(*args,**options,&)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.table_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"to_prepared_sql-instance-method","name":"to_prepared_sql","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":340,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L340"},"def":{"name":"to_prepared_sql","visibility":"Public","body":"query.to_prepared_sql"}},{"html_id":"to_sql-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":336,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L336"},"def":{"name":"to_sql","visibility":"Public","body":"query.to_sql"}},{"html_id":"update:Int64-instance-method","name":"update","doc":"Update the records using the query's where clauses, or all records if no wheres are added.\n\nReturns the number of records updated as `Int64`.\n\n```\n# Update all comments with the word \"spam\" as spam\nCommentQuery.new.body.ilike(\"spam\").update(spam: true)\n```","summary":"

Update the records using the query's where clauses, or all records if no wheres are added.

","abstract":true,"location":{"filename":"src/avram/queryable.cr","line_number":121,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L121"},"def":{"name":"update","return_type":"Int64","visibility":"Public","body":""}},{"html_id":"where(column:Symbol,value):self-instance-method","name":"where","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"value","external_name":"value","restriction":""}],"args_string":"(column : Symbol, value) : self","args_html":"(column : Symbol, value) : self","location":{"filename":"src/avram/queryable.cr","line_number":127,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L127"},"def":{"name":"where","args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"value","external_name":"value","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg5|\n __arg5.query.where(Avram::Where::Equal.new(column, value.to_s))\nend"}},{"html_id":"where(sql_clause:Avram::Where::SqlClause):self-instance-method","name":"where","abstract":false,"args":[{"name":"sql_clause","external_name":"sql_clause","restriction":"Avram::Where::SqlClause"}],"args_string":"(sql_clause : Avram::Where::SqlClause) : self","args_html":"(sql_clause : Avram::Where::SqlClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":139,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L139"},"def":{"name":"where","args":[{"name":"sql_clause","external_name":"sql_clause","restriction":"Avram::Where::SqlClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg7|\n __arg7.query.where(sql_clause)\nend"}},{"html_id":"where(statement:String,*bind_vars):self-instance-method","name":"where","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"args_string":"(statement : String, *bind_vars) : self","args_html":"(statement : String, *bind_vars) : self","location":{"filename":"src/avram/queryable.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L131"},"def":{"name":"where","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"splat_index":1,"return_type":"self","visibility":"Public","body":"where(statement, args: bind_vars.to_a)"}},{"html_id":"where(statement:String,*,argsbind_vars:Array):self-instance-method","name":"where","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"args_string":"(statement : String, *, args bind_vars : Array) : self","args_html":"(statement : String, *, args bind_vars : Array) : self","location":{"filename":"src/avram/queryable.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L135"},"def":{"name":"where","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"splat_index":1,"return_type":"self","visibility":"Public","body":"clone.tap do |__arg6|\n __arg6.query.where(Avram::Where::Raw.new(statement, args: bind_vars))\nend"}},{"html_id":"where(&):self-instance-method","name":"where","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L143"},"def":{"name":"where","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"cloned = clone.tap do |__arg8|\n __arg8.query.where(Avram::Where::PrecedenceStart.new)\nend\nresult = yield cloned\nif result.query.wheres.last.is_a?(Avram::Where::PrecedenceStart)\n result.clone.tap do |__arg9|\n __arg9.query.remove_last_where\n end\nelse\n cloned = result.clone.tap do |__arg10|\n __arg10.query.clear_conjunction\n end\n cloned.clone.tap do |__arg11|\n __arg11.query.where(Avram::Where::PrecedenceEnd.new)\n end\nend\n"}}],"types":[{"html_id":"avram/Avram/Queryable/PGValue","path":"Avram/Queryable/PGValue.html","kind":"alias","full_name":"Avram::Queryable::PGValue","name":"PGValue","abstract":false,"locations":[{"filename":"src/avram/queryable.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L250"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Bool | Float32 | Float64 | Int16 | Int32 | Int64 | PG::Numeric | String | Time | UUID | Nil)","aliased_html":"Bool | Float32 | Float64 | Int16 | Int32 | Int64 | PG::Numeric | String | Time | UUID | Nil","const":false,"namespace":{"html_id":"avram/Avram/Queryable","kind":"module","full_name":"Avram::Queryable(T)","name":"Queryable"},"doc":"Remove when PG::PGValue matches rs.read possibilities","summary":"

Remove when PG::PGValue matches rs.read possibilities

"}]},{"html_id":"avram/Avram/QueryBuilder","path":"Avram/QueryBuilder.html","kind":"class","full_name":"Avram::QueryBuilder","name":"QueryBuilder","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/query_builder.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(table:String|Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"::String | ::Symbol"}],"args_string":"(table : String | Symbol)","args_html":"(table : String | Symbol)","location":{"filename":"src/avram/query_builder.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L18"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"::String | ::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:Array(String|Array(String)|Array(Int32))-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L106"},"def":{"name":"args","return_type":"Array(String | Array(String) | Array(Int32))","visibility":"Public","body":"prepared_statement_values"}},{"html_id":"args_for_update(params)-instance-method","name":"args_for_update","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""}],"args_string":"(params)","args_html":"(params)","location":{"filename":"src/avram/query_builder.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L77"},"def":{"name":"args_for_update","args":[{"name":"params","external_name":"params","restriction":""}],"visibility":"Public","body":"(param_values(params)) + prepared_statement_values"}},{"html_id":"clear_conjunction-instance-method","name":"clear_conjunction","doc":"Clears the last conjunction\ne.g. users.age = $1 AND -> users.age = $1","summary":"

Clears the last conjunction e.g.

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":334,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L334"},"def":{"name":"clear_conjunction","visibility":"Public","body":"if @wheres.empty?\nelse\n @wheres.last.conjunction = Avram::Where::Conjunction::None\nend"}},{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L2"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"delete:self-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":114,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L114"},"def":{"name":"delete","return_type":"self","visibility":"Public","body":"@delete = true\nself\n"}},{"html_id":"distinct:self-instance-method","name":"distinct","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":119,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L119"},"def":{"name":"distinct","return_type":"self","visibility":"Public","body":"@distinct = true\nself\n"}},{"html_id":"distinct?:Bool-instance-method","name":"distinct?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":129,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L129"},"def":{"name":"distinct?","return_type":"Bool","visibility":"Public","body":"@distinct || has_distinct_on?"}},{"html_id":"distinct_on(column:ColumnName):self-instance-method","name":"distinct_on","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":124,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L124"},"def":{"name":"distinct_on","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@distinct_on = column\nself\n"}},{"html_id":"distinct_on:ColumnName|Nil-instance-method","name":"distinct_on","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L6"},"def":{"name":"distinct_on","return_type":"ColumnName | Nil","visibility":"Public","body":"@distinct_on"}},{"html_id":"group_by(column:ColumnName):self-instance-method","name":"group_by","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":189,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L189"},"def":{"name":"group_by","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@groups << column\nself\n"}},{"html_id":"group_sql:String|Nil-instance-method","name":"group_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":194,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L194"},"def":{"name":"group_sql","return_type":"String | ::Nil","visibility":"Public","body":"if grouped?\n \"GROUP BY \" + (groups.join(\", \"))\nend"}},{"html_id":"grouped?:Bool-instance-method","name":"grouped?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":204,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L204"},"def":{"name":"grouped?","return_type":"Bool","visibility":"Public","body":"!@groups.empty?"}},{"html_id":"groups:Array(ColumnName)-instance-method","name":"groups","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":200,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L200"},"def":{"name":"groups","return_type":"Array(ColumnName)","visibility":"Public","body":"@groups"}},{"html_id":"has_distinct_on?:Bool-instance-method","name":"has_distinct_on?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L133"},"def":{"name":"has_distinct_on?","return_type":"Bool","visibility":"Public","body":"!(!@distinct_on)"}},{"html_id":"join(join_clause:Avram::Join::SqlClause):self-instance-method","name":"join","abstract":false,"args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"args_string":"(join_clause : Avram::Join::SqlClause) : self","args_html":"(join_clause : Avram::Join::SqlClause) : self","location":{"filename":"src/avram/query_builder.cr","line_number":302,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L302"},"def":{"name":"join","args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"return_type":"self","visibility":"Public","body":"if (join_clause.to != table) && @joins.none? do |join|\n join.to == join_clause.to\nend\n @joins << join_clause\nend\nself\n"}},{"html_id":"joins:Array(Avram::Join::SqlClause)-instance-method","name":"joins","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":309,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L309"},"def":{"name":"joins","return_type":"Array(Avram::Join::SqlClause)","visibility":"Public","body":"@joins.uniq(&.to_sql)"}},{"html_id":"limit(limit:Int32|Nil):self-instance-method","name":"limit","abstract":false,"args":[{"name":"limit","external_name":"limit","restriction":"Int32 | ::Nil"}],"args_string":"(limit : Int32 | Nil) : self","args_html":"(limit : Int32 | Nil) : self","location":{"filename":"src/avram/query_builder.cr","line_number":141,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L141"},"def":{"name":"limit","args":[{"name":"limit","external_name":"limit","restriction":"Int32 | ::Nil"}],"return_type":"self","visibility":"Public","body":"@limit = limit\nself\n"}},{"html_id":"limit:Int32|Nil-instance-method","name":"limit","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L137"},"def":{"name":"limit","return_type":"Int32 | ::Nil","visibility":"Public","body":"@limit"}},{"html_id":"merge(query_to_merge:Avram::QueryBuilder)-instance-method","name":"merge","doc":"Merges the wheres, joins, and orders from the passed in query","summary":"

Merges the wheres, joins, and orders from the passed in query

","abstract":false,"args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"args_string":"(query_to_merge : Avram::QueryBuilder)","args_html":"(query_to_merge : Avram::QueryBuilder)","location":{"filename":"src/avram/query_builder.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L39"},"def":{"name":"merge","args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"visibility":"Public","body":"query_to_merge.wheres.each do |where|\n where(where)\nend\nquery_to_merge.joins.each do |join|\n join(join)\nend\nquery_to_merge.orders.each do |order|\n order_by(order)\nend\nquery_to_merge.groups.each do |group|\n group_by(group)\nend\n"}},{"html_id":"offset(offset:Int32|Nil):self-instance-method","name":"offset","abstract":false,"args":[{"name":"offset","external_name":"offset","restriction":"Int32 | ::Nil"}],"args_string":"(offset : Int32 | Nil) : self","args_html":"(offset : Int32 | Nil) : self","location":{"filename":"src/avram/query_builder.cr","line_number":149,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L149"},"def":{"name":"offset","args":[{"name":"offset","external_name":"offset","restriction":"Int32 | ::Nil"}],"return_type":"self","visibility":"Public","body":"@offset = offset\nself\n"}},{"html_id":"offset:Int32|Nil-instance-method","name":"offset","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":145,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L145"},"def":{"name":"offset","return_type":"Int32 | ::Nil","visibility":"Public","body":"@offset"}},{"html_id":"or(&block:Avram::QueryBuilder->Avram::QueryBuilder):self-instance-method","name":"or","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":322,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L322"},"def":{"name":"or","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(Avram::QueryBuilder -> Avram::QueryBuilder)"},"return_type":"self","visibility":"Public","body":"if @wheres.empty?\n raise(Avram::InvalidQueryError.new(\"Cannot call `or` before calling a `where`\"))\nend\n@wheres.last.conjunction = Avram::Where::Conjunction::Or\nblock.call(self)\n"}},{"html_id":"order_by(order:OrderByClause):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"order","external_name":"order","restriction":"OrderByClause"}],"args_string":"(order : OrderByClause) : self","args_html":"(order : OrderByClause) : self","location":{"filename":"src/avram/query_builder.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L153"},"def":{"name":"order_by","args":[{"name":"order","external_name":"order","restriction":"OrderByClause"}],"return_type":"self","visibility":"Public","body":"if ordered_randomly?\n reset_order\nend\n@orders << order\nself\n"}},{"html_id":"order_sql:String|Nil-instance-method","name":"order_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":179,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L179"},"def":{"name":"order_sql","return_type":"String | ::Nil","visibility":"Public","body":"if ordered?\n \"ORDER BY \" + (orders.join(\", \", &.prepare))\nend"}},{"html_id":"ordered?:Bool-instance-method","name":"ordered?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":271,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L271"},"def":{"name":"ordered?","return_type":"Bool","visibility":"Public","body":"!@orders.empty?"}},{"html_id":"ordered_randomly?:Bool-instance-method","name":"ordered_randomly?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":275,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L275"},"def":{"name":"ordered_randomly?","return_type":"Bool","visibility":"Public","body":"ordered? && @orders.first.is_a?(Avram::OrderByRandom)"}},{"html_id":"orders:Array(Avram::OrderByClause)-instance-method","name":"orders","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":185,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L185"},"def":{"name":"orders","return_type":"Array(Avram::OrderByClause)","visibility":"Public","body":"@orders.uniq!(&.column)"}},{"html_id":"random_order:self-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":159,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L159"},"def":{"name":"random_order","return_type":"self","visibility":"Public","body":"reset_order\n@orders << Avram::OrderByRandom.new\nself\n"}},{"html_id":"remove_last_where-instance-method","name":"remove_last_where","doc":"Removes the last `Avram::Where` to be added","summary":"

Removes the last Avram::Where to be added

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":339,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L339"},"def":{"name":"remove_last_where","visibility":"Public","body":"@wheres.pop"}},{"html_id":"reset_order:Array(Avram::OrderByClause)-instance-method","name":"reset_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":170,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L170"},"def":{"name":"reset_order","return_type":"Array(Avram::OrderByClause)","visibility":"Public","body":"@orders.clear"}},{"html_id":"reset_where(column:ColumnName):self-instance-method","name":"reset_where","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":165,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L165"},"def":{"name":"reset_where","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@wheres.reject! do |clause|\n clause.is_a?(Avram::Where::SqlClause) && (clause.column.to_s == column.to_s)\nend\nself\n"}},{"html_id":"reverse_order:self-instance-method","name":"reverse_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":174,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L174"},"def":{"name":"reverse_order","return_type":"self","visibility":"Public","body":"if ordered_randomly?\nelse\n @orders = @orders.map(&.reversed).reverse!\nend\nself\n"}},{"html_id":"select(selection:Array(ColumnName)):self-instance-method","name":"select","abstract":false,"args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"args_string":"(selection : Array(ColumnName)) : self","args_html":"(selection : Array(ColumnName)) : self","location":{"filename":"src/avram/query_builder.cr","line_number":262,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L262"},"def":{"name":"select","args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"return_type":"self","visibility":"Public","body":"@selections = selection.join(\", \") do |column|\n \"#{@table}.#{column}\"\nend\nself\n"}},{"html_id":"select(selections:String):self-instance-method","name":"select","abstract":false,"args":[{"name":"selections","external_name":"selections","restriction":"String"}],"args_string":"(selections : String) : self","args_html":"(selections : String) : self","location":{"filename":"src/avram/query_builder.cr","line_number":267,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L267"},"def":{"name":"select","args":[{"name":"selections","external_name":"selections","restriction":"String"}],"return_type":"self","visibility":"Public","body":"@selections = selections\nself\n"}},{"html_id":"select_average(column:ColumnName):self-instance-method","name":"select_average","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":220,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L220"},"def":{"name":"select_average","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"AVG(#{column})\")"}},{"html_id":"select_count:self-instance-method","name":"select_count","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":208,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L208"},"def":{"name":"select_count","return_type":"self","visibility":"Public","body":"add_aggregate(\"COUNT(*)\")"}},{"html_id":"select_direct(selection:Array(ColumnName)):self-instance-method","name":"select_direct","abstract":false,"args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"args_string":"(selection : Array(ColumnName)) : self","args_html":"(selection : Array(ColumnName)) : self","location":{"filename":"src/avram/query_builder.cr","line_number":257,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L257"},"def":{"name":"select_direct","args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"return_type":"self","visibility":"Public","body":"@selections = selection.join(\", \")\nself\n"}},{"html_id":"select_max(column:ColumnName):self-instance-method","name":"select_max","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":216,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L216"},"def":{"name":"select_max","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"MAX(#{column})\")"}},{"html_id":"select_min(column:ColumnName):self-instance-method","name":"select_min","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":212,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L212"},"def":{"name":"select_min","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"MIN(#{column})\")"}},{"html_id":"select_sum(column:ColumnName):self-instance-method","name":"select_sum","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":224,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L224"},"def":{"name":"select_sum","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"SUM(#{column})\")"}},{"html_id":"selects:Array(String)-instance-method","name":"selects","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":251,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L251"},"def":{"name":"selects","return_type":"Array(String)","visibility":"Public","body":"(@selections.split(\", \")).map() do |__arg3|\n (__arg3.split('.')).last\nend"}},{"html_id":"statement:String-instance-method","name":"statement","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L57"},"def":{"name":"statement","return_type":"String","visibility":"Public","body":"clone.statement!"}},{"html_id":"statement!:String-instance-method","name":"statement!","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L61"},"def":{"name":"statement!","return_type":"String","visibility":"Public","body":"join_sql([@delete ? delete_sql : select_sql] + sql_condition_clauses)"}},{"html_id":"statement_for_update(params,return_columnsreturning?:Bool=true)-instance-method","name":"statement_for_update","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"args_string":"(params, return_columns returning? : Bool = true)","args_html":"(params, return_columns returning? : Bool = true)","location":{"filename":"src/avram/query_builder.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L65"},"def":{"name":"statement_for_update","args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"visibility":"Public","body":"clone.statement_for_update!(params, returning?)"}},{"html_id":"statement_for_update!(params,return_columnsreturning?:Bool=true)-instance-method","name":"statement_for_update!","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"args_string":"(params, return_columns returning? : Bool = true)","args_html":"(params, return_columns returning? : Bool = true)","location":{"filename":"src/avram/query_builder.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L69"},"def":{"name":"statement_for_update!","args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"visibility":"Public","body":"sql = [\"UPDATE #{table}\", set_sql_clause(params)]\nsql = sql + sql_condition_clauses\nif returning?\n sql = sql + [\"RETURNING #{@selections}\"]\nend\njoin_sql(sql)\n"}},{"html_id":"table:TableName-instance-method","name":"table","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L5"},"def":{"name":"table","return_type":"TableName","visibility":"Public","body":"@table"}},{"html_id":"to_prepared_sql:String-instance-method","name":"to_prepared_sql","doc":"Prepares the SQL statement by combining the `args` and `statement`\nin to a single `String`","summary":"

Prepares the SQL statement by combining the #args and #statement in to a single String

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L27"},"def":{"name":"to_prepared_sql","return_type":"String","visibility":"Public","body":"params = args.map do |arg|\n \"'#{String.new((PQ::Param.encode(arg)).slice)}'\"\nend\ni = 0\nsql = statement\nsql.scan(/\\$\\d+/) do |match|\n sql = sql.sub(match[0], params[i])\n i = i + 1\nend\nsql\n"}},{"html_id":"to_sql:Array(Array(Int32)|Array(String)|String)-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L21"},"def":{"name":"to_sql","return_type":"Array(Array(Int32) | Array(String) | String)","visibility":"Public","body":"[statement] + args"}},{"html_id":"where(where_clause:Avram::Where::Condition):self-instance-method","name":"where","abstract":false,"args":[{"name":"where_clause","external_name":"where_clause","restriction":"Avram::Where::Condition"}],"args_string":"(where_clause : Avram::Where::Condition) : self","args_html":"(where_clause : Avram::Where::Condition) : self","location":{"filename":"src/avram/query_builder.cr","line_number":317,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L317"},"def":{"name":"where","args":[{"name":"where_clause","external_name":"where_clause","restriction":"Avram::Where::Condition"}],"return_type":"self","visibility":"Public","body":"@wheres << where_clause\nself\n"}},{"html_id":"wheres:Array(Avram::Where::Condition)-instance-method","name":"wheres","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":361,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L361"},"def":{"name":"wheres","return_type":"Array(Avram::Where::Condition)","visibility":"Public","body":"@wheres"}}],"types":[{"html_id":"avram/Avram/QueryBuilder/ColumnName","path":"Avram/QueryBuilder/ColumnName.html","kind":"alias","full_name":"Avram::QueryBuilder::ColumnName","name":"ColumnName","abstract":false,"locations":[{"filename":"src/avram/query_builder.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(String | Symbol)","aliased_html":"String | Symbol","const":false,"namespace":{"html_id":"avram/Avram/QueryBuilder","kind":"class","full_name":"Avram::QueryBuilder","name":"QueryBuilder"}}]},{"html_id":"avram/Avram/RecordNotFoundError","path":"Avram/RecordNotFoundError.html","kind":"class","full_name":"Avram::RecordNotFoundError","name":"RecordNotFoundError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when Avram cannot find a record by given id","summary":"

Raised when Avram cannot find a record by given id

","constructors":[{"html_id":"new(model:TableName,id:String)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"id","external_name":"id","restriction":"String"}],"args_string":"(model : TableName, id : String)","args_html":"(model : TableName, id : String)","location":{"filename":"src/avram/errors.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L31"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"id","external_name":"id","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, id)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(model:TableName,query:Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"query","external_name":"query","restriction":"Symbol"}],"args_string":"(model : TableName, query : Symbol)","args_html":"(model : TableName, query : Symbol)","location":{"filename":"src/avram/errors.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L35"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"query","external_name":"query","restriction":"Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, query)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"id:String|Nil-instance-method","name":"id","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L28"},"def":{"name":"id","return_type":"String | ::Nil","visibility":"Public","body":"@id"}},{"html_id":"model:TableName-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L27"},"def":{"name":"model","return_type":"TableName","visibility":"Public","body":"@model"}},{"html_id":"query:Symbol|Nil-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L29"},"def":{"name":"query","return_type":"Symbol | ::Nil","visibility":"Public","body":"@query"}}]},{"html_id":"avram/Avram/Rollback","path":"Avram/Rollback.html","kind":"class","full_name":"Avram::Rollback","name":"Rollback","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raise to rollback a transaction.","summary":"

Raise to rollback a transaction.

"},{"html_id":"avram/Avram/SaveOperation","path":"Avram/SaveOperation.html","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Upsert","kind":"module","full_name":"Avram::Upsert","name":"Upsert"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/MarkAsFailed","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed"},{"html_id":"avram/Avram/NestedSaveOperation","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation"},{"html_id":"avram/Avram/DatabaseValidations","kind":"module","full_name":"Avram::DatabaseValidations","name":"DatabaseValidations"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L13"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DatabaseValidations","kind":"module","full_name":"Avram::DatabaseValidations","name":"DatabaseValidations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/MarkAsFailed","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed"},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods"},{"html_id":"avram/Avram/NestedSaveOperation","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Upsert","kind":"module","full_name":"Avram::Upsert","name":"Upsert"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L44"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"T.name.underscore"}},{"html_id":"upsert(*args,**named_args)-class-method","name":"upsert","doc":"Performs a create or update depending on if there is a conflicting row in the database.\n\nSee `Avram::Upsert.upsert_lookup_columns` for full documentation and examples.","summary":"

Performs a create or update depending on if there is a conflicting row in the database.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/save_operation.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L24"},"def":{"name":"upsert","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"{% raise(\"Please use the 'upsert_lookup_columns' macro in #{@type} before using 'upsert'\") %}"}},{"html_id":"upsert!(*args,**named_args)-class-method","name":"upsert!","doc":"Performs a create or update depending on if there is a conflicting row in the database.\n\nSee `Avram::Upsert.upsert_lookup_columns` for full documentation and examples.","summary":"

Performs a create or update depending on if there is a conflicting row in the database.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/save_operation.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L24"},"def":{"name":"upsert!","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"{% raise(\"Please use the 'upsert_lookup_columns' macro in #{@type} before using 'upsert!'\") %}"}}],"constructors":[{"html_id":"new(params:Avram::Paramable)-class-method","name":"new","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/save_operation.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L48"},"def":{"name":"new","args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"visibility":"Public","body":"_ = SaveOperation(T).allocate\n_.initialize(params)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L51"},"def":{"name":"new","visibility":"Public","body":"_ = SaveOperation(T).allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"after_commit(_record:T)-instance-method","name":"after_commit","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/save_operation.cr","line_number":283,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L283"},"def":{"name":"after_commit","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"after_save(_record:T)-instance-method","name":"after_save","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/save_operation.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L281"},"def":{"name":"after_save","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"attributes-instance-method","name":"attributes","abstract":true,"location":{"filename":"src/avram/save_operation.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L42"},"def":{"name":"attributes","visibility":"Public","body":""}},{"html_id":"before_save-instance-method","name":"before_save","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":279,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L279"},"def":{"name":"before_save","visibility":"Public","body":""}},{"html_id":"changes:Hash(Symbol,String|Nil)-instance-method","name":"changes","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L193"},"def":{"name":"changes","return_type":"Hash(Symbol, String | ::Nil)","visibility":"Public","body":"attributes_to_hash(column_attributes.select(&.changed?))"}},{"html_id":"created?:Bool-instance-method","name":"created?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L133"},"def":{"name":"created?","return_type":"Bool","visibility":"Public","body":"saved? && new_record?"}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"database(*args,**options)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.database(*args, **options)"}},{"html_id":"database(*args,**options,&)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.database(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"generic_attributes:Array(Avram::GenericAttribute)-instance-method","name":"generic_attributes","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L64"},"def":{"name":"generic_attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"attributes.map do |attr|\n Avram::GenericAttribute.new(name: attr.name, param: attr.param.try(&.to_s), value: attr.value.try(&.to_s), original_value: attr.original_value.try(&.to_s), param_key: attr.param_key, errors: attr.errors)\nend"}},{"html_id":"new_record?:Bool-instance-method","name":"new_record?","doc":"`#persisted?` always returns `true` in `after_*` hooks, whether\na new record was created, or an existing one was updated.\n\nThis method should always return `true` for a create or `false`\nfor an update, independent of the stage we are at in the operation.","summary":"

#persisted? always returns true in after_* hooks, whether a new record was created, or an existing one was updated.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L263"},"def":{"name":"new_record?","return_type":"Bool","visibility":"Public","body":"({{ (T.constant(:PRIMARY_KEY_NAME)).id }}).value.nil?"}},{"html_id":"params:Avram::Paramable-instance-method","name":"params","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L39"},"def":{"name":"params","return_type":"Avram::Paramable","visibility":"Public","body":"@params"}},{"html_id":"persisted?:Bool-instance-method","name":"persisted?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":254,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L254"},"def":{"name":"persisted?","return_type":"Bool","visibility":"Public","body":"!(!record_id)"}},{"html_id":"primary_key_name(*args,**options)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.primary_key_name(*args, **options)"}},{"html_id":"primary_key_name(*args,**options,&)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.primary_key_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"run_default_validations:Nil-instance-method","name":"run_default_validations","doc":"Runs all required validations for required types\nas well as any additional valitaions the type needs to run\ne.g. polymorphic validations","summary":"

Runs all required validations for required types as well as any additional valitaions the type needs to run e.g.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":100,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L100"},"def":{"name":"run_default_validations","return_type":"Nil","visibility":"Public","body":"validate_required(*required_attributes)\ndefault_validations\n"}},{"html_id":"save:Bool-instance-method","name":"save","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":212,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L212"},"def":{"name":"save","return_type":"Bool","visibility":"Public","body":"before_save\nif valid?\n transaction_committed = database.transaction do\n if (!changes.empty?) || (!persisted?)\n insert_or_update\n end\n after_save(record.as(T))\n true\n end\n if transaction_committed\n self.save_status = OperationStatus::Saved\n after_commit(record.as(T))\n Avram::Events::SaveSuccessEvent.publish(operation_class: self.class.name, attributes: generic_attributes)\n true\n else\n mark_as_failed\n publish_save_failed_event\n false\n end\nelse\n mark_as_failed\n publish_save_failed_event\n false\nend\n"}},{"html_id":"save!:T-instance-method","name":"save!","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":242,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L242"},"def":{"name":"save!","return_type":"T","visibility":"Public","body":"if save\n record.as(T)\nelse\n raise(Avram::InvalidOperationError.new(operation: self))\nend"}},{"html_id":"save_failed?:Bool-instance-method","name":"save_failed?","doc":"Return true if the operation has run and the record failed to save","summary":"

Return true if the operation has run and the record failed to save

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L142"},"def":{"name":"save_failed?","return_type":"Bool","visibility":"Public","body":"save_status == OperationStatus::SaveFailed"}},{"html_id":"save_status:OperationStatus-instance-method","name":"save_status","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L40"},"def":{"name":"save_status","return_type":"OperationStatus","visibility":"Public","body":"@save_status"}},{"html_id":"save_status=(save_status:OperationStatus)-instance-method","name":"save_status=","abstract":false,"args":[{"name":"save_status","external_name":"save_status","restriction":"OperationStatus"}],"args_string":"(save_status : OperationStatus)","args_html":"(save_status : OperationStatus)","location":{"filename":"src/avram/save_operation.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L40"},"def":{"name":"save_status=","args":[{"name":"save_status","external_name":"save_status","restriction":"OperationStatus"}],"visibility":"Public","body":"@save_status = save_status"}},{"html_id":"saved?:Bool-instance-method","name":"saved?","doc":"Returns true if the operation has run and saved the record successfully","summary":"

Returns true if the operation has run and saved the record successfully

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":129,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L129"},"def":{"name":"saved?","return_type":"Bool","visibility":"Public","body":"save_status == OperationStatus::Saved"}},{"html_id":"table_name(*args,**options)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.table_name(*args, **options)"}},{"html_id":"table_name(*args,**options,&)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.table_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"update!:T-instance-method","name":"update!","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L250"},"def":{"name":"update!","return_type":"T","visibility":"Public","body":"save!"}},{"html_id":"updated?:Bool-instance-method","name":"updated?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L137"},"def":{"name":"updated?","return_type":"Bool","visibility":"Public","body":"saved? && (!new_record?)"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Runs required validation,\nthen returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Runs required validation, then returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":120,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L120"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"run_default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"add_cast_value_methods(columns)-macro","name":"add_cast_value_methods","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""}],"args_string":"(columns)","args_html":"(columns)","location":{"filename":"src/avram/save_operation.cr","line_number":197,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L197"},"def":{"name":"add_cast_value_methods","args":[{"name":"columns","external_name":"columns","restriction":""}],"visibility":"Public","body":" private def cast_value(value : Nil)\n nil\n \nend\n\n \n{% for column in columns %}\n # pass `value` to it's `Lucky.to_db` for parsing.\n # In most cases, that's just calling `to_s`, but in the case of an Array,\n # `value` is passed to `PQ::Param` to properly encode `[true]` to `{t}`, etc...\n private def cast_value(value : {{ column[:type] }})\n value.class.adapter.to_db(value.as({{ column[:type] }}))\n end\n {% end %}\n\n \n"}},{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}},{"html_id":"permit_columns(*attribute_names)-macro","name":"permit_columns","abstract":false,"args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"args_string":"(*attribute_names)","args_html":"(*attribute_names)","location":{"filename":"src/avram/save_operation.cr","line_number":146,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L146"},"def":{"name":"permit_columns","args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"splat_index":0,"visibility":"Public","body":" \n{% for attribute_name in attribute_names %}\n {% if attribute_name.is_a?(TypeDeclaration) %}\n {% raise(\"Must use a Symbol or a bare word in 'permit_columns'. Instead, got: #{attribute_name}\\n\\nTry this...\\n\\n ▸ permit_columns #{attribute_name.var}\\n\") %}\n {% end %}\n {% if attribute_name.is_a?(SymbolLiteral) || attribute_name.is_a?(Call) %}{% else %}\n {% raise(\"Must use a Symbol or a bare word in 'permit_columns'. Instead, got: #{attribute_name}\\n\\nTry this...\\n\\n ▸ Use a bare word (recommended): 'permit_columns name'\\n ▸ Use a Symbol: 'permit_columns :name'\\n\") %}\n {% end %}\n {% if COLUMN_ATTRIBUTES.any? do |attribute|\n attribute[:name].id == attribute_name.id\nend %}\n def {{ attribute_name.id }}\n _{{ attribute_name.id }}.permitted\n end\n\n @@permitted_param_keys << \"{{ attribute_name.id }}\"\n {% else %}\n {% raise(\"Can't permit '#{attribute_name}' because the column has not been defined on the model for #{@type}.\\n\\nTry this...\\n\\n ▸ Make sure you spelled the column correctly.\\n ▸ Add the column to the model if it doesn't exist.\\n ▸ Use 'attribute' if you want an attribute that is not saved to the database.\\n\") %}\n {% end %}\n {% end %}\n\n \n"}},{"html_id":"skip_default_validations-macro","name":"skip_default_validations","doc":"This allows you to skip the default validations\nwhich may be used as an escape hatch when you want\nto allow storing an empty string value.","summary":"

This allows you to skip the default validations which may be used as an escape hatch when you want to allow storing an empty string value.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":112,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L112"},"def":{"name":"skip_default_validations","visibility":"Public","body":" def run_default_validations\n \nend\n \n"}}],"types":[{"html_id":"avram/Avram/SaveOperation/OperationStatus","path":"Avram/SaveOperation/OperationStatus.html","kind":"enum","full_name":"Avram::SaveOperation::OperationStatus","name":"OperationStatus","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L27"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Saved","name":"Saved","value":"0"},{"id":"SaveFailed","name":"SaveFailed","value":"1"},{"id":"Unperformed","name":"Unperformed","value":"2"}],"namespace":{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"},"instance_methods":[{"html_id":"save_failed?-instance-method","name":"save_failed?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L29"},"def":{"name":"save_failed?","visibility":"Public","body":"self == SaveFailed"}},{"html_id":"saved?-instance-method","name":"saved?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L28"},"def":{"name":"saved?","visibility":"Public","body":"self == Saved"}},{"html_id":"unperformed?-instance-method","name":"unperformed?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L30"},"def":{"name":"unperformed?","visibility":"Public","body":"self == Unperformed"}}]}]},{"html_id":"avram/Avram/SaveOperationTemplate","path":"Avram/SaveOperationTemplate.html","kind":"class","full_name":"Avram::SaveOperationTemplate","name":"SaveOperationTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, *args, **named_args)","args_html":"(type, columns, *args, **named_args)","location":{"filename":"src/avram/save_operation_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":2,"visibility":"Public","body":" \n# This makes it easy for plugins and extensions to use the base SaveOperation\n\n def base_query_class : ::\n{{ type }}\n::BaseQuery.class\n ::\n{{ type }}\n::BaseQuery\n \nend\n\n def save_operation_class : ::\n{{ type }}\n::SaveOperation.class\n ::\n{{ type }}\n::SaveOperation\n \nend\n\n class ::\n{{ type }}\n::SaveOperation < Avram::SaveOperation(\n{{ type }}\n)\n \n{% primary_key_type = type.resolve.constant(\"PRIMARY_KEY_TYPE\") %}\n\n\n macro inherited\n FOREIGN_KEY = \"\n{{ type.stringify.underscore.id }}\n_id\"\n \nend\n\n add_column_attributes(\n{{ columns }}\n)\n add_cast_value_methods(\n{{ columns }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/SchemaEnforcer","path":"Avram/SchemaEnforcer.html","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer","abstract":false,"locations":[{"filename":"src/avram/schema_enforcer.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer.cr#L4"},{"filename":"src/avram/schema_enforcer/validation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/validation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ALL_MODELS","name":"ALL_MODELS","value":"[] of Avram::Model.class"},{"id":"MODELS_TO_SKIP","name":"MODELS_TO_SKIP","value":"[] of String"}],"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"ensure_correct_column_mappings!-class-method","name":"ensure_correct_column_mappings!","abstract":false,"location":{"filename":"src/avram/schema_enforcer.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer.cr#L22"},"def":{"name":"ensure_correct_column_mappings!","visibility":"Public","body":"{% if !ALL_MODELS.empty? %}\n ALL_MODELS.each do |model|\n model.ensure_correct_column_mappings!\n end\n {% end %}"}}],"macros":[{"html_id":"setup(type,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/schema_enforcer.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer.cr#L8"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" class_getter schema_enforcer_validations = [] of Avram::SchemaEnforcer::Validation\n\n def self.ensure_correct_column_mappings!\n return if Avram::SchemaEnforcer::MODELS_TO_SKIP.includes?(self.name)\n\n schema_enforcer_validations.each(&.validate!)\n \nend\n\n \n{% if !type.resolve.abstract? %}\n {% Avram::SchemaEnforcer::ALL_MODELS << type %}\n {% end %}\n\n \n"}},{"html_id":"skip_schema_enforcer-macro","name":"skip_schema_enforcer","abstract":false,"location":{"filename":"src/avram/schema_enforcer.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer.cr#L30"},"def":{"name":"skip_schema_enforcer","visibility":"Public","body":" \n{% Avram::SchemaEnforcer::MODELS_TO_SKIP << @type.stringify %}\n\n \n"}}],"types":[{"html_id":"avram/Avram/SchemaEnforcer/EnsureExistingTable","path":"Avram/SchemaEnforcer/EnsureExistingTable.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureExistingTable","name":"EnsureExistingTable","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_existing_table.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_existing_table.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_existing_table.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_existing_table.cr#L2"},"def":{"name":"validate!","visibility":"Public","body":"if table_missing?\n best_match = Levenshtein::Finder.find(table_name, database_info.table_names, tolerance: 2)\n message = String.build do |string|\n string << \"#{model_class.name.colorize.bold} wants to use the '#{table_name.colorize.bold}' table but it is missing.\\n\"\n if best_match\n string << \"\\nIf you meant for #{model_class.name.colorize.bold} to use the '#{best_match.colorize.yellow.bold}' table, try this...\\n\\n ▸ Change the table name in #{model_class.name.colorize.bold}:\\n\\n table :#{best_match.colorize.bold} do\\n # ..columns\\n end\\n\"\n end\n string << \"\\nIf you need to create the '#{table_name}' table...\\n\\n ▸ Generate a migration:\\n\\n lucky gen.migration Create#{Wordsmith::Inflector.pluralize(model_class.name)}\\n\\n ▸ Create the table in the migration:\\n\\n create table_for(#{model_class.name}) do/end\\n\"\n string << \"\\nOr, you can skip schema checks for this model:\\n\\n class #{model_class.name} < BaseModel\\n # Great for models used in migrations, or for legacy schemas\\n skip_schema_enforcer\\n end\\n\\n\"\n end\n raise(Avram::SchemaMismatchError.new(message))\nend"}}]},{"html_id":"avram/Avram/SchemaEnforcer/EnsureMatchingColumns","path":"Avram/SchemaEnforcer/EnsureMatchingColumns.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureMatchingColumns","name":"EnsureMatchingColumns","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_matching_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"constructors":[{"html_id":"new(model_class,check_required:Bool)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":""},{"name":"check_required","external_name":"check_required","restriction":"::Bool"}],"args_string":"(model_class, check_required : Bool)","args_html":"(model_class, check_required : Bool)","location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_matching_columns.cr#L11"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":""},{"name":"check_required","external_name":"check_required","restriction":"::Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class, check_required)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(model_class)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":""}],"args_string":"(model_class)","args_html":"(model_class)","location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_matching_columns.cr#L7"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_matching_columns.cr#L14"},"def":{"name":"validate!","visibility":"Public","body":"model_class.columns.each do |attribute|\n check_column_matches(attribute)\nend\nif matching_error?\n message = (@missing_columns + @optional_attribute_errors) + @required_attribute_errors\n raise(Avram::SchemaMismatchError.new(message.join(\"\\n\\n\")))\nend\n"}}]},{"html_id":"avram/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault","path":"Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureUUIDPrimaryKeyHasDefault","name":"EnsureUUIDPrimaryKeyHasDefault","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"instance_methods":[{"html_id":"has_primary_key?:Bool-instance-method","name":"has_primary_key?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L25"},"def":{"name":"has_primary_key?","return_type":"Bool","visibility":"Public","body":"!model_class.primary_key_name.nil?"}},{"html_id":"missing_column_default?:Bool-instance-method","name":"missing_column_default?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L33"},"def":{"name":"missing_column_default?","return_type":"Bool","visibility":"Public","body":"primary_key_info.column_default.nil?"}},{"html_id":"primary_key_info:Avram::Database::ColumnInfo-instance-method","name":"primary_key_info","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L37"},"def":{"name":"primary_key_info","return_type":"Avram::Database::ColumnInfo","visibility":"Public","body":"pkey_name = model_class.primary_key_name.to_s\n(table_info.column(pkey_name)).as(Avram::Database::ColumnInfo)\n"}},{"html_id":"uuid_primary_key?:Bool-instance-method","name":"uuid_primary_key?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L29"},"def":{"name":"uuid_primary_key?","return_type":"Bool","visibility":"Public","body":"primary_key_info.data_type == \"uuid\""}},{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L2"},"def":{"name":"validate!","visibility":"Public","body":"if (has_primary_key? && uuid_primary_key?) && missing_column_default?\nelse\n return\nend\nmessage = \"Primary key on the '#{table_name.colorize.bold}' table has the type set as uuid but does not have a default value.\\n\\nTo add a default value...\\n\\n ▸ Generate a migration:\\n\\n lucky gen.migration AddDefaultTo#{Wordsmith::Inflector.pluralize(model_class.name)}PrimaryKey\\n\\n ▸ Enable a Postgres extension to generate uuids if one is not already available in the migration:\\n\\n enable_extension \\\"pgcrypto\\\" # https://www.postgresql.org/docs/current/pgcrypto.html\\n\\n ▸ Update the primary key column to have a default value in the migration:\\n\\n execute(\\\"ALTER TABLE #{table_name.colorize.bold} ALTER COLUMN #{primary_key_info.column_name.colorize.bold} SET DEFAULT gen_random_uuid();\\\")\"\nraise(Avram::SchemaMismatchError.new(message))\n"}}]},{"html_id":"avram/Avram/SchemaEnforcer/Validation","path":"Avram/SchemaEnforcer/Validation.html","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/validation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/validation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/SchemaEnforcer/EnsureExistingTable","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureExistingTable","name":"EnsureExistingTable"},{"html_id":"avram/Avram/SchemaEnforcer/EnsureMatchingColumns","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureMatchingColumns","name":"EnsureMatchingColumns"},{"html_id":"avram/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureUUIDPrimaryKeyHasDefault","name":"EnsureUUIDPrimaryKeyHasDefault"}],"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"constructors":[{"html_id":"new(model_class:::Avram::Model.class)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":"::Avram::Model.class"}],"args_string":"(model_class : ::Avram::Model.class)","args_html":"(model_class : ::Avram::Model.class)","location":{"filename":"src/avram/schema_enforcer/validation.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/validation.cr#L4"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":"::Avram::Model.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":true,"location":{"filename":"src/avram/schema_enforcer/validation.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/validation.cr#L7"},"def":{"name":"validate!","visibility":"Public","body":""}}]}]},{"html_id":"avram/Avram/SchemaMismatchError","path":"Avram/SchemaMismatchError.html","kind":"class","full_name":"Avram::SchemaMismatchError","name":"SchemaMismatchError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L11"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised by Avram::SchemaEnforcer when columns or tables don't match the database.","summary":"

Raised by Avram::SchemaEnforcer when columns or tables don't match the database.

"},{"html_id":"avram/Avram/Slugify","path":"Avram/Slugify.html","kind":"module","full_name":"Avram::Slugify","name":"Slugify","abstract":false,"locations":[{"filename":"src/avram/slugify.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"extended_modules":[{"html_id":"avram/Avram/Slugify","kind":"module","full_name":"Avram::Slugify","name":"Slugify"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Converts a column value to a URL safe String that\ncan be used as a parameter for finding records. A\n`slug` is a `String` column you define on your model\nthat will be passed through the URL instead of an `id`.\n\ne.g. /articles/1 -> /articles/how-to-slugify\n\nUse this module in your `SaveOperation#before_save`.\n\n```\nclass Article < BaseModel\n table do\n column title : String\n column slug : String\n end\nend\n\nclass SaveArticle < Article::SaveOperation\n before_save do\n Avram::Slugify.set slug,\n using: title,\n query: ArticleQuery.new\n end\nend\n```\n\nThe `set` method will use `query` to determine if that `slug` has already\nbeen used, and fall back to appending a random UUID to the end. If the `slug`\nvalue has already been set, then no new slug will be generated. If you just need\nthe value to set on your own, you can use the `generate` method as an escape hatch.\nThis method returns the String value used in the `set` method.\n\n```\nclass SaveArticle < Article::SaveOperation\n before_save do\n if title.changed?\n slug_value = Avram::Slugify.generate(slug,\n using: title,\n query: ArticleQuery.new)\n slug.value = slug_value\n end\n end\nend\n```","summary":"

Converts a column value to a URL safe String that can be used as a parameter for finding records.

","instance_methods":[{"html_id":"generate(slug:Avram::Attribute(String),usingslug_candidate:Avram::Attribute(String)|String,query:Avram::Queryable):String|Nil-instance-method","name":"generate","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : String | Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : String | Nil","location":{"filename":"src/avram/slugify.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L62"},"def":{"name":"generate","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"String | ::Nil","visibility":"Public","body":"generate(slug, [slug_candidate], query)"}},{"html_id":"generate(slug:Avram::Attribute(String),usingslug_candidates:Array(String|Avram::Attribute(String)|Array(Avram::Attribute(String))),query:Avram::Queryable):String|Nil-instance-method","name":"generate","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : String | Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : String | Nil","location":{"filename":"src/avram/slugify.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L68"},"def":{"name":"generate","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"String | ::Nil","visibility":"Public","body":"slug_candidates = format_candidates(slug_candidates)\nresult = slug_candidates.find do |candidate|\n (query.where(slug.name, candidate)).none?\nend\nif result\n result\nelse\n if candidate = slug_candidates.first?\n \"#{candidate}-#{UUID.random}\"\n end\nend\n"}},{"html_id":"set(slug:Avram::Attribute(String),usingslug_candidate:Avram::Attribute(String)|String,query:Avram::Queryable):Nil-instance-method","name":"set","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : Nil","location":{"filename":"src/avram/slugify.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L48"},"def":{"name":"set","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"Nil","visibility":"Public","body":"set(slug, [slug_candidate], query)"}},{"html_id":"set(slug:Avram::Attribute(String),usingslug_candidates:Array(String|Avram::Attribute(String)|Array(Avram::Attribute(String))),query:Avram::Queryable):Nil-instance-method","name":"set","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : Nil","location":{"filename":"src/avram/slugify.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L54"},"def":{"name":"set","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"Nil","visibility":"Public","body":"if slug.value.blank?\n slug.value = generate(slug, slug_candidates, query)\nend"}}]},{"html_id":"avram/Avram/SoftDelete","path":"Avram/SoftDelete.html","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete","abstract":false,"locations":[{"filename":"src/avram/soft_delete/model.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/SoftDelete/Model","path":"Avram/SoftDelete/Model.html","kind":"module","full_name":"Avram::SoftDelete::Model","name":"Model","abstract":false,"locations":[{"filename":"src/avram/soft_delete/model.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SoftDelete","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete"},"doc":" table do\n column soft_deleted_at : Time?\n end\nend\n```\n\nYou should also add the `Avram::SoftDeleteQuery` to your query\n\n```\nclass ArticleQuery < Article::BaseQuery\n include Avram::SoftDelete::Query\nend\n```","summary":"

table do column soft_deleted_at : Time? end end ```

","instance_methods":[{"html_id":"restore:self-instance-method","name":"restore","doc":"Restore the record\n\nThis will set `soft_deleted_at` to `nil`","summary":"

Restore the record

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L38"},"def":{"name":"restore","return_type":"self","visibility":"Public","body":"save_operation_class.update!(self, soft_deleted_at: nil)"}},{"html_id":"save_operation_class-instance-method","name":"save_operation_class","abstract":true,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L42"},"def":{"name":"save_operation_class","visibility":"Public","body":""}},{"html_id":"soft_delete:self-instance-method","name":"soft_delete","doc":"Soft delete the record\n\nThis will set `soft_deleted_at` to the current time (`Time.utc`)","summary":"

Soft delete the record

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L31"},"def":{"name":"soft_delete","return_type":"self","visibility":"Public","body":"save_operation_class.update!(self, soft_deleted_at: Time.utc)"}},{"html_id":"soft_deleted?:Bool-instance-method","name":"soft_deleted?","doc":"Returns true if soft deleted, otherwise false\n\nIf the `soft_deleted_at` has a time value the record is \"soft deleted\".\nIf `soft_deleted_at` is `nil` the record has not been deleted yet.","summary":"

Returns true if soft deleted, otherwise false

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L48"},"def":{"name":"soft_deleted?","return_type":"Bool","visibility":"Public","body":"soft_deleted_at.present?"}},{"html_id":"soft_deleted_at:Time|Nil-instance-method","name":"soft_deleted_at","abstract":true,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L52"},"def":{"name":"soft_deleted_at","return_type":"Time | ::Nil","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/SoftDelete/Query","path":"Avram/SoftDelete/Query.html","kind":"module","full_name":"Avram::SoftDelete::Query","name":"Query","abstract":false,"locations":[{"filename":"src/avram/soft_delete/query.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L12"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SoftDelete","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete"},"doc":"Add methods for querying/updating soft deleted and kept records.\n\nFirst include the model module in your model: `Avram::SoftDelete::Model`\n\nThen add this module your query\n\n```\nclass ArticleQuery < Article::BaseQuery\n include Avram::SoftDelete::Query\nend\n```","summary":"

Add methods for querying/updating soft deleted and kept records.

","instance_methods":[{"html_id":"only_kept-instance-method","name":"only_kept","doc":"Only return kept records\n\nKept records are considered \"kept/not soft deleted\" if the\n`soft_deleted_at` column is `nil`","summary":"

Only return kept records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L17"},"def":{"name":"only_kept","visibility":"Public","body":"reset_where(&.soft_deleted_at).soft_deleted_at.is_nil"}},{"html_id":"only_soft_deleted-instance-method","name":"only_soft_deleted","doc":"Only return soft deleted records\n\nSoft deleted records are considered \"soft deleted\" if the\n`soft_deleted_at` column has a non-nil value","summary":"

Only return soft deleted records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L25"},"def":{"name":"only_soft_deleted","visibility":"Public","body":"reset_where(&.soft_deleted_at).soft_deleted_at.is_not_nil"}},{"html_id":"restore:Int64-instance-method","name":"restore","doc":"Bulk restore records\n\n## Example\n\nThis will restore `Article` records updated in the last week:\n\n```\nArticleQuery.new.updated_at.gt(1.week.ago).restore\n```","summary":"

Bulk restore records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L60"},"def":{"name":"restore","return_type":"Int64","visibility":"Public","body":"only_soft_deleted.update(soft_deleted_at: nil)"}},{"html_id":"soft_delete-instance-method","name":"soft_delete","doc":"Bulk soft delete records\n\n## Example\n\nThis will soft delete all `Article` record older than 1 year:\n\n```\nArticleQuery.new.created_at.lt(1.year.ago).soft_delete\n```","summary":"

Bulk soft delete records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L47"},"def":{"name":"soft_delete","visibility":"Public","body":"only_kept.update(soft_deleted_at: Time.utc)"}},{"html_id":"soft_deleted_at-instance-method","name":"soft_deleted_at","abstract":true,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L64"},"def":{"name":"soft_deleted_at","visibility":"Public","body":""}},{"html_id":"with_soft_deleted-instance-method","name":"with_soft_deleted","doc":"Returns all records\n\nThis works be removing where clauses for the `soft_deleted_at` column.\nThat means you can do `MyQuery.new.only_kept.with_soft_deleted` and you\nwill get all records, not just the kept ones.","summary":"

Returns all records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L34"},"def":{"name":"with_soft_deleted","visibility":"Public","body":"reset_where(&.soft_deleted_at)"}}]}]},{"html_id":"avram/Avram/SpecHelper","path":"Avram/SpecHelper.html","kind":"module","full_name":"Avram::SpecHelper","name":"SpecHelper","abstract":false,"locations":[{"filename":"src/avram/spec_helper.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/spec_helper.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"NO_CASCADE","name":"NO_CASCADE","value":"\"no_cascade\""},{"id":"NO_RESTART_IDENTITY","name":"NO_RESTART_IDENTITY","value":"\"no_restart_identity\""},{"id":"TRUNCATE","name":"TRUNCATE","value":"\"truncate\""}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"wrap_spec_in_transaction(spec:Spec::Example::Procsy,*databases)-class-method","name":"wrap_spec_in_transaction","abstract":false,"args":[{"name":"spec","external_name":"spec","restriction":"Spec::Example::Procsy"},{"name":"databases","external_name":"databases","restriction":""}],"args_string":"(spec : Spec::Example::Procsy, *databases)","args_html":"(spec : Spec::Example::Procsy, *databases)","location":{"filename":"src/avram/spec_helper.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/spec_helper.cr#L12"},"def":{"name":"wrap_spec_in_transaction","args":[{"name":"spec","external_name":"spec","restriction":"Spec::Example::Procsy"},{"name":"databases","external_name":"databases","restriction":""}],"splat_index":1,"visibility":"Public","body":"if named_args = use_truncation?(spec)\n spec.run\n return databases.each(&.truncate(**named_args))\nend\ntracked_transactions = [] of DB::Transaction\ndatabases.each do |database|\n database.lock_id = Fiber.current.object_id\n database.connections.values.each do |conn|\n tracked_transactions << conn.begin_transaction.tap(&._avram_joinable = false)\n end\n database.setup_connection do |conn|\n tracked_transactions << conn.begin_transaction.tap(&._avram_joinable = false)\n end\nend\nspec.run\ntracked_transactions.each do |transaction|\n if transaction.closed? || transaction.connection.closed?\n next\n end\n transaction.rollback\n transaction.connection.release\nend\ntracked_transactions.clear\ndatabases.each do |database|\n database.connections.clear\n database.setup_connection do\n end\nend\n"}}],"macros":[{"html_id":"use_transactional_specs(*databases)-macro","name":"use_transactional_specs","abstract":false,"args":[{"name":"databases","external_name":"databases","restriction":""}],"args_string":"(*databases)","args_html":"(*databases)","location":{"filename":"src/avram/spec_helper.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/spec_helper.cr#L6"},"def":{"name":"use_transactional_specs","args":[{"name":"databases","external_name":"databases","restriction":""}],"splat_index":0,"visibility":"Public","body":" Spec.around_each do |spec|\n Avram::SpecHelper.wrap_spec_in_transaction(spec, \n{{ databases.splat }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/TableFor","path":"Avram/TableFor.html","kind":"module","full_name":"Avram::TableFor","name":"TableFor","abstract":false,"locations":[{"filename":"src/avram/table_for.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/table_for.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"table_for(model)-macro","name":"table_for","doc":"Returns a `Symbol` representing the table name\nof the `model` passed in.\ne.g. `User` => `:users`","summary":"

Returns a Symbol representing the table name of the model passed in.

","abstract":false,"args":[{"name":"model","external_name":"model","restriction":""}],"args_string":"(model)","args_html":"(model)","location":{"filename":"src/avram/table_for.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/table_for.cr#L5"},"def":{"name":"table_for","args":[{"name":"model","external_name":"model","restriction":""}],"visibility":"Public","body":" Wordsmith::Inflector.pluralize(\n{{ model.stringify }}\n.gsub(\"::\", \"\").underscore)\n \n"}}]},{"html_id":"avram/Avram/TableName","path":"Avram/TableName.html","kind":"alias","full_name":"Avram::TableName","name":"TableName","abstract":false,"locations":[{"filename":"src/avram.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L39"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(String | Symbol)","aliased_html":"String | Symbol","const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Type","path":"Avram/Type.html","kind":"module","full_name":"Avram::Type","name":"Type","abstract":false,"locations":[{"filename":"src/avram/type.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Uploadable/Lucky","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky"},{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"},{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"},{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"},{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"},{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"},{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"},{"html_id":"avram/JSON/Any/Lucky","kind":"module","full_name":"JSON::Any::Lucky","name":"Lucky"},{"html_id":"avram/JSON/Serializable/Lucky","kind":"module","full_name":"JSON::Serializable::Lucky(T)","name":"Lucky"},{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"},{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"},{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"},{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"from_db!(value)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L6"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"parse!(value)"}},{"html_id":"parse(value:Nil)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Nil"}],"args_string":"(value : Nil)","args_html":"(value : Nil)","location":{"filename":"src/avram/type.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L10"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Nil"}],"visibility":"Public","body":"SuccessfulCast(Nil).new(nil)"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/type.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L14"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"casts = values.map do |value|\n parse(value)\nend\nif casts.all?(SuccessfulCast)\n values = casts.map do |c|\n (c.as(SuccessfulCast)).value\n end\n parse(values)\nelse\n FailedCast.new\nend\n"}},{"html_id":"parse!(value)-instance-method","name":"parse!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L24"},"def":{"name":"parse!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"((parse(value)).as(SuccessfulCast)).value"}},{"html_id":"to_db(value:Nil)-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Nil"}],"args_string":"(value : Nil)","args_html":"(value : Nil)","location":{"filename":"src/avram/type.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L28"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Nil"}],"visibility":"Public","body":"nil"}},{"html_id":"to_db!(value)-instance-method","name":"to_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L32"},"def":{"name":"to_db!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"parsed_value = parse!(value)\nto_db(parsed_value)\n"}}],"types":[{"html_id":"avram/Avram/Type/FailedCast","path":"Avram/Type/FailedCast.html","kind":"class","full_name":"Avram::Type::FailedCast","name":"FailedCast","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/type.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L44"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"},"instance_methods":[{"html_id":"value-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/type.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L45"},"def":{"name":"value","visibility":"Public","body":"nil"}}]},{"html_id":"avram/Avram/Type/SuccessfulCast","path":"Avram/Type/SuccessfulCast.html","kind":"class","full_name":"Avram::Type::SuccessfulCast(T)","name":"SuccessfulCast","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/type.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L37"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"},"constructors":[{"html_id":"new(value:T)-class-method","name":"new","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T)","args_html":"(value : T)","location":{"filename":"src/avram/type.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L40"},"def":{"name":"new","args":[{"name":"value","external_name":"value","restriction":"T"}],"visibility":"Public","body":"_ = SuccessfulCast(T).allocate\n_.initialize(value)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"value-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/type.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L38"},"def":{"name":"value","visibility":"Public","body":"@value"}}]}]},{"html_id":"avram/Avram/UnsupportedQueryError","path":"Avram/UnsupportedQueryError.html","kind":"class","full_name":"Avram::UnsupportedQueryError","name":"UnsupportedQueryError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":76,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L76"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when an unimplemented or deprecated query is made.","summary":"

Raised when an unimplemented or deprecated query is made.

","constructors":[{"html_id":"new(message:String)-class-method","name":"new","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(message : String)","args_html":"(message : String)","location":{"filename":"src/avram/errors.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L77"},"def":{"name":"new","args":[{"name":"message","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Uploadable","path":"Avram/Uploadable.html","kind":"module","full_name":"Avram::Uploadable","name":"Uploadable","abstract":false,"locations":[{"filename":"src/avram/uploadable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Lucky/UploadedFile","kind":"class","full_name":"Lucky::UploadedFile","name":"UploadedFile"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/uploadable.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L9"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","doc":"This should test if the filename is a blank string.","summary":"

This should test if the filename is a blank string.

","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L7"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":""}},{"html_id":"filename:String-instance-method","name":"filename","doc":"Typically, this should return the filename as found in the `metadata`.","summary":"

Typically, this should return the filename as found in the #metadata.

","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L5"},"def":{"name":"filename","return_type":"String","visibility":"Public","body":""}},{"html_id":"metadata:HTTP::FormData::FileMetadata-instance-method","name":"metadata","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L3"},"def":{"name":"metadata","return_type":"HTTP::FormData::FileMetadata","visibility":"Public","body":""}},{"html_id":"tempfile:File-instance-method","name":"tempfile","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L2"},"def":{"name":"tempfile","return_type":"File","visibility":"Public","body":""}}],"types":[{"html_id":"avram/Avram/Uploadable/Lucky","path":"Avram/Uploadable/Lucky.html","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/uploadable.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L13"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Avram/Uploadable/Lucky","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Avram/Uploadable","kind":"module","full_name":"Avram::Uploadable","name":"Uploadable"},"instance_methods":[{"html_id":"parse(value:Avram::Uploadable)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::Uploadable"}],"args_string":"(value : Avram::Uploadable)","args_html":"(value : Avram::Uploadable)","location":{"filename":"src/avram/uploadable.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L16"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Avram::Uploadable"}],"visibility":"Public","body":"SuccessfulCast(Avram::Uploadable).new(value)"}},{"html_id":"parse(values:Array(Avram::Uploadable))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Avram::Uploadable)"}],"args_string":"(values : Array(Avram::Uploadable))","args_html":"(values : Array(Avram::Uploadable))","location":{"filename":"src/avram/uploadable.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L20"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Avram::Uploadable)"}],"visibility":"Public","body":"SuccessfulCast.new(values)"}},{"html_id":"parse(value:String|Nil)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String | ::Nil"}],"args_string":"(value : String | Nil)","args_html":"(value : String | Nil)","location":{"filename":"src/avram/uploadable.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String | ::Nil"}],"visibility":"Public","body":"FailedCast.new"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/uploadable.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L28"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"FailedCast.new"}}]}]},{"html_id":"avram/Avram/Upsert","path":"Avram/Upsert.html","kind":"module","full_name":"Avram::Upsert","name":"Upsert","abstract":false,"locations":[{"filename":"src/avram/upsert.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/upsert.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Adds the ability to \"create or update\" (upsert) to `Avram::SaveOperation`\n\nThis is included in SaveOperations by default. See `upsert_lookup_columns` for usage details.","summary":"

Adds the ability to "create or update" (upsert) to Avram::SaveOperation

","macros":[{"html_id":"upsert_lookup_columns(*attribute_names)-macro","name":"upsert_lookup_columns","doc":"Defines the columns Avram should use when performing an `upsert`\n\nAn \"upsert\" is short for \"update or insert\", or in Avram terminology a\n\"create or update\". If the values in an operation conflict with an existing\nrecord in the database, Avram updates that record. If there is no\nconflicting record, then Avram will create new one.\n\nIn Avram, you must define which columns Avram should look at when\ndetermining if a conflicting record exists. This is done using the macro\n`Avram::Upsert.upsert_lookup_columns`\n\n**Note:** In almost _every_ case the `upsert_lookup_columns` should have a **unique index** defined\nin the database to ensure no conflicting records are created, even from outside Avram.\n\n## Full Example\n\n```\nclass User < BaseModel\n table do\n column name : String\n column email : String # This column has a unique index\n end\nend\n\nclass SaveUser < User::SaveOperation\n # Can be one or more columns. In this case we choose just :email\n upsert_lookup_columns :email\nend\n\n# Will create a new row in the database since no row with\n# `email: \"bob@example.com\"` exists yet\nSaveUser.upsert!(name: \"Bobby\", email: \"bob@example.com\")\n\n# Will update the name on the row we just created since the email is\n# the same as one in the database\nSaveUser.upsert!(name: \"Bob\", email: \"bob@example.com\")\n```\n\n## Difference between `upsert` and `upsert!`\n\nThere is an `upsert` and `upsert!` that work similarly to `create` and `create!`.\n`upsert!` will raise an error if the operation is invalid. Whereas `upsert`\nwill yield the operation and the new record if the operation is valid, or\nthe operation and `nil` if it is invalid.\n\n```\n# Will raise because the name is blank\nSaveUser.upsert!(name: \"\", email: \"bob@example.com\")\n\n# Operation is invalid because name is blank\nSaveUser.upsert(name: \"\", email: \"bob@example.com\") do |operation, user|\n # `user` is `nil` because the operation is invalid.\n # If the `name` was valid `user` would be the newly created user\nend\n````","summary":"

Defines the columns Avram should use when performing an upsert

","abstract":false,"args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"args_string":"(*attribute_names)","args_html":"(*attribute_names)","location":{"filename":"src/avram/upsert.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/upsert.cr#L60"},"def":{"name":"upsert_lookup_columns","args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"splat_index":0,"visibility":"Public","body":" def self.upsert!(*args, **named_args) : T\n operation = new(*args, **named_args)\n \nexisting_record = find_existing_unique_record(operation)\n\n if \nexisting_record\n operation = new(\nexisting_record, *args, **named_args)\n \nend\n\n operation.save!\n \nend\n\n def self.upsert(*args, **named_args)\n operation = new(*args, **named_args)\n \nexisting_record = find_existing_unique_record(operation)\n\n if \nexisting_record\n operation = new(\nexisting_record, *args, **named_args)\n \nend\n\n operation.save\n yield operation, operation.record\n \nend\n\n def self.find_existing_unique_record(operation) : T?\n T::BaseQuery.new\n \n{% for attribute in attribute_names %}\n .{{ attribute.id }}.nilable_eq(operation.{{ attribute.id }}.value)\n {% end %}\n\n .first?\n \nend\n \n"}}]},{"html_id":"avram/Avram/Validations","path":"Avram/Validations.html","kind":"module","full_name":"Avram::Validations","name":"Validations","abstract":false,"locations":[{"filename":"src/avram/validations.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"extended_modules":[{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"A number of methods for validating Avram::Attributes\nAll validation methods return `Bool`. `false` if any error is added, otherwise `true`\n\nThis module is included in `Avram::Operation`, `Avram::SaveOperation`, and `Avram::DeleteOperation`","summary":"

A number of methods for validating Avram::Attributes All validation methods return Bool.

","instance_methods":[{"html_id":"validate_acceptance_of(attribute:Avram::Attribute(Bool),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_acceptance_of)):Bool-instance-method","name":"validate_acceptance_of","doc":"Validate whether an attribute was accepted (`true`)\n\nThis validation is only for Boolean Attributes. The attribute will be marked\nas invalid for any value other than `true`.","summary":"

Validate whether an attribute was accepted (true)

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Bool)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_acceptance_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(attribute : Avram::Attribute(Bool), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_acceptance_of)) : Bool","args_html":"(attribute : Avram::Attribute(Bool), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_acceptance_of)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":109,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L109"},"def":{"name":"validate_acceptance_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Bool)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_acceptance_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif attribute.value != true\n attribute.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_at_most_one_filled(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_at_most_one_filled)):Bool-instance-method","name":"validate_at_most_one_filled","doc":"Validates that at most one attribute is filled\n\nIf more than one attribute is filled it will mark all but the first filled\nfield invalid.","summary":"

Validates that at most one attribute is filled

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_at_most_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_at_most_one_filled)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_at_most_one_filled)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L39"},"def":{"name":"validate_at_most_one_filled","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_at_most_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = true\npresent_attributes = attributes.reject() do |__arg1|\n __arg1.value.blank?\nend\nif present_attributes.size > 1\n (present_attributes.skip(1)).each do |attr|\n attr.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_confirmation_of(attribute:Avram::Attribute(T),withconfirmation_attribute:Avram::Attribute(T),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_confirmation_of)):BoolforallT-instance-method","name":"validate_confirmation_of","doc":"Validates that the values of two attributes are the same\n\nTakes two attributes and if the values are different the second attribute\n(`with`/`confirmation_attribute`) will be marked as invalid\n\nExample:\n\n```\nvalidate_confirmation_of password, with: password_confirmation\n```\n\nIf `password_confirmation` does not match, it will be marked invalid.","summary":"

Validates that the values of two attributes are the same

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"confirmation_attribute","external_name":"with","restriction":"Avram::Attribute(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_confirmation_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(attribute : Avram::Attribute(T), with confirmation_attribute : Avram::Attribute(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_confirmation_of)) : Bool forall T","args_html":"(attribute : Avram::Attribute(T), with confirmation_attribute : Avram::Attribute(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_confirmation_of)) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":134,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L134"},"def":{"name":"validate_confirmation_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"confirmation_attribute","external_name":"with","restriction":"Avram::Attribute(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_confirmation_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif attribute.value != confirmation_attribute.value\n confirmation_attribute.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_exactly_one_filled(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_exactly_one_filled)):Bool-instance-method","name":"validate_exactly_one_filled","doc":"Validates that at exactly one attribute is filled\n\nThis validation is used by `Avram::Polymorphic.polymorphic` to ensure\nthat a required polymorphic association is set.\n\nIf more than one attribute is filled it will mark all but the first filled\nfield invalid.\n\nIf no field is filled, the first field will be marked as invalid.","summary":"

Validates that at exactly one attribute is filled

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exactly_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exactly_one_filled)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exactly_one_filled)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L65"},"def":{"name":"validate_exactly_one_filled","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exactly_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = validate_at_most_one_filled(*attributes)\npresent_attributes = attributes.reject() do |__arg2|\n __arg2.value.blank?\nend\nif present_attributes.size.zero?\n attributes.first.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_format_of(attribute:Avram::Attribute(String),withregex:Regex,match:Bool=true,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_format_of),allow_nil:Bool=false):Bool-instance-method","name":"validate_format_of","doc":"Validates that the passed in attributes matches the given regex\n\n```\nvalidate_format_of email, with: /[^@]+@[^\\.]+\\..+/\n```\n\nAlternatively, the `match` argument can be set to `false` to not match the\ngiven regex.","summary":"

Validates that the passed in attributes matches the given regex

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String)"},{"name":"regex","external_name":"with","restriction":"Regex"},{"name":"match","default_value":"true","external_name":"match","restriction":"Bool"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_format_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String), with regex : Regex, match : Bool = true, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_format_of), allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(String), with regex : Regex, match : Bool = true, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_format_of), allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":315,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L315"},"def":{"name":"validate_format_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String)"},{"name":"regex","external_name":"with","restriction":"Regex"},{"name":"match","default_value":"true","external_name":"match","restriction":"Bool"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_format_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"if allow_nil && attribute.value.nil?\nelse\n matching = attribute.value.to_s.match(regex)\n if (match && (!matching)) || ((!match) && matching)\n attribute.add_error(message)\n return false\n end\nend\ntrue\n"}},{"html_id":"validate_inclusion_of(attribute:Avram::Attribute(T),inallowed_values:Enumerable(T),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_inclusion_of),allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_inclusion_of","doc":"Validates that the attribute value is in a list of allowed values\n\n```\nvalidate_inclusion_of state, in: [\"NY\", \"MA\"]\n```\n\nThis will mark `state` as invalid unless the value is `\"NY\"`, or `\"MA\"`.","summary":"

Validates that the attribute value is in a list of allowed values

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"allowed_values","external_name":"in","restriction":"Enumerable(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_inclusion_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(T), in allowed_values : Enumerable(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_inclusion_of), allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(T), in allowed_values : Enumerable(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_inclusion_of), allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L155"},"def":{"name":"validate_inclusion_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"allowed_values","external_name":"in","restriction":"Enumerable(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_inclusion_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif value = attribute.value\n if !(allowed_values.includes?(value))\n attribute.add_error(message)\n no_errors = false\n end\nelse\n if !allow_nil\n attribute.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_numeric(attribute:Avram::Attribute(Number),greater_than=nil,less_than=nil,message=nil,allow_nil:Bool=false):Bool-instance-method","name":"validate_numeric","summary":"

DEPRECATED Use validate_numeric with at_least/no_more_than instead of greater_than/less_than

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"greater_than","default_value":"nil","external_name":"greater_than","restriction":""},{"name":"less_than","default_value":"nil","external_name":"less_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(Number), greater_than = nil, less_than = nil, message = nil, allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(Number), greater_than = nil, less_than = nil, message = nil, allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":246,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L246"},"def":{"name":"validate_numeric","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"greater_than","default_value":"nil","external_name":"greater_than","restriction":""},{"name":"less_than","default_value":"nil","external_name":"less_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"validate_numeric(attribute, at_least: greater_than, no_more_than: less_than, message: message, allow_nil: allow_nil)"}},{"html_id":"validate_numeric(attribute:Avram::Attribute(Number),*,at_least=nil,no_more_than=nil,message=nil,allow_nil:Bool=false):Bool-instance-method","name":"validate_numeric","doc":"Validate a number is `at_least` and/or `no_more_than`\n\n```\nvalidate_numeric age, at_least: 18\nvalidate_numeric count, at_least: 0, no_more_than: 1200\n```\nameba:disable Metrics/CyclomaticComplexity","summary":"

Validate a number is at_least and/or no_more_than

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"","external_name":"","restriction":""},{"name":"at_least","default_value":"nil","external_name":"at_least","restriction":""},{"name":"no_more_than","default_value":"nil","external_name":"no_more_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(Number), *, at_least = nil, no_more_than = nil, message = nil, allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(Number), *, at_least = nil, no_more_than = nil, message = nil, allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L263"},"def":{"name":"validate_numeric","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"","external_name":"","restriction":""},{"name":"at_least","default_value":"nil","external_name":"at_least","restriction":""},{"name":"no_more_than","default_value":"nil","external_name":"no_more_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"splat_index":1,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif (at_least && no_more_than) && at_least > no_more_than\n raise(ImpossibleValidation.new(attribute: attribute.name, message: \"number at least #{at_least} but no more than #{no_more_than}\"))\nend\nnumber = attribute.value\nif number.nil?\n if allow_nil\n else\n attribute.add_error(Avram.settings.i18n_backend.get(:validate_numeric_nil))\n no_errors = false\n end\n return no_errors\nend\nif at_least && number < at_least\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_numeric_min))) % at_least)\n no_errors = false\nend\nif no_more_than && number > no_more_than\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_numeric_max))) % no_more_than)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_required(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_required)):Bool-instance-method","name":"validate_required","doc":"Validates that the passed in attributes have values\n\nYou can pass in one or more attributes at a time. The attribute will be\nmarked as invalid if the value is `nil`, or \"blank\" (empty strings or strings with just whitespace)\n\n`false` is not considered invalid.\n\n```\nvalidate_required name, age, email\n```","summary":"

Validates that the passed in attributes have values

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_required)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_required)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_required)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L90"},"def":{"name":"validate_required","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_required)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nattributes.each do |attribute|\n if attribute.value.blank_for_validates_required? && (!attribute.allow_blank?)\n attribute.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_size_of(attribute:Avram::Attribute(String)|Avram::Attribute(Array(T)),min:Number|Nil=nil,max:Number|Nil=nil,message:Avram::Attribute::ErrorMessage|Nil=nil,allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_size_of","doc":"Validate the size of a `String` or `Array` is within a `min` and/or `max`\n\n```\nvalidate_size_of feedback, min: 18, max: 100\nvalidate_size_of password, min: 12\nvalidate_size_of options, max: 10\n```\nameba:disable Metrics/CyclomaticComplexity","summary":"

Validate the size of a String or Array is within a min and/or max

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"min","default_value":"nil","external_name":"min","restriction":"Number | ::Nil"},{"name":"max","default_value":"nil","external_name":"max","restriction":"Number | ::Nil"},{"name":"message","default_value":"nil","external_name":"message","restriction":"Avram::Attribute::ErrorMessage | ::Nil"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), min : Number | Nil = nil, max : Number | Nil = nil, message : Avram::Attribute::ErrorMessage | Nil = nil, allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), min : Number | Nil = nil, max : Number | Nil = nil, message : Avram::Attribute::ErrorMessage | Nil = nil, allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":210,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L210"},"def":{"name":"validate_size_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"min","default_value":"nil","external_name":"min","restriction":"Number | ::Nil"},{"name":"max","default_value":"nil","external_name":"max","restriction":"Number | ::Nil"},{"name":"message","default_value":"nil","external_name":"message","restriction":"Avram::Attribute::ErrorMessage | ::Nil"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif ((!min.nil?) && (!max.nil?)) && min > max\n raise(ImpossibleValidation.new(attribute: attribute.name, message: \"size greater than #{min} but less than #{max}\"))\nend\nif allow_nil && attribute.value.nil?\nelse\n size = attribute.value.try(&.size) || 0\n if (!min.nil?) && size < min\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_min_size_of))) % min)\n no_errors = false\n end\n if (!max.nil?) && size > max\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_max_size_of))) % max)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_size_of(attribute:Avram::Attribute(String)|Avram::Attribute(Array(T)),*,isexact_size:Number,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_exact_size_of),allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_size_of","doc":"Validate the size of a `String` or `Array` is exactly a certain size\n\n```\nvalidate_size_of api_key, is: 32\nvalidate_size_of theme_colors, is: 4\n```","summary":"

Validate the size of a String or Array is exactly a certain size

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"","external_name":"","restriction":""},{"name":"exact_size","external_name":"is","restriction":"Number"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exact_size_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), *, is exact_size : Number, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exact_size_of), allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), *, is exact_size : Number, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exact_size_of), allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":183,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L183"},"def":{"name":"validate_size_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"","external_name":"","restriction":""},{"name":"exact_size","external_name":"is","restriction":"Number"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exact_size_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"splat_index":1,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nsize = attribute.value.try(&.size) || 0\nif size != exact_size\n if !(allow_nil && attribute.value.nil?)\n attribute.add_error(message % exact_size)\n no_errors = false\n end\nend\nno_errors\n"}}],"macros":[{"html_id":"default_validations-macro","name":"default_validations","doc":"Defines an instance method that gets called\nduring validation of an operation. Define your default\nvalidations inside of the block.\n```\ndefault_validations do\n validate_required some_attribute\nend\n```","summary":"

Defines an instance method that gets called during validation of an operation.

","abstract":false,"location":{"filename":"src/avram/validations.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L22"},"def":{"name":"default_validations","visibility":"Public","body":" \n# :nodoc:\n\n def default_validations\n \n{% if @type.methods.map(&.name).includes?((:default_validations).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/Where","path":"Avram/Where.html","kind":"module","full_name":"Avram::Where","name":"Where","abstract":false,"locations":[{"filename":"src/avram/where.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Where/Condition","path":"Avram/Where/Condition.html","kind":"class","full_name":"Avram::Where::Condition","name":"Condition","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L19"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/PrecedenceEnd","kind":"class","full_name":"Avram::Where::PrecedenceEnd","name":"PrecedenceEnd"},{"html_id":"avram/Avram/Where/PrecedenceStart","kind":"class","full_name":"Avram::Where::PrecedenceStart","name":"PrecedenceStart"},{"html_id":"avram/Avram/Where/Raw","kind":"class","full_name":"Avram::Where::Raw","name":"Raw"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L24"},"def":{"name":"clone","visibility":"Public","body":"self"}},{"html_id":"conjunction:Conjunction-instance-method","name":"conjunction","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L20"},"def":{"name":"conjunction","return_type":"Conjunction","visibility":"Public","body":"@conjunction"}},{"html_id":"conjunction=(conjunction:Conjunction)-instance-method","name":"conjunction=","abstract":false,"args":[{"name":"conjunction","external_name":"conjunction","restriction":"Conjunction"}],"args_string":"(conjunction : Conjunction)","args_html":"(conjunction : Conjunction)","location":{"filename":"src/avram/where.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L20"},"def":{"name":"conjunction=","args":[{"name":"conjunction","external_name":"conjunction","restriction":"Conjunction"}],"visibility":"Public","body":"@conjunction = conjunction"}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":true,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L22"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Where/Conjunction","path":"Avram/Where/Conjunction.html","kind":"enum","full_name":"Avram::Where::Conjunction","name":"Conjunction","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L2"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"And","name":"And","value":"0"},{"id":"Or","name":"Or","value":"1"},{"id":"None","name":"None","value":"2"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"and?-instance-method","name":"and?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L3"},"def":{"name":"and?","visibility":"Public","body":"self == And"}},{"html_id":"none?-instance-method","name":"none?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L5"},"def":{"name":"none?","visibility":"Public","body":"self == None"}},{"html_id":"or?-instance-method","name":"or?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L4"},"def":{"name":"or?","visibility":"Public","body":"self == Or"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"Returns a `String` representation of this enum member.\nIn the case of regular enums, this is just the name of the member.\nIn the case of flag enums, it's the names joined by vertical bars, or \"None\",\nif the value is zero.\n\nIf an enum's value doesn't match a member's value, the raw value\nis returned as a string.\n\n```\nColor::Red.to_s # => \"Red\"\nIOMode::None.to_s # => \"None\"\n(IOMode::Read | IOMode::Write).to_s # => \"Read | Write\"\n\nColor.new(10).to_s # => \"10\"\n```","summary":"

Returns a String representation of this enum member.

","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L7"},"def":{"name":"to_s","visibility":"Public","body":"case self\nwhen .and?\n \"AND\"\nwhen .or?\n \"OR\"\nelse\n \"\"\nend"}}]},{"html_id":"avram/Avram/Where/Equal","path":"Avram/Where/Equal.html","kind":"class","full_name":"Avram::Where::Equal","name":"Equal","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":92,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L92"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotEqual-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L97"},"def":{"name":"negated","return_type":"NotEqual","visibility":"Public","body":"NotEqual.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":93,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L93"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"=\""}}]},{"html_id":"avram/Avram/Where/Excludes","path":"Avram/Where/Excludes.html","kind":"class","full_name":"Avram::Where::Excludes","name":"Excludes","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":234,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L234"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Includes-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":239,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L239"},"def":{"name":"negated","return_type":"Includes","visibility":"Public","body":"Includes.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":235,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L235"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!= ALL\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":243,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L243"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{placeholder_supplier.call} #{operator} (#{column})\""}}]},{"html_id":"avram/Avram/Where/GreaterThan","path":"Avram/Where/GreaterThan.html","kind":"class","full_name":"Avram::Where::GreaterThan","name":"GreaterThan","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":112,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L112"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:LessThanOrEqualTo-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":117,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L117"},"def":{"name":"negated","return_type":"LessThanOrEqualTo","visibility":"Public","body":"LessThanOrEqualTo.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":113,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L113"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\">\""}}]},{"html_id":"avram/Avram/Where/GreaterThanOrEqualTo","path":"Avram/Where/GreaterThanOrEqualTo.html","kind":"class","full_name":"Avram::Where::GreaterThanOrEqualTo","name":"GreaterThanOrEqualTo","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":122,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L122"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:LessThan-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":127,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L127"},"def":{"name":"negated","return_type":"LessThan","visibility":"Public","body":"LessThan.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":123,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L123"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\">=\""}}]},{"html_id":"avram/Avram/Where/Ilike","path":"Avram/Where/Ilike.html","kind":"class","full_name":"Avram::Where::Ilike","name":"Ilike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L162"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotIlike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L167"},"def":{"name":"negated","return_type":"NotIlike","visibility":"Public","body":"NotIlike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":163,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L163"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"ILIKE\""}}]},{"html_id":"avram/Avram/Where/In","path":"Avram/Where/In.html","kind":"class","full_name":"Avram::Where::In","name":"In","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":192,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L192"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotIn-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":197,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L197"},"def":{"name":"negated","return_type":"NotIn","visibility":"Public","body":"NotIn.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L193"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"= ANY\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":201,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L201"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} (#{placeholder_supplier.call})\""}}]},{"html_id":"avram/Avram/Where/Includes","path":"Avram/Where/Includes.html","kind":"class","full_name":"Avram::Where::Includes","name":"Includes","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":220,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L220"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Excludes-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":225,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L225"},"def":{"name":"negated","return_type":"Excludes","visibility":"Public","body":"Excludes.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":221,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L221"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"= ANY\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":229,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L229"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{placeholder_supplier.call} #{operator} (#{column})\""}}]},{"html_id":"avram/Avram/Where/LessThan","path":"Avram/Where/LessThan.html","kind":"class","full_name":"Avram::Where::LessThan","name":"LessThan","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L132"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:GreaterThanOrEqualTo-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L137"},"def":{"name":"negated","return_type":"GreaterThanOrEqualTo","visibility":"Public","body":"GreaterThanOrEqualTo.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L133"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"<\""}}]},{"html_id":"avram/Avram/Where/LessThanOrEqualTo","path":"Avram/Where/LessThanOrEqualTo.html","kind":"class","full_name":"Avram::Where::LessThanOrEqualTo","name":"LessThanOrEqualTo","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L142"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:GreaterThan-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L147"},"def":{"name":"negated","return_type":"GreaterThan","visibility":"Public","body":"GreaterThan.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L143"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"<=\""}}]},{"html_id":"avram/Avram/Where/Like","path":"Avram/Where/Like.html","kind":"class","full_name":"Avram::Where::Like","name":"Like","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L152"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotLike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":157,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L157"},"def":{"name":"negated","return_type":"NotLike","visibility":"Public","body":"NotLike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L153"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"LIKE\""}}]},{"html_id":"avram/Avram/Where/NotEqual","path":"Avram/Where/NotEqual.html","kind":"class","full_name":"Avram::Where::NotEqual","name":"NotEqual","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":102,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L102"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Equal-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":107,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L107"},"def":{"name":"negated","return_type":"Equal","visibility":"Public","body":"Equal.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":103,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L103"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!=\""}}]},{"html_id":"avram/Avram/Where/NotIlike","path":"Avram/Where/NotIlike.html","kind":"class","full_name":"Avram::Where::NotIlike","name":"NotIlike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":182,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L182"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Ilike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":187,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L187"},"def":{"name":"negated","return_type":"Ilike","visibility":"Public","body":"Ilike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":183,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L183"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"NOT ILIKE\""}}]},{"html_id":"avram/Avram/Where/NotIn","path":"Avram/Where/NotIn.html","kind":"class","full_name":"Avram::Where::NotIn","name":"NotIn","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":206,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L206"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:In-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":211,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L211"},"def":{"name":"negated","return_type":"In","visibility":"Public","body":"In.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":207,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L207"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!= ALL\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":215,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L215"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} (#{placeholder_supplier.call})\""}}]},{"html_id":"avram/Avram/Where/NotLike","path":"Avram/Where/NotLike.html","kind":"class","full_name":"Avram::Where::NotLike","name":"NotLike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":172,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L172"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Like-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":177,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L177"},"def":{"name":"negated","return_type":"Like","visibility":"Public","body":"Like.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":173,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L173"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"NOT LIKE\""}}]},{"html_id":"avram/Avram/Where/NotNull","path":"Avram/Where/NotNull.html","kind":"class","full_name":"Avram::Where::NotNull","name":"NotNull","abstract":false,"superclass":{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L82"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Null-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L87"},"def":{"name":"negated","return_type":"Null","visibility":"Public","body":"Null.new(column)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":83,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L83"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"IS NOT\""}}]},{"html_id":"avram/Avram/Where/Null","path":"Avram/Where/Null.html","kind":"class","full_name":"Avram::Where::Null","name":"Null","abstract":false,"superclass":{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L72"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotNull-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L77"},"def":{"name":"negated","return_type":"NotNull","visibility":"Public","body":"NotNull.new(column)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":73,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L73"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"IS\""}}]},{"html_id":"avram/Avram/Where/NullSqlClause","path":"Avram/Where/NullSqlClause.html","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L66"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/NotNull","kind":"class","full_name":"Avram::Where::NotNull","name":"NotNull"},{"html_id":"avram/Avram/Where/Null","kind":"class","full_name":"Avram::Where::Null","name":"Null"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"prepare(_placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"_placeholder_supplier","external_name":"_placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(_placeholder_supplier : Proc(String)) : String","args_html":"(_placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L67"},"def":{"name":"prepare","args":[{"name":"_placeholder_supplier","external_name":"_placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} NULL\""}}]},{"html_id":"avram/Avram/Where/PrecedenceEnd","path":"Avram/Where/PrecedenceEnd.html","kind":"class","full_name":"Avram::Where::PrecedenceEnd","name":"PrecedenceEnd","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L39"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L40"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\")\""}}]},{"html_id":"avram/Avram/Where/PrecedenceStart","path":"Avram/Where/PrecedenceStart.html","kind":"class","full_name":"Avram::Where::PrecedenceStart","name":"PrecedenceStart","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L29"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L30"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L34"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"(\""}}]},{"html_id":"avram/Avram/Where/Raw","path":"Avram/Where/Raw.html","kind":"class","full_name":"Avram::Where::Raw","name":"Raw","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":248,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L248"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(statement:String,*bind_vars)-class-method","name":"new","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"args_string":"(statement : String, *bind_vars)","args_html":"(statement : String, *bind_vars)","location":{"filename":"src/avram/where.cr","line_number":251,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L251"},"def":{"name":"new","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"splat_index":1,"visibility":"Public","body":"new(statement, args: bind_vars.to_a)"}},{"html_id":"new(statement:String,*,argsbind_vars:Array)-class-method","name":"new","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"args_string":"(statement : String, *, args bind_vars : Array)","args_html":"(statement : String, *, args bind_vars : Array)","location":{"filename":"src/avram/where.cr","line_number":255,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L255"},"def":{"name":"new","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(statement, args: bind_vars)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":260,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L260"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"@clause"}}]},{"html_id":"avram/Avram/Where/SqlClause","path":"Avram/Where/SqlClause.html","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(column:String|Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::String | ::Symbol"}],"args_string":"(column : String | Symbol)","args_html":"(column : String | Symbol)","location":{"filename":"src/avram/where.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L48"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":"::String | ::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column:Symbol|String-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L46"},"def":{"name":"column","return_type":"Symbol | String","visibility":"Public","body":"@column"}},{"html_id":"negated:SqlClause-instance-method","name":"negated","abstract":true,"location":{"filename":"src/avram/where.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L52"},"def":{"name":"negated","return_type":"SqlClause","visibility":"Public","body":""}},{"html_id":"operator:String-instance-method","name":"operator","abstract":true,"location":{"filename":"src/avram/where.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L51"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L54"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} #{placeholder_supplier.call}\""}}]},{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","path":"Avram/Where/ValueHoldingSqlClause.html","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L59"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/Equal","kind":"class","full_name":"Avram::Where::Equal","name":"Equal"},{"html_id":"avram/Avram/Where/Excludes","kind":"class","full_name":"Avram::Where::Excludes","name":"Excludes"},{"html_id":"avram/Avram/Where/GreaterThan","kind":"class","full_name":"Avram::Where::GreaterThan","name":"GreaterThan"},{"html_id":"avram/Avram/Where/GreaterThanOrEqualTo","kind":"class","full_name":"Avram::Where::GreaterThanOrEqualTo","name":"GreaterThanOrEqualTo"},{"html_id":"avram/Avram/Where/Ilike","kind":"class","full_name":"Avram::Where::Ilike","name":"Ilike"},{"html_id":"avram/Avram/Where/In","kind":"class","full_name":"Avram::Where::In","name":"In"},{"html_id":"avram/Avram/Where/Includes","kind":"class","full_name":"Avram::Where::Includes","name":"Includes"},{"html_id":"avram/Avram/Where/LessThan","kind":"class","full_name":"Avram::Where::LessThan","name":"LessThan"},{"html_id":"avram/Avram/Where/LessThanOrEqualTo","kind":"class","full_name":"Avram::Where::LessThanOrEqualTo","name":"LessThanOrEqualTo"},{"html_id":"avram/Avram/Where/Like","kind":"class","full_name":"Avram::Where::Like","name":"Like"},{"html_id":"avram/Avram/Where/NotEqual","kind":"class","full_name":"Avram::Where::NotEqual","name":"NotEqual"},{"html_id":"avram/Avram/Where/NotIlike","kind":"class","full_name":"Avram::Where::NotIlike","name":"NotIlike"},{"html_id":"avram/Avram/Where/NotIn","kind":"class","full_name":"Avram::Where::NotIn","name":"NotIn"},{"html_id":"avram/Avram/Where/NotLike","kind":"class","full_name":"Avram::Where::NotLike","name":"NotLike"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(column,value:Array(Int32)|Array(String)|String)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":""},{"name":"value","external_name":"value","restriction":"::Array(::Int32) | ::Array(::String) | ::String"}],"args_string":"(column, value : Array(Int32) | Array(String) | String)","args_html":"(column, value : Array(Int32) | Array(String) | String)","location":{"filename":"src/avram/where.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L62"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":""},{"name":"value","external_name":"value","restriction":"::Array(::Int32) | ::Array(::String) | ::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column, value)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"value:String|Array(String)|Array(Int32)-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L60"},"def":{"name":"value","return_type":"String | Array(String) | Array(Int32)","visibility":"Public","body":"@value"}}]}]}]},{"html_id":"avram/BaseTask","path":"BaseTask.html","kind":"class","full_name":"BaseTask","name":"BaseTask","abstract":true,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"subclasses":[{"html_id":"avram/Db/Create","kind":"class","full_name":"Db::Create","name":"Create"},{"html_id":"avram/Db/Drop","kind":"class","full_name":"Db::Drop","name":"Drop"},{"html_id":"avram/Db/Migrate","kind":"class","full_name":"Db::Migrate","name":"Migrate"},{"html_id":"avram/Db/Migrate/One","kind":"class","full_name":"Db::Migrate::One","name":"One"},{"html_id":"avram/Db/Migrations/Status","kind":"class","full_name":"Db::Migrations::Status","name":"Status"},{"html_id":"avram/Db/Redo","kind":"class","full_name":"Db::Redo","name":"Redo"},{"html_id":"avram/Db/Reset","kind":"class","full_name":"Db::Reset","name":"Reset"},{"html_id":"avram/Db/Rollback","kind":"class","full_name":"Db::Rollback","name":"Rollback"},{"html_id":"avram/Db/RollbackAll","kind":"class","full_name":"Db::RollbackAll","name":"RollbackAll"},{"html_id":"avram/Db/RollbackTo","kind":"class","full_name":"Db::RollbackTo","name":"RollbackTo"},{"html_id":"avram/Db/Schema/Dump","kind":"class","full_name":"Db::Schema::Dump","name":"Dump"},{"html_id":"avram/Db/Schema/Restore","kind":"class","full_name":"Db::Schema::Restore","name":"Restore"},{"html_id":"avram/Db/Setup","kind":"class","full_name":"Db::Setup","name":"Setup"},{"html_id":"avram/Db/VerifyConnection","kind":"class","full_name":"Db::VerifyConnection","name":"VerifyConnection"}],"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"base_task\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L4"},"def":{"name":"call","visibility":"Public","body":"Avram::Migrator.run do\n run_task\nend"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":true,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L2"},"def":{"name":"run_task","visibility":"Public","body":""}}]},{"html_id":"avram/Bool","path":"Bool.html","kind":"struct","full_name":"Bool","name":"Bool","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/bool_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/bool_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L1"},{"filename":"src/avram/charms/bool_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"doc":"Bool has only two possible values: `true` and `false`. They are constructed using these literals:\n\n```\ntrue # A Bool that is true\nfalse # A Bool that is false\n```\n\nSee [`Bool` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/bool.html) in the language reference.","summary":"

Bool has only two possible values: true and false.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L2"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"false"}},{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L27"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"false"}}],"types":[{"html_id":"avram/Bool/Lucky","path":"Bool/Lucky.html","kind":"module","full_name":"Bool::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Bool","kind":"struct","full_name":"Bool","name":"Bool"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Bool).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"if ([\"true\", \"1\"] of ::String).includes?(value)\n SuccessfulCast(Bool).new(true)\nelse\n if ([\"false\", \"0\"] of ::String).includes?(value)\n SuccessfulCast(Bool).new(false)\n else\n FailedCast.new\n end\nend"}},{"html_id":"parse(value:Bool)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"SuccessfulCast(Bool).new(value)"}},{"html_id":"parse(values:Array(Bool))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"args_string":"(values : Array(Bool))","args_html":"(values : Array(Bool))","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L28"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"visibility":"Public","body":"SuccessfulCast(Array(Bool)).new(values)"}},{"html_id":"to_db(value:Bool):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool) : String","args_html":"(value : Bool) : String","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L32"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Bool))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"args_string":"(values : Array(Bool))","args_html":"(values : Array(Bool))","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Bool/Lucky/ColumnType","path":"Bool/Lucky/ColumnType.html","kind":"alias","full_name":"Bool::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Bool","aliased_html":"Bool","const":false,"namespace":{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"}},{"html_id":"avram/Bool/Lucky/Criteria","path":"Bool/Lucky/Criteria.html","kind":"class","full_name":"Bool::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]},{"html_id":"avram/Char","path":"Char.html","kind":"struct","full_name":"Char","name":"Char","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/object.cr#L18"},{"filename":"src/avram/object_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L32"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"}],"doc":"A `Char` represents a [Unicode](http://en.wikipedia.org/wiki/Unicode) [code point](http://en.wikipedia.org/wiki/Code_point).\nIt occupies 32 bits.\n\nIt is created by enclosing an UTF-8 character in single quotes.\n\n```\n'a'\n'z'\n'0'\n'_'\n'あ'\n```\n\nYou can use a backslash to denote some characters:\n\n```\n'\\'' # single quote\n'\\\\' # backslash\n'\\e' # escape\n'\\f' # form feed\n'\\n' # newline\n'\\r' # carriage return\n'\\t' # tab\n'\\v' # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n'\\u0041' # == 'A'\n```\n\nOr you can use curly braces and specify up to four hexadecimal numbers:\n\n```\n'\\u{41}' # == 'A'\n```\n\nSee [`Char` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/char.html) in the language reference.","summary":"

A Char represents a Unicode code point.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L45"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/DB","path":"DB.html","kind":"module","full_name":"DB","name":"DB","abstract":false,"locations":[{"filename":"lib/db/src/db.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db.cr#L78"},{"filename":"lib/db/src/db/begin_transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/begin_transaction.cr#L1"},{"filename":"lib/db/src/db/connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/connection.cr#L1"},{"filename":"lib/db/src/db/connection_builder.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/connection_builder.cr#L1"},{"filename":"lib/db/src/db/connection_context.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/connection_context.cr#L1"},{"filename":"lib/db/src/db/database.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/database.cr#L4"},{"filename":"lib/db/src/db/disposable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/disposable.cr#L1"},{"filename":"lib/db/src/db/driver.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/driver.cr#L1"},{"filename":"lib/db/src/db/enumerable_concat.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/enumerable_concat.cr#L1"},{"filename":"lib/db/src/db/error.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/error.cr#L1"},{"filename":"lib/db/src/db/mapping.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/mapping.cr#L1"},{"filename":"lib/db/src/db/pool.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/pool.cr#L5"},{"filename":"lib/db/src/db/pool_prepared_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/pool_prepared_statement.cr#L1"},{"filename":"lib/db/src/db/pool_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/pool_statement.cr#L1"},{"filename":"lib/db/src/db/pool_unprepared_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/pool_unprepared_statement.cr#L1"},{"filename":"lib/db/src/db/query_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/query_methods.cr#L1"},{"filename":"lib/db/src/db/result_set.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/result_set.cr#L1"},{"filename":"lib/db/src/db/serializable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/serializable.cr#L1"},{"filename":"lib/db/src/db/session_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/session_methods.cr#L1"},{"filename":"lib/db/src/db/statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/statement.cr#L1"},{"filename":"lib/db/src/db/string_key_cache.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/string_key_cache.cr#L1"},{"filename":"lib/db/src/db/transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/transaction.cr#L1"},{"filename":"src/ext/db/connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/connection.cr#L1"},{"filename":"src/ext/db/transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"The DB module is a unified interface for database access.\nIndividual database systems are supported by specific database driver shards.\n\nAvailable drivers include:\n* [crystal-lang/crystal-sqlite3](https://github.com/crystal-lang/crystal-sqlite3) for SQLite\n* [crystal-lang/crystal-mysql](https://github.com/crystal-lang/crystal-mysql) for MySQL and MariaDB\n* [will/crystal-pg](https://github.com/will/crystal-pg) for PostgreSQL\n* [kaukas/crystal-cassandra](https://github.com/kaukas/crystal-cassandra) for Cassandra\n\nFor basic instructions on implementing a new database driver, check `Driver` and the existing drivers.\n\nDB manages a connection pool. The connection pool can be configured by query parameters to the\nconnection `URI` as described in `Database`.\n\n### Usage\n\nAssuming `crystal-sqlite3` is included a SQLite3 database can be opened with `#open`.\n\n```\ndb = DB.open \"sqlite3:./path/to/db/file.db\"\ndb.close\n```\n\nIf a block is given to `#open` the database is closed automatically\n\n```\nDB.open \"sqlite3:./file.db\" do |db|\n # work with db\nend # db is closed\n```\n\nIn the code above `db` is a `Database`. Methods available for querying it are described in `QueryMethods`.\n\nThree kind of statements can be performed:\n1. `Database#exec` waits no response from the database.\n2. `Database#scalar` reads a single value of the response.\n3. `Database#query` returns a ResultSet that allows iteration over the rows in the response and column information.\n\nAll of the above methods allows parametrised query. Either positional or named arguments.\n\nCheck a full working version:\n\nThe following example uses SQLite where `?` indicates the arguments. If PostgreSQL is used `$1`, `$2`, etc. should be used. `crystal-db` does not interpret the statements.\n\n```\nrequire \"db\"\nrequire \"sqlite3\"\n\nDB.open \"sqlite3:./file.db\" do |db|\n # When using the pg driver, use $1, $2, etc. instead of ?\n db.exec \"create table contacts (name text, age integer)\"\n db.exec \"insert into contacts values (?, ?)\", \"John Doe\", 30\n\n args = [] of DB::Any\n args << \"Sarah\"\n args << 33\n db.exec \"insert into contacts values (?, ?)\", args: args\n\n puts \"max age:\"\n puts db.scalar \"select max(age) from contacts\" # => 33\n\n puts \"contacts:\"\n db.query \"select name, age from contacts order by age desc\" do |rs|\n puts \"#{rs.column_name(0)} (#{rs.column_name(1)})\"\n # => name (age)\n rs.each do\n puts \"#{rs.read(String)} (#{rs.read(Int32)})\"\n # => Sarah (33)\n # => John Doe (30)\n end\n end\nend\n```\n","summary":"

The DB module is a unified interface for database access.

","types":[{"html_id":"avram/DB/Connection","path":"DB/Connection.html","kind":"class","full_name":"DB::Connection","name":"Connection","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/SessionMethods","kind":"module","full_name":"DB::SessionMethods","name":"SessionMethods"},{"html_id":"avram/DB/QueryMethods","kind":"module","full_name":"DB::QueryMethods","name":"QueryMethods"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/connection.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/connection.cr#L21"},{"filename":"lib/db/src/db/error.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/error.cr#L2"},{"filename":"src/ext/db/connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/connection.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/DB/SessionMethods","kind":"module","full_name":"DB::SessionMethods","name":"SessionMethods"}],"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"doc":"Database driver implementors must subclass `Connection`.\n\nRepresents one active connection to a database.\n\nUsers should never instantiate a `Connection` manually. Use `DB#open` or `Database#connection`.\n\nRefer to `QueryMethods` for documentation about querying the database through this connection.\n\n### Note to implementors\n\nThe connection must be initialized in `#initialize` and closed in `#do_close`.\n\nOverride `#build_prepared_statement` method in order to return a prepared `Statement` to allow querying.\nOverride `#build_unprepared_statement` method in order to return a unprepared `Statement` to allow querying.\nSee also `Statement` to define how the statements are executed.\n\nIf at any give moment the connection is lost a DB::ConnectionLost should be raised. This will\nallow the connection pool to try to reconnect or use another connection if available.\n","summary":"

Database driver implementors must subclass Connection.

"},{"html_id":"avram/DB/SavePointTransaction","path":"DB/SavePointTransaction.html","kind":"class","full_name":"DB::SavePointTransaction","name":"SavePointTransaction","abstract":false,"superclass":{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},"ancestors":[{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":94,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/transaction.cr#L94"},{"filename":"src/ext/db/transaction.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L20"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"constructors":[{"html_id":"new(parent:Transaction,savepoint_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"parent","external_name":"parent","restriction":"Transaction"},{"name":"savepoint_name","external_name":"savepoint_name","restriction":"String"}],"args_string":"(parent : Transaction, savepoint_name : String)","args_html":"(parent : Transaction, savepoint_name : String)","location":{"filename":"src/ext/db/transaction.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L21"},"def":{"name":"new","args":[{"name":"parent","external_name":"parent","restriction":"Transaction"},{"name":"savepoint_name","external_name":"savepoint_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(parent, savepoint_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/DB/TopLevelTransaction","path":"DB/TopLevelTransaction.html","kind":"class","full_name":"DB::TopLevelTransaction","name":"TopLevelTransaction","abstract":false,"superclass":{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},"ancestors":[{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/transaction.cr#L38"},{"filename":"src/ext/db/transaction.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"constructors":[{"html_id":"new(connection:Connection)-class-method","name":"new","abstract":false,"args":[{"name":"connection","external_name":"connection","restriction":"Connection"}],"args_string":"(connection : Connection)","args_html":"(connection : Connection)","location":{"filename":"src/ext/db/transaction.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L8"},"def":{"name":"new","args":[{"name":"connection","external_name":"connection","restriction":"Connection"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/DB/Transaction","path":"DB/Transaction.html","kind":"class","full_name":"DB::Transaction","name":"Transaction","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/transaction.cr#L14"},{"filename":"src/ext/db/transaction.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"}],"subclasses":[{"html_id":"avram/DB/SavePointTransaction","kind":"class","full_name":"DB::SavePointTransaction","name":"SavePointTransaction"},{"html_id":"avram/DB/TopLevelTransaction","kind":"class","full_name":"DB::TopLevelTransaction","name":"TopLevelTransaction"}],"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"doc":"Transactions should be started from `DB#transaction`, `Connection#transaction`\nor `Connection#begin_transaction`.\n\nUse `Transaction#connection` to submit statements to the database.\n\nUse `Transaction#commit` or `Transaction#rollback` to close the ongoing transaction\nexplicitly. Or refer to `BeginTransaction#transaction` for documentation on how to\nuse `#transaction(&block)` methods in `DB` and `Connection`.\n\nNested transactions are supported by using sql `SAVEPOINT`. To start a nested\ntransaction use `Transaction#transaction` or `Transaction#begin_transaction`.\n","summary":"

Transactions should be started from DB#transaction, Connection#transaction or Connection#begin_transaction.

"}]},{"html_id":"avram/Db","path":"Db.html","kind":"module","full_name":"Db","name":"Db","abstract":false,"locations":[{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Db/Console","path":"Db/Console.html","kind":"class","full_name":"Db::Console","name":"Console","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nEnters the postgres REPL. Check config/database.cr\\nfor database configuration.\\n\\nExamples:\\n\\n lucky db.console\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.console\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Access PostgreSQL console\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L16"},"def":{"name":"call","visibility":"Public","body":"puts(banner_message)\nsystem(\"psql #{Avram::Migrator::Runner.credentials.url_without_query_params}\")\n"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}]},{"html_id":"avram/Db/Create","path":"Db/Create.html","kind":"class","full_name":"Db::Create","name":"Create","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe database name is usually found in config/database.cr\\n\\nExamples:\\n\\n lucky db.create\\n LUCKY_ENV=test lucky db.create # Create the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.create\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L3"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Create the database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/create.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L16"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L19"},"def":{"name":"run_task","visibility":"Public","body":"Migrator::Runner.create_db(@quiet)"}}],"types":[{"html_id":"avram/Db/Create/Migrator","path":"Db/Create/Migrator.html","kind":"alias","full_name":"Db::Create::Migrator","name":"Migrator","abstract":false,"locations":[{"filename":"src/avram/tasks/db/create.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Avram::Migrator","aliased_html":"Avram::Migrator","const":false,"namespace":{"html_id":"avram/Db/Create","kind":"class","full_name":"Db::Create","name":"Create"}}]},{"html_id":"avram/Db/Drop","path":"Db/Drop.html","kind":"class","full_name":"Db::Drop","name":"Drop","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe database name is usually found in config/database.cr\\n\\nExamples:\\n\\n lucky db.drop\\n LUCKY_ENV=test lucky db.drop # Drop the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.drop\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Drop the database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/drop.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L15"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L18"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.drop_db(@quiet)"}}]},{"html_id":"avram/Db/Migrate","path":"Db/Migrate.html","kind":"class","full_name":"Db::Migrate","name":"Migrate","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExamples:\\n\\n lucky db.migrate\\n LUCKY_ENV=test lucky db.migrate # Runs migrations on the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrate\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Run any pending migrations\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L13"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L16"},"def":{"name":"run_task","visibility":"Public","body":"(Avram::Migrator::Runner.new(@quiet)).run_pending_migrations"}}],"types":[{"html_id":"avram/Db/Migrate/One","path":"Db/Migrate/One.html","kind":"class","full_name":"Db::Migrate::One","name":"One","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Migrate","kind":"class","full_name":"Db::Migrate","name":"Migrate"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.migrate.one\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrate.one\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Run just the next pending migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.run_next_migration"}}]}]},{"html_id":"avram/Db/Migrations","path":"Db/Migrations.html","kind":"module","full_name":"Db::Migrations","name":"Migrations","abstract":false,"locations":[{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"types":[{"html_id":"avram/Db/Migrations/Status","path":"Db/Migrations/Status.html","kind":"class","full_name":"Db::Migrations::Status","name":"Status","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Migrations","kind":"module","full_name":"Db::Migrations","name":"Migrations"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L5"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Shows which migrations are pending and which have been run.\\n\\nExamples:\\n\\n lucky db.migrations.status\\n LUCKY_ENV=test lucky db.migrations.status # Show migration status for test db\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L3"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrations.status\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L4"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Print the current status of migrations\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L3"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L15"},"def":{"name":"run_task","visibility":"Public","body":"if migrations.none?\n puts(\"There are no migrations.\".colorize(:green))\nelse\n ensure_migration_tracking_tables_exist\n print_migration_statuses\nend"}}]}]},{"html_id":"avram/Db/Redo","path":"Db/Redo.html","kind":"class","full_name":"Db::Redo","name":"Redo","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.redo\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.redo\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback and run just the last migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Db::Rollback.new.run_task\nDb::Migrate.new.run_task\n"}}]},{"html_id":"avram/Db/Reset","path":"Db/Reset.html","kind":"class","full_name":"Db::Reset","name":"Reset","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.reset\\n\\nTo drop the test database:\\n\\n LUCKY_ENV=test lucky db.reset\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.reset\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Drop, recreate, and run migrations.\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/reset.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L16"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L19"},"def":{"name":"run_task","visibility":"Public","body":"(Db::Drop.new(@quiet)).run_task\n(Db::Create.new(@quiet)).run_task\n(Db::Migrate.new(@quiet)).run_task\n"}}]},{"html_id":"avram/Db/Rollback","path":"Db/Rollback.html","kind":"class","full_name":"Db::Rollback","name":"Rollback","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.rollback\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback the last migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.rollback_one"}}]},{"html_id":"avram/Db/RollbackAll","path":"Db/RollbackAll.html","kind":"class","full_name":"Db::RollbackAll","name":"RollbackAll","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou may also want to look at 'lucky db.drop'.\\n\\nExample:\\n\\n lucky db.rollback_all\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback_all\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback all migrations\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L15"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.rollback_all\nputs(\"Done rolling back all migrations\".colorize(:green))\n"}}]},{"html_id":"avram/Db/RollbackTo","path":"Db/RollbackTo.html","kind":"class","full_name":"Db::RollbackTo","name":"RollbackTo","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou can get the migration version from the filename or by running 'lucky db.migrations.status'\\n\\nExample:\\n\\n lucky db.rollback_to 20180802180356\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback_to\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback to a specific migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L14"},"def":{"name":"run_task","visibility":"Public","body":"version = ARGV.first?\nif version && version.to_i64?\n Avram::Migrator::Runner.new.rollback_to(version.to_i64)\nelse\n raise((\"Migration version is required. Example: lucky db.rollback_to 20180802180356\".colorize(:red)).to_s)\nend\n"}}]},{"html_id":"avram/Db/Schema","path":"Db/Schema.html","kind":"module","full_name":"Db::Schema","name":"Schema","abstract":false,"locations":[{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"types":[{"html_id":"avram/Db/Schema/Dump","path":"Db/Schema/Dump.html","kind":"class","full_name":"Db::Schema::Dump","name":"Dump","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[:dump_to] of Symbol"}],"namespace":{"html_id":"avram/Db/Schema","kind":"module","full_name":"Db::Schema","name":"Schema"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou must specify the path that you want Avram to dump the sql to. Note\\nthat this dumps the schema but does not dump any data.\\n\\nExample:\\n\\n lucky db.schema.dump structure.sql\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.schema.dump\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Export database schema to a sql file\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L17"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"dump_to:String-instance-method","name":"dump_to","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L15"},"def":{"name":"dump_to","return_type":"String","visibility":"Public","body":"if @dump_to.nil?\n raise(\"dump_to is required, but no value was passed.\")\nend\n@dump_to.as(String)\n"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L20"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.dump_db(dump_to, @quiet)"}},{"html_id":"set_opt_for_dump_to(args:Array(String))-instance-method","name":"set_opt_for_dump_to","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L15"},"def":{"name":"set_opt_for_dump_to","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"value = args[@positional_arg_count]?\n@dump_to = value\n@positional_arg_count = @positional_arg_count + 1\n"}}]},{"html_id":"avram/Db/Schema/Restore","path":"Db/Schema/Restore.html","kind":"class","full_name":"Db::Schema::Restore","name":"Restore","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Schema","kind":"module","full_name":"Db::Schema","name":"Schema"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou must specify the path to the sql that you want Avram to restore from.\\n\\nExample:\\n\\n lucky db.schema.restore structure.sql\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.schema.restore\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Restore database from a sql dump file\""}}],"constructors":[{"html_id":"new(import_file_path:String|Nil=nil,quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"import_file_path","default_value":"nil","external_name":"import_file_path","restriction":"String | ::Nil"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(import_file_path : String | Nil = nil, quiet : Bool = false)","args_html":"(import_file_path : String | Nil = nil, quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L14"},"def":{"name":"new","args":[{"name":"import_file_path","default_value":"nil","external_name":"import_file_path","restriction":"String | ::Nil"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(import_file_path, quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L17"},"def":{"name":"run_task","visibility":"Public","body":"import_file_path = (@import_file_path || ARGV.first?) || (raise(\"A path to the import SQL file must be provided\"))\nAvram::Migrator::Runner.restore_db(import_file_path.as(String), @quiet)\n"}}]}]},{"html_id":"avram/Db/Setup","path":"Db/Setup.html","kind":"class","full_name":"Db::Setup","name":"Setup","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThis task will run the following:\\n * db.create - Create the database from config/database.cr\\n * db.migrate - Migrate all pending migrations from db/migrations/\\n\\n\\nExamples:\\n\\n lucky db.setup\\n LUCKY_ENV=test lucky db.setup # Setup test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.setup\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Runs a few tasks for setting up your database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/setup.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L18"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L21"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.create_db(@quiet)\n(Avram::Migrator::Runner.new(@quiet)).run_pending_migrations\n"}}]},{"html_id":"avram/Db/VerifyConnection","path":"Db/VerifyConnection.html","kind":"class","full_name":"Db::VerifyConnection","name":"VerifyConnection","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe connection settings are typically defined in config/database.cr\\n\\nExamples:\\n\\n lucky db.verify_connection\\n LUCKY_ENV=test lucky db.verify_connection # Verify test db connection\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.verify_connection\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Verify connection to postgres\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L17"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"quiet?:Bool-instance-method","name":"quiet?","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L15"},"def":{"name":"quiet?","visibility":"Public","body":"@quiet"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L20"},"def":{"name":"run_task","visibility":"Public","body":"begin\n Avram.settings.database_to_migrate.verify_connection\n if quiet?\n else\n puts(\"✔ Connection verified\")\n end\nrescue Avram::ConnectionError\n raise(\"Unable to connect to Postgres for database '#{Avram.settings.database_to_migrate}'.\\n\\nThis is what we tried to connect to:\\n\\n * host: #{Avram::Migrator::Runner.db_host}\\n * port: #{Avram::Migrator::Runner.db_port}\\n * database: #{Avram::Migrator::Runner.db_name}\\n * username: #{Avram::Migrator::Runner.db_user}\\n * password: check config/database.cr\\n\\nTo fix, try this...\\n\\n ▸ Make sure Postgres is running.\\n ▸ Check connection settings in config/database.cr.\\n ▸ If the database has not been created yet, run 'lucky db.create'\\n ▸ Then run 'lucky db.verify_connection' to make sure it can connect.\\n\")\nend"}}]}]},{"html_id":"avram/Enum","path":"Enum.html","kind":"struct","full_name":"Enum","name":"Enum","abstract":true,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/result_set.cr","line_number":156,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/result_set.cr#L156"},{"filename":"src/avram/charms/enum_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"Enum is the base type of all enums.\n\nAn enum is a set of integer values, where each value has an associated name. For example:\n\n```\nenum Color\n Red # 0\n Green # 1\n Blue # 2\nend\n```\n\nValues start with the value `0` and are incremented by one, but can be overwritten.\n\nTo get the underlying value you invoke value on it:\n\n```\nColor::Green.value # => 1\n```\n\nEach constant (member) in the enum has the type of the enum:\n\n```\ntypeof(Color::Red) # => Color\n```\n\n### Flags enum\n\nAn enum can be marked with the `@[Flags]` annotation. This changes the default values:\n\n```\n@[Flags]\nenum IOMode\n Read # 1\n Write # 2\n Async # 4\nend\n```\n\nAdditionally, some methods change their behaviour.\n\n### Enums from integers\n\nAn enum can be created from an integer:\n\n```\nColor.new(1).to_s # => \"Green\"\n```\n\nValues that don't correspond to enum's constants are allowed: the value\nwill still be of type Color, but when printed you will get the underlying value:\n\n```\nColor.new(10).to_s # => \"10\"\n```\n\nThis method is mainly intended to convert integers from C to enums in Crystal.\n\n### Question methods\n\nAn enum automatically defines question methods for each member, using\n`String#underscore` for the method name.\n* In the case of regular enums, this compares by equality (`==`).\n* In the case of flags enums, this invokes `includes?`.\n\nFor example:\n\n```\ncolor = Color::Blue\ncolor.red? # => false\ncolor.blue? # => true\n\nmode = IOMode::Read | IOMode::Async\nmode.read? # => true\nmode.write? # => false\nmode.async? # => true\n```\n\nThis is very convenient in `case` expressions:\n\n```\ncase color\nwhen .red?\n puts \"Got red\"\nwhen .blue?\n puts \"Got blue\"\nend\n```\n\n### Changing the Base Type\n\nThe type of the underlying enum value is `Int32` by default, but it can be changed to any type in `Int::Primitive`.\n\n```\nenum Color : UInt8\n Red\n Green\n Blue\nend\n\nColor::Red.value # : UInt8\n```","summary":"

Enum is the base type of all enums.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L4"},"def":{"name":"adapter","visibility":"Public","body":"Lucky(self)"}}],"types":[{"html_id":"avram/Enum/Lucky","path":"Enum/Lucky.html","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},"instance_methods":[{"html_id":"criteria(query:V,column)forallV-instance-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"V"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : V, column) forall V","args_html":"(query : V, column) forall V","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L39"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"V"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(V, T).new(query, column)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L12"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"is_int = value.to_i?\nif is_int\n return parse(is_int)\nend\nif result = T.parse?(value)\n SuccessfulCast.new(result)\nelse\n FailedCast.new\nend\n"}},{"html_id":"parse(value:Int)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int"}],"args_string":"(value : Int)","args_html":"(value : Int)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L23"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int"}],"visibility":"Public","body":"if result = T.from_value?(value)\n SuccessfulCast.new(result)\nelse\n FailedCast.new\nend"}},{"html_id":"parse(value:T)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T)","args_html":"(value : T)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L31"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"T"}],"visibility":"Public","body":"SuccessfulCast.new(value)"}},{"html_id":"to_db(value:T):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T) : String","args_html":"(value : T) : String","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L35"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"T"}],"return_type":"String","visibility":"Public","body":"value.value.to_s"}}],"types":[{"html_id":"avram/Enum/Lucky/ColumnType","path":"Enum/Lucky/ColumnType.html","kind":"alias","full_name":"Enum::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L10"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Int32 | Int64)","aliased_html":"Int32 | Int64","const":false,"namespace":{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"}},{"html_id":"avram/Enum/Lucky/Criteria","path":"Enum/Lucky/Criteria.html","kind":"class","full_name":"Enum::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria","name":"Criteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L43"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"select_max:V|Nil-instance-method","name":"select_max","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L50"},"def":{"name":"select_max","return_type":"V | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_max(column)).as(Int32 | ::Nil)).try do |max|\n V.adapter.parse!(max)\nend"}},{"html_id":"select_min:V|Nil-instance-method","name":"select_min","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L44"},"def":{"name":"select_min","return_type":"V | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_min(column)).as(Int32 | ::Nil)).try do |min|\n V.adapter.parse!(min)\nend"}}]}]}]},{"html_id":"avram/Fiber","path":"Fiber.html","kind":"class","full_name":"Fiber","name":"Fiber","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/fiber.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/fiber.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"https://crystal-lang.org/api/latest/Fiber.html","summary":"

https://crystal-lang.org/api/latest/Fiber.html

","instance_methods":[{"html_id":"query_cache:LuckyCache::BaseStore-instance-method","name":"query_cache","doc":"This is stored on Fiber so it's released after each\nHTTP Request.","summary":"

This is stored on Fiber so it's released after each HTTP Request.

","abstract":false,"location":{"filename":"src/avram/charms/fiber.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/fiber.cr#L5"},"def":{"name":"query_cache","return_type":"LuckyCache::BaseStore","visibility":"Public","body":"if (value = @query_cache).nil?\n @query_cache = (if Avram.settings.query_cache_enabled\n LuckyCache::MemoryStore.new\n else\n LuckyCache::NullStore.new\n end)\nelse\n value\nend"}},{"html_id":"query_cache=(query_cache:LuckyCache::BaseStore)-instance-method","name":"query_cache=","doc":"This is stored on Fiber so it's released after each\nHTTP Request.","summary":"

This is stored on Fiber so it's released after each HTTP Request.

","abstract":false,"args":[{"name":"query_cache","external_name":"query_cache","restriction":"LuckyCache::BaseStore"}],"args_string":"(query_cache : LuckyCache::BaseStore)","args_html":"(query_cache : LuckyCache::BaseStore)","location":{"filename":"src/avram/charms/fiber.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/fiber.cr#L5"},"def":{"name":"query_cache=","args":[{"name":"query_cache","external_name":"query_cache","restriction":"LuckyCache::BaseStore"}],"visibility":"Public","body":"@query_cache = query_cache"}}]},{"html_id":"avram/Float64","path":"Float64.html","kind":"struct","full_name":"Float64","name":"Float64","abstract":false,"superclass":{"html_id":"avram/Float","kind":"struct","full_name":"Float","name":"Float"},"ancestors":[{"html_id":"avram/Float","kind":"struct","full_name":"Float","name":"Float"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L31"},{"filename":"src/avram/charms/float64_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L32"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Float64/Lucky","path":"Float64/Lucky.html","kind":"module","full_name":"Float64::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Float64","kind":"struct","full_name":"Float64","name":"Float64"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Float64).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Float64)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64)","args_html":"(value : Float64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"visibility":"Public","body":"value"}},{"html_id":"from_db!(value:PG::Numeric)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"args_string":"(value : PG::Numeric)","args_html":"(value : PG::Numeric)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L18"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"visibility":"Public","body":"value.to_f"}},{"html_id":"parse(value:Float64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64)","args_html":"(value : Float64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value)"}},{"html_id":"parse(values:Array(Float64))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"args_string":"(values : Array(Float64))","args_html":"(values : Array(Float64))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"visibility":"Public","body":"SuccessfulCast(Array(Float64)).new(values)"}},{"html_id":"parse(value:PG::Numeric)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"args_string":"(value : PG::Numeric)","args_html":"(value : PG::Numeric)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L30"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f)"}},{"html_id":"parse(values:Array(PG::Numeric))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(PG::Numeric)"}],"args_string":"(values : Array(PG::Numeric))","args_html":"(values : Array(PG::Numeric))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L34"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(PG::Numeric)"}],"visibility":"Public","body":"SuccessfulCast(Array(Float64)).new(values.map(&.to_f))"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L38"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Float64).new(value.to_f64)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L44"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f64)"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L48"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f64)"}},{"html_id":"to_db(value:Float64):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64) : String","args_html":"(value : Float64) : String","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L52"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Float64))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"args_string":"(values : Array(Float64))","args_html":"(values : Array(Float64))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L56"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Float64/Lucky/ColumnType","path":"Float64/Lucky/ColumnType.html","kind":"alias","full_name":"Float64::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Float64 | PG::Numeric)","aliased_html":"Float64 | PG::Numeric","const":false,"namespace":{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"}},{"html_id":"avram/Float64/Lucky/Criteria","path":"Float64/Lucky/Criteria.html","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L60"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"}],"namespace":{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L61"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"select_sum:Float64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L63"},"def":{"name":"select_sum","return_type":"Float64 | ::Nil","visibility":"Public","body":"if sum = super()\n (sum.as(PG::Numeric)).to_f\nend"}},{"html_id":"select_sum!:Float64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L69"},"def":{"name":"select_sum!","return_type":"Float64","visibility":"Public","body":"select_sum || 0_f64"}}]}]}]},{"html_id":"avram/Gen","path":"Gen.html","kind":"module","full_name":"Gen","name":"Gen","abstract":false,"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Gen/Migration","path":"Gen/Migration.html","kind":"class","full_name":"Gen::Migration","name":"Migration","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"HABITAT_SETTINGS","name":"HABITAT_SETTINGS","value":"[{decl: io : IO = STDOUT, example: nil, validation: nil}] of Nil"},{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"configure(&)-class-method","name":"configure","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"configure","yields":1,"block_arity":1,"visibility":"Public","body":"yield settings"}},{"html_id":"settings-class-method","name":"settings","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}},{"html_id":"silence_output(&)-class-method","name":"silence_output","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L22"},"def":{"name":"silence_output","yields":0,"block_arity":0,"visibility":"Public","body":"temp_config(io: IO::Memory.new) do\n yield\nend"}},{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L5"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Generate a new migration using the passed in migration name.\\n\\nThe migration name must be CamelCase. No other options are available.\\n\\nExamples:\\n\\n lucky gen.migration CreateUsers\\n lucky gen.migration AddAgeToUsers\\n lucky gen.migration MakeUserNameOptional\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L3"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.migration\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L4"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a new migration\""}}],"instance_methods":[{"html_id":"call(name:String|Nil=nil)-instance-method","name":"call","abstract":false,"args":[{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil"}],"args_string":"(name : String | Nil = nil)","args_html":"(name : String | Nil = nil)","location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L28"},"def":{"name":"call","args":[{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil"}],"visibility":"Public","body":"Avram::Migrator.run do\n name = name || ARGV.first?\n if name\n Avram::Migrator::MigrationGenerator.new(name: name).generate\n else\n raise((\"Migration name is required. Example: lucky gen.migration CreateUsers\".colorize(:red)).to_s)\n end\nend"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L3"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"settings-instance-method","name":"settings","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"types":[{"html_id":"avram/Gen/Migration/HabitatSettings","path":"Gen/Migration/HabitatSettings.html","kind":"class","full_name":"Gen::Migration::HabitatSettings","name":"HabitatSettings","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L18"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen/Migration","kind":"class","full_name":"Gen::Migration","name":"Migration"},"class_methods":[{"html_id":"io:IO-class-method","name":"io","abstract":false,"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@@io.not_nil!"}},{"html_id":"io=(value:IO)-class-method","name":"io=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"IO"}],"args_string":"(value : IO)","args_html":"(value : IO)","def":{"name":"io=","args":[{"name":"value","external_name":"value","restriction":"IO"}],"visibility":"Public","body":"@@io = value"}},{"html_id":"io?-class-method","name":"io?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use io in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use io in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"io?","visibility":"Public","body":"@@io"}},{"html_id":"to_h-class-method","name":"to_h","doc":"Generates a hash using the provided values","summary":"

Generates a hash using the provided values

","abstract":false,"def":{"name":"to_h","visibility":"Public","body":"{\"io\" => io}"}}]}]},{"html_id":"avram/Gen/Mixins","path":"Gen/Mixins.html","kind":"module","full_name":"Gen::Mixins","name":"Mixins","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"types":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","path":"Gen/Mixins/MigrationWithColumns.html","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SUPPORTED_TYPES","name":"SUPPORTED_TYPES","value":"{\"Bool\", \"Float64\", \"Int16\", \"Int32\", \"Int64\", \"String\", \"Time\", \"UUID\", \"JSON::Any\"}"}],"including_types":[{"html_id":"avram/Gen/Model","kind":"class","full_name":"Gen::Model","name":"Model"},{"html_id":"avram/Gen/Resource/Browser","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser"}],"namespace":{"html_id":"avram/Gen/Mixins","kind":"module","full_name":"Gen::Mixins","name":"Mixins"},"instance_methods":[{"html_id":"create_migration-instance-method","name":"create_migration","abstract":false,"location":{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L4"},"def":{"name":"create_migration","visibility":"Public","body":"(Avram::Migrator::MigrationGenerator.new(\"Create#{pluralized_name}\", migrate_contents: migrate_contents, rollback_contents: rollback_contents)).generate"}}]}]},{"html_id":"avram/Gen/Model","path":"Gen/Model.html","kind":"class","full_name":"Gen::Model","name":"Model","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"}],"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.model\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L11"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a model, query, and operations (save and delete)\""}}],"instance_methods":[{"html_id":"call(io:IO=STDOUT)-instance-method","name":"call","abstract":false,"args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"args_string":"(io : IO = STDOUT)","args_html":"(io : IO = STDOUT)","location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L14"},"def":{"name":"call","args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"@io = io\nif valid?\n template.render(\"./src/\")\n create_migration\n display_success_messages\nelse\n io.puts(@error.colorize(:red))\nend\n"}},{"html_id":"help_message-instance-method","name":"help_message","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L24"},"def":{"name":"help_message","visibility":"Public","body":"\"#{summary}\\n\\nExample:\\n\\n lucky gen.model Project title:String description:String? completed:Bool priority:Int32\""}},{"html_id":"io:IO-instance-method","name":"io","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L12"},"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@io"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}]},{"html_id":"avram/Gen/Resource","path":"Gen/Resource.html","kind":"module","full_name":"Gen::Resource","name":"Resource","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"types":[{"html_id":"avram/Gen/Resource/Browser","path":"Gen/Resource/Browser.html","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"}],"namespace":{"html_id":"avram/Gen/Resource","kind":"module","full_name":"Gen::Resource","name":"Resource"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.resource.browser\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L11"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a resource (model, operation, query, actions, and pages)\""}}],"instance_methods":[{"html_id":"call(io:IO=STDOUT)-instance-method","name":"call","abstract":false,"args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"args_string":"(io : IO = STDOUT)","args_html":"(io : IO = STDOUT)","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L34"},"def":{"name":"call","args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"begin\n @io = io\n validate!\n generate_resource\n io.puts(\"\\nYou will need to run the #{\"lucky db.migrate\".colorize.green} task next\")\n display_path_to_resource\nrescue e : InvalidOption\n io.puts(e.message.colorize.red)\nend"}},{"html_id":"help_message-instance-method","name":"help_message","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L20"},"def":{"name":"help_message","visibility":"Public","body":"\"#{summary}\\n\\nRequires the name of the resource and list of database columns. Columns\\nare passed as column_name:ColumnType. Where ColumnType are one of the\\nsupported Avram datatypes.\\n\\nExample:\\n\\n lucky gen.resource.browser Project title:String description:String? completed:Bool priority:Int32\""}},{"html_id":"io:IO-instance-method","name":"io","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L12"},"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@io"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}],"types":[{"html_id":"avram/Gen/Resource/Browser/InvalidOption","path":"Gen/Resource/Browser/InvalidOption.html","kind":"class","full_name":"Gen::Resource::Browser::InvalidOption","name":"InvalidOption","abstract":false,"superclass":{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L14"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen/Resource/Browser","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser"},"constructors":[{"html_id":"new(message:String)-class-method","name":"new","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(message : String)","args_html":"(message : String)","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L15"},"def":{"name":"new","args":[{"name":"message","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]}]},{"html_id":"avram/Int16","path":"Int16.html","kind":"struct","full_name":"Int16","name":"Int16","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int16_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/int16_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L13"},{"filename":"src/avram/charms/int16_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L14"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int16/Lucky","path":"Int16/Lucky.html","kind":"module","full_name":"Int16::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int16","kind":"struct","full_name":"Int16","name":"Int16"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int16).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int16)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16)","args_html":"(value : Int16)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:Int16)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16)","args_html":"(value : Int16)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"visibility":"Public","body":"SuccessfulCast(Int16).new(value)"}},{"html_id":"parse(values:Array(Int16))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"args_string":"(values : Array(Int16))","args_html":"(values : Array(Int16))","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int16)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int16).new(value.to_i16)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L32"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int16).new(value.to_i16)\nrescue OverflowError\n FailedCast.new\nend"}},{"html_id":"to_db(value:Int16):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16) : String","args_html":"(value : Int16) : String","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L38"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int16))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"args_string":"(values : Array(Int16))","args_html":"(values : Array(Int16))","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L42"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int16/Lucky/ColumnType","path":"Int16/Lucky/ColumnType.html","kind":"alias","full_name":"Int16::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int16","aliased_html":"Int16","const":false,"namespace":{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"}},{"html_id":"avram/Int16/Lucky/Criteria","path":"Int16/Lucky/Criteria.html","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L46"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"}],"namespace":{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L47"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L49"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L58"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Int32","path":"Int32.html","kind":"struct","full_name":"Int32","name":"Int32","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int32_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/int32_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L19"},{"filename":"src/avram/charms/int32_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L20"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int32/Lucky","path":"Int32/Lucky.html","kind":"module","full_name":"Int32::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int32","kind":"struct","full_name":"Int32","name":"Int32"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int32).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int32)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int32).new(value.to_i)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Int32).new(value)"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L28"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int32).new(value.to_i32)\nrescue OverflowError\n FailedCast.new\nend"}},{"html_id":"parse(values:Array(Int32))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"args_string":"(values : Array(Int32))","args_html":"(values : Array(Int32))","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L34"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int32)).new(values)"}},{"html_id":"to_db(value:Int32):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32) : String","args_html":"(value : Int32) : String","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L38"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int32))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"args_string":"(values : Array(Int32))","args_html":"(values : Array(Int32))","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L42"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int32/Lucky/ColumnType","path":"Int32/Lucky/ColumnType.html","kind":"alias","full_name":"Int32::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int32","aliased_html":"Int32","const":false,"namespace":{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"}},{"html_id":"avram/Int32/Lucky/Criteria","path":"Int32/Lucky/Criteria.html","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L46"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"subclasses":[{"html_id":"avram/Enum/Lucky/Criteria","kind":"class","full_name":"Enum::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L47"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L48"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L50"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L59"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Int64","path":"Int64.html","kind":"struct","full_name":"Int64","name":"Int64","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int64_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/int64_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L25"},{"filename":"src/avram/charms/int64_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L26"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int64/Lucky","path":"Int64/Lucky.html","kind":"module","full_name":"Int64::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int64","kind":"struct","full_name":"Int64","name":"Int64"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int64).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int64)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"SuccessfulCast(Int64).new(value)"}},{"html_id":"parse(values:Array(Int64))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"args_string":"(values : Array(Int64))","args_html":"(values : Array(Int64))","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int64)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int64).new(value.to_i64)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L32"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Int64).new(value.to_i64)"}},{"html_id":"to_db(value:Int64):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64) : String","args_html":"(value : Int64) : String","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int64))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"args_string":"(values : Array(Int64))","args_html":"(values : Array(Int64))","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L40"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int64/Lucky/ColumnType","path":"Int64/Lucky/ColumnType.html","kind":"alias","full_name":"Int64::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int64","aliased_html":"Int64","const":false,"namespace":{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"}},{"html_id":"avram/Int64/Lucky/Criteria","path":"Int64/Lucky/Criteria.html","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L44"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L45"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L46"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L48"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L57"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Nil","path":"Nil.html","kind":"struct","full_name":"Nil","name":"Nil","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/object.cr#L32"},{"filename":"src/avram/blank_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L37"},{"filename":"src/avram/object_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L50"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"The `Nil` type has only one possible value: `nil`.\n\n`nil` is commonly used to represent the absence of a value.\nFor example, `String#index` returns the position of the character or `nil` if it's not\nin the string:\n\n```\nstr = \"Hello world\"\nstr.index 'e' # => 1\nstr.index 'a' # => nil\n```\n\nIn the above example, trying to invoke a method on the returned value will\ngive a compile time error unless both `Int32` and `Nil` define that method:\n\n```\nstr = \"Hello world\"\nidx = str.index 'e'\nidx + 1 # Error: undefined method '+' for Nil\n```\n\nThe language and the standard library provide short, readable, easy ways to deal with `nil`,\nsuch as `Object#try` and `Object#not_nil!`:\n\n```\nstr = \"Hello world\"\n\n# The index of 'e' in str or 0 if not found\nidx1 = str.index('e') || 0\n\nidx2 = str.index('a')\nif idx2\n # Compiles: idx2 can't be nil here\n idx2 + 1\nend\n\n# Tell the compiler that we are sure the returned\n# value is not nil: raises a runtime exception\n# if our assumption doesn't hold.\nidx3 = str.index('o').not_nil!\n```\n\nSee [`Nil` literal](https://crystal-lang.org/reference/syntax_and_semantics/literals/nil.html) in the language reference.","summary":"

The Nil type has only one possible value: nil.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L55"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/Object","path":"Object.html","kind":"class","full_name":"Object","name":"Object","abstract":true,"ancestors":[{"html_id":"avram/Lucky/Memoizable","kind":"module","full_name":"Lucky::Memoizable","name":"Memoizable"},{"html_id":"avram/Lucky/QuickDef","kind":"module","full_name":"Lucky::QuickDef","name":"QuickDef"},{"html_id":"avram/Colorize/ObjectExtensions","kind":"module","full_name":"Colorize::ObjectExtensions","name":"ObjectExtensions"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/object.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Colorize/ObjectExtensions","kind":"module","full_name":"Colorize::ObjectExtensions","name":"ObjectExtensions"},{"html_id":"avram/Lucky/Memoizable","kind":"module","full_name":"Lucky::Memoizable","name":"Memoizable"},{"html_id":"avram/Lucky/QuickDef","kind":"module","full_name":"Lucky::QuickDef","name":"QuickDef"}],"doc":"`Object` is the base type of all Crystal objects.","summary":"

Object is the base type of all Crystal objects.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L14"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/Slice","path":"Slice.html","kind":"struct","full_name":"Slice(T)","name":"Slice","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"},{"html_id":"avram/Indexable","kind":"module","full_name":"Indexable","name":"Indexable"},{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"},{"html_id":"avram/Iterable","kind":"module","full_name":"Iterable","name":"Iterable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L61"},{"filename":"src/avram/charms/slice_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"}],"doc":"A `Slice` is a `Pointer` with an associated size.\n\nWhile a pointer is unsafe because no bound checks are performed when reading from and writing to it,\nreading from and writing to a slice involve bound checks.\nIn this way, a slice is a safe alternative to `Pointer`.\n\nA Slice can be created as read-only: trying to write to it\nwill raise. For example the slice of bytes returned by\n`String#to_slice` is read-only.","summary":"

A Slice is a Pointer with an associated size.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L62"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"empty?"}}],"types":[{"html_id":"avram/Slice/Lucky","path":"Slice/Lucky.html","kind":"module","full_name":"Slice::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Slice","kind":"struct","full_name":"Slice(T)","name":"Slice"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Bytes).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Bytes)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"parse(value.to_slice)"}},{"html_id":"parse(value:Bytes)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"SuccessfulCast(Bytes).new(value)"}},{"html_id":"to_db(value:Bytes)-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L26"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"ssize = (value.size * 2) + 2\nString.new(ssize) do |buffer|\n buffer[0] = '\\\\'.ord.to_u8\n buffer[1] = 'x'.ord.to_u8\n value.hexstring(buffer + 2)\n {ssize, ssize}\nend\n"}},{"html_id":"to_db(value:String):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"value"}}],"types":[{"html_id":"avram/Slice/Lucky/ColumnType","path":"Slice/Lucky/ColumnType.html","kind":"alias","full_name":"Slice::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Slice(UInt8)","aliased_html":"Slice(UInt8)","const":false,"namespace":{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"}},{"html_id":"avram/Slice/Lucky/Criteria","path":"Slice/Lucky/Criteria.html","kind":"class","full_name":"Slice::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]},{"html_id":"avram/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/string_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/string_extensions.cr#L1"},{"filename":"src/avram/charms/string_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nA string might end up being composed of bytes which form an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but every\nbyte that doesn't start a valid UTF-8 byte sequence is interpreted as though\nit encodes the Unicode replacement character (U+FFFD) by itself. For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.\n\nNote that this interpretation only applies to methods inside Crystal; calling\n`#to_slice` or `#to_unsafe`, e.g. when passing a string to a C library, will\nexpose the invalid UTF-8 byte sequences. In particular, `Regex`'s underlying\nengine may reject strings that are not valid UTF-8, or it may invoke undefined\nbehavior on invalid strings. If this is undesired, `#scrub` could be used to\nremove the offending byte sequences first.","summary":"

A String represents an immutable sequence of UTF-8 characters.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"types":[{"html_id":"avram/String/Lucky","path":"String/Lucky.html","kind":"module","full_name":"String::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/String","kind":"class","full_name":"String","name":"String"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, String).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"SuccessfulCast(String).new(value)"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"SuccessfulCast(Array(String)).new(values)"}},{"html_id":"to_db(value:String):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L22"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"value"}},{"html_id":"to_db(values:Array(String))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L26"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/String/Lucky/ColumnType","path":"String/Lucky/ColumnType.html","kind":"alias","full_name":"String::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"String","aliased_html":"String","const":false,"namespace":{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"}},{"html_id":"avram/String/Lucky/Criteria","path":"String/Lucky/Criteria.html","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L30"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"ilike(value:String):T-instance-method","name":"ilike","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : T","args_html":"(value : String) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L37"},"def":{"name":"ilike","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Ilike.new(column, value))"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L31"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"like(value:String):T-instance-method","name":"like","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : T","args_html":"(value : String) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L33"},"def":{"name":"like","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Like.new(column, value))"}},{"html_id":"lower-instance-method","name":"lower","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L42"},"def":{"name":"lower","visibility":"Public","body":"Criteria(T, V).new(rows, \"LOWER(#{column})\")"}},{"html_id":"trim-instance-method","name":"trim","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L43"},"def":{"name":"trim","visibility":"Public","body":"Criteria(T, String).new(rows, \"TRIM(#{column})\")"}},{"html_id":"upper-instance-method","name":"upper","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L41"},"def":{"name":"upper","visibility":"Public","body":"Criteria(T, V).new(rows, \"UPPER(#{column})\")"}}]}]}]},{"html_id":"avram/Time","path":"Time.html","kind":"struct","full_name":"Time","name":"Time","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L7"},{"filename":"src/avram/charms/time_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"}],"doc":"`Time` represents a date-time instant in\n[incremental time](https://www.w3.org/International/articles/definitions-time/#incremental_time)\nobserved in a specific time zone.\n\nThe calendaric calculations are based on the rules of the proleptic Gregorian\ncalendar as specified in [ISO 8601](http://xml.coverpages.org/ISO-FDIS-8601.pdf).\nLeap seconds are ignored.\n\nInternally, the time is stored as an `Int64` representing seconds from epoch\n(`0001-01-01 00:00:00.0 UTC`) and an `Int32` representing\nnanosecond-of-second with value range `0..999_999_999`.\n\nThe supported date range is `0001-01-01 00:00:00.0` to\n`9999-12-31 23:59:59.999_999_999` in any local time zone.\n\n### Telling the Time\n\nThere are several methods to retrieve a `Time` instance representing the\ncurrent time:\n\n```\nTime.utc # returns the current time in UTC\nTime.local Time::Location.load(\"Europe/Berlin\") # returns the current time in time zone Europe/Berlin\nTime.local # returns the current time in current time zone\n```\n\nIt is generally recommended to keep instances in UTC and only apply a\nlocal time zone when formatting for user display, unless the domain logic\nrequires having a specific time zone (for example for calendaric operations).\n\n### Creating a Specific Instant\n\n`Time` instances representing a specific instant can be created by\n`.utc` or `.new` with the date-time specified as individual arguments:\n\n```\ntime = Time.utc(2016, 2, 15, 10, 20, 30)\ntime.to_s # => \"2016-02-15 10:20:30 UTC\"\ntime = Time.local(2016, 2, 15, 10, 20, 30, location: Time::Location.load(\"Europe/Berlin\"))\ntime.to_s # => \"2016-02-15 10:20:30 +01:00\"\n# The time-of-day can be omitted and defaults to midnight (start of day):\ntime = Time.utc(2016, 2, 15)\ntime.to_s # => \"2016-02-15 00:00:00 UTC\"\n```\n\n### Retrieving Time Information\n\nEach `Time` instance allows querying calendar data:\n\n```\ntime = Time.utc(2016, 2, 15, 10, 20, 30)\ntime.year # => 2016\ntime.month # => 2\ntime.day # => 15\ntime.hour # => 10\ntime.minute # => 20\ntime.second # => 30\ntime.millisecond # => 0\ntime.nanosecond # => 0\ntime.day_of_week # => Time::DayOfWeek::Monday\ntime.day_of_year # => 46\ntime.monday? # => true\ntime.time_of_day # => 10:20:30\n```\n\nFor querying if a time is at a specific day of week, `Time` offers named\npredicate methods, delegating to `#day_of_week`:\n\n```\ntime.monday? # => true\n# ...\ntime.sunday? # => false\n```\n\n### Time Zones\n\nEach time is attached to a specific time zone, represented by a `Location`\n(see `#location`).\n`#zone` returns the time zone observed in this location at the current time\n(i.e. the instant represented by this `Time`).\n`#offset` returns the offset of the current zone in seconds.\n\n```\ntime = Time.local(2018, 3, 8, 22, 5, 13, location: Time::Location.load(\"Europe/Berlin\"))\ntime # => 2018-03-08 22:05:13 +01:00 Europe/Berlin\ntime.location # => #\ntime.zone # => #\ntime.offset # => 3600\n```\n\nUsing `.utc`, the location is `Time::Location::UTC`:\n\n```\ntime = Time.utc(2018, 3, 8, 22, 5, 13)\ntime # => 2018-03-08 22:05:13.0 UTC\ntime.location # => #\ntime.zone # => #\ntime.offset # => 0\n```\n\nA `Time` instance can be transformed to a different time zone while retaining\nthe same instant using `#in`:\n\n```\ntime_de = Time.local(2018, 3, 8, 22, 5, 13, location: Time::Location.load(\"Europe/Berlin\"))\ntime_ar = time_de.in Time::Location.load(\"America/Buenos_Aires\")\ntime_de # => 2018-03-08 22:05:13 +01:00 Europe/Berlin\ntime_ar # => 2018-03-08 18:05:13 -03:00 America/Buenos_Aires\n```\n\nBoth `Time` instances show a different local date-time, but they represent\nthe same date-time in the instant time-line, therefore they are considered\nequal:\n\n```\ntime_de.to_utc # => 2018-03-08 21:05:13 UTC\ntime_ar.to_utc # => 2018-03-08 21:05:13 UTC\ntime_de == time_ar # => true\n```\n\nThere are also two special methods for converting to UTC and local time zone:\n\n```\ntime.to_utc # equals time.in(Location::UTC)\ntime.to_local # equals time.in(Location.local)\n```\n\n`#to_local_in` allows changing the time zone while keeping\nthe same local date-time (wall clock) which results in a different instant\non the time line.\n\n### Formatting and Parsing Time\n\nTo make date-time instances exchangeable between different computer systems\nor readable to humans, they are usually converted to and from a string\nrepresentation.\n\nThe method `#to_s` formats the date-time according to a specified pattern.\n\n```\ntime = Time.utc(2015, 10, 12, 10, 30, 0)\ntime.to_s(\"%Y-%m-%d %H:%M:%S %:z\") # => \"2015-10-12 10:30:00 +00:00\"\n```\n\nSimilarly, `Time.parse` and `Time.parse!` are used to construct a `Time` instance from date-time\ninformation in a string, according to a specified pattern:\n\n```\nTime.parse(\"2015-10-12 10:30:00 +00:00\", \"%Y-%m-%d %H:%M:%S %z\", Time::Location::UTC)\nTime.parse!(\"2015-10-12 10:30:00 +00:00\", \"%Y-%m-%d %H:%M:%S %z\")\n```\n\nSee `Time::Format` for all directives.\n\n### Calculations\n\n```\nTime.utc(2015, 10, 10) - 5.days # => 2015-10-05 00:00:00 +00:00\n\nspan = Time.utc(2015, 10, 10) - Time.utc(2015, 9, 10)\nspan.days # => 30\nspan.total_hours # => 720\nspan.total_minutes # => 43200\n```\n\n## Measuring Time\n\nThe typical time representation provided by the operating system is based on\na \"wall clock\" which is subject to changes for clock synchronization.\nThis can result in discontinuous jumps in the time-line making it not\nsuitable for accurately measuring elapsed time.\n\nInstances of `Time` are focused on telling time – using a \"wall clock\".\nWhen `Time.local` is called multiple times, the difference between the\nreturned instances is not guaranteed to equal to the time elapsed between\nmaking the calls; even the order of the returned `Time` instances might\nnot reflect invocation order.\n\n```\nt1 = Time.utc\n# operation that takes 1 minute\nt2 = Time.utc\nt2 - t1 # => ?\n```\n\nThe resulting `Time::Span` could be anything, even negative, if the\ncomputer's wall clock has changed between both calls.\n\nAs an alternative, the operating system also provides a monotonic clock.\nIts time-line has no specified starting point but is strictly linearly\nincreasing.\n\nThis monotonic clock should always be used for measuring elapsed time.\n\nA reading from this clock can be taken using `.monotonic`:\n\n```\nt1 = Time.monotonic\n# operation that takes 1 minute\nt2 = Time.monotonic\nt2 - t1 # => 1.minute (approximately)\n```\n\nThe execution time of a block can be measured using `.measure`:\n\n```\nelapsed_time = Time.measure do\n # operation that takes 20 milliseconds\nend\nelapsed_time # => 20.milliseconds (approximately)\n```","summary":"

Time represents a date-time instant in incremental time observed in a specific time zone.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L8"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Time/Lucky","path":"Time/Lucky.html","kind":"module","full_name":"Time::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"TIME_FORMATS","name":"TIME_FORMATS","value":"[Time::Format::ISO_8601_DATE_TIME, Time::Format::RFC_2822, Time::Format::RFC_3339, Time::Format.new(\"%Y-%m-%dT%H:%M:%S\", Time::Location::UTC), Time::Format.new(\"%Y-%m-%dT%H:%M\", Time::Location::UTC), Time::Format::HTTP_DATE, Time::Format::ISO_8601_DATE, Time::Format::ISO_8601_TIME]"}],"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Time","kind":"struct","full_name":"Time","name":"Time"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L25"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Time).new(query, column)"}},{"html_id":"try_parsing_with_default_formatters(value:String)-class-method","name":"try_parsing_with_default_formatters","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L42"},"def":{"name":"try_parsing_with_default_formatters","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"TIME_FORMATS.find do |format|\n begin\n format.parse(value)\n rescue e : Time::Format::Error\n nil\n end\nend.try do |format|\n SuccessfulCast.new((format.parse(value)).to_utc)\nend"}},{"html_id":"try_parsing_with_string_formats(value)-class-method","name":"try_parsing_with_string_formats","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L54"},"def":{"name":"try_parsing_with_string_formats","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"Avram.settings.time_formats.find do |format|\n begin\n Time.parse(value, format, Time::Location.load(\"UTC\"))\n rescue e : Time::Format::Error\n nil\n end\nend.try do |format|\n SuccessfulCast.new((Time.parse(value, format, Time::Location.load(\"UTC\"))).to_utc)\nend"}}],"instance_methods":[{"html_id":"from_db!(value:Time)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time)","args_html":"(value : Time)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L29"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Time"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String):SuccessfulCast(Time)|FailedCast-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : SuccessfulCast(Time) | FailedCast","args_html":"(value : String) : SuccessfulCast(Time) | FailedCast","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L33"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"SuccessfulCast(Time) | FailedCast","visibility":"Public","body":"((try_parsing_with_string_formats(value)) || (try_parsing_with_default_formatters(value))) || FailedCast.new"}},{"html_id":"parse(value:Time)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time)","args_html":"(value : Time)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L66"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Time"}],"visibility":"Public","body":"SuccessfulCast(Time).new(value)"}},{"html_id":"parse(values:Array(Time))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Time)"}],"args_string":"(values : Array(Time))","args_html":"(values : Array(Time))","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L70"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Time)"}],"visibility":"Public","body":"SuccessfulCast(Array(Time)).new(values)"}},{"html_id":"to_db(value:Time):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time) : String","args_html":"(value : Time) : String","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L74"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Time"}],"return_type":"String","visibility":"Public","body":"value.to_s(\"%F %X.%6N %z\")"}}],"types":[{"html_id":"avram/Time/Lucky/ColumnType","path":"Time/Lucky/ColumnType.html","kind":"alias","full_name":"Time::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Time","aliased_html":"Time","const":false,"namespace":{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"}},{"html_id":"avram/Time/Lucky/Criteria","path":"Time/Lucky/Criteria.html","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/ExtractCriteria","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L78"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/ExtractCriteria","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria"}],"namespace":{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"as_date-instance-method","name":"as_date","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L82"},"def":{"name":"as_date","visibility":"Public","body":"Criteria(T, String).new(rows, \"DATE(#{column})\")"}},{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L79"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"extract(chrono_unit:Avram::ChronoUnits)-instance-method","name":"extract","abstract":false,"args":[{"name":"chrono_unit","external_name":"chrono_unit","restriction":"Avram::ChronoUnits"}],"args_string":"(chrono_unit : Avram::ChronoUnits)","args_html":"(chrono_unit : Avram::ChronoUnits)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract","args":[{"name":"chrono_unit","external_name":"chrono_unit","restriction":"Avram::ChronoUnits"}],"visibility":"Public","body":"chrono_unit_in_sql_format = chrono_unit.to_s.underscore\napplied_operation = \"extract(#{chrono_unit_in_sql_format} from #{@column})\"\ncase chrono_unit\nwhen .julian?, .second?, .milliseconds?, .epoch?\n Criteria(T, Float64).new(rows, applied_operation)\nelse\n Criteria(T, Int32).new(rows, applied_operation)\nend\n"}},{"html_id":"extract(symbol:Symbol)-instance-method","name":"extract","abstract":false,"args":[{"name":"symbol","external_name":"symbol","restriction":"Symbol"}],"args_string":"(symbol : Symbol)","args_html":"(symbol : Symbol)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract","args":[{"name":"symbol","external_name":"symbol","restriction":"Symbol"}],"visibility":"Public","body":"if \"[century, day, decade, dow, doy, epoch, hour, isodow, isoyear, julian, microseconds, millennium, milliseconds, minute, month, quarter, second, timezone, timezone_hour, timezone_minute, week, year]\".includes?(symbol.to_s)\nelse\n raise(ArgumentError.new(\"Illegal value #{symbol} as a chrono unit. Allowed values are [century, day, decade, dow, doy, epoch, hour, isodow, isoyear, julian, microseconds, millennium, milliseconds, minute, month, quarter, second, timezone, timezone_hour, timezone_minute, week, year]\"))\nend\nchrono_unit_enum_member = symbol.to_s.camelcase\nextract(Avram::ChronoUnits.parse(chrono_unit_enum_member))\n"}},{"html_id":"extract_century-instance-method","name":"extract_century","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_century","visibility":"Public","body":"extract(:century)"}},{"html_id":"extract_day-instance-method","name":"extract_day","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_day","visibility":"Public","body":"extract(:day)"}},{"html_id":"extract_decade-instance-method","name":"extract_decade","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_decade","visibility":"Public","body":"extract(:decade)"}},{"html_id":"extract_dow-instance-method","name":"extract_dow","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_dow","visibility":"Public","body":"extract(:dow)"}},{"html_id":"extract_doy-instance-method","name":"extract_doy","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_doy","visibility":"Public","body":"extract(:doy)"}},{"html_id":"extract_epoch-instance-method","name":"extract_epoch","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_epoch","visibility":"Public","body":"extract(:epoch)"}},{"html_id":"extract_hour-instance-method","name":"extract_hour","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_hour","visibility":"Public","body":"extract(:hour)"}},{"html_id":"extract_isodow-instance-method","name":"extract_isodow","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_isodow","visibility":"Public","body":"extract(:isodow)"}},{"html_id":"extract_isoyear-instance-method","name":"extract_isoyear","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_isoyear","visibility":"Public","body":"extract(:isoyear)"}},{"html_id":"extract_julian-instance-method","name":"extract_julian","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_julian","visibility":"Public","body":"extract(:julian)"}},{"html_id":"extract_microseconds-instance-method","name":"extract_microseconds","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_microseconds","visibility":"Public","body":"extract(:microseconds)"}},{"html_id":"extract_millennium-instance-method","name":"extract_millennium","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_millennium","visibility":"Public","body":"extract(:millennium)"}},{"html_id":"extract_milliseconds-instance-method","name":"extract_milliseconds","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_milliseconds","visibility":"Public","body":"extract(:milliseconds)"}},{"html_id":"extract_minute-instance-method","name":"extract_minute","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_minute","visibility":"Public","body":"extract(:minute)"}},{"html_id":"extract_month-instance-method","name":"extract_month","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_month","visibility":"Public","body":"extract(:month)"}},{"html_id":"extract_quarter-instance-method","name":"extract_quarter","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_quarter","visibility":"Public","body":"extract(:quarter)"}},{"html_id":"extract_second-instance-method","name":"extract_second","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_second","visibility":"Public","body":"extract(:second)"}},{"html_id":"extract_timezone-instance-method","name":"extract_timezone","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone","visibility":"Public","body":"extract(:timezone)"}},{"html_id":"extract_timezone_hour-instance-method","name":"extract_timezone_hour","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone_hour","visibility":"Public","body":"extract(:timezone_hour)"}},{"html_id":"extract_timezone_minute-instance-method","name":"extract_timezone_minute","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone_minute","visibility":"Public","body":"extract(:timezone_minute)"}},{"html_id":"extract_week-instance-method","name":"extract_week","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_week","visibility":"Public","body":"extract(:week)"}},{"html_id":"extract_year-instance-method","name":"extract_year","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_year","visibility":"Public","body":"extract(:year)"}}]}]}]},{"html_id":"avram/UUID","path":"UUID.html","kind":"struct","full_name":"UUID","name":"UUID","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/uuid_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/uuid_extensions.cr#L1"},{"filename":"src/avram/blank_extensions.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L49"},{"filename":"src/avram/charms/uuid_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"doc":"Represents a UUID (Universally Unique IDentifier).\n\nNOTE: To use `UUID`, you must explicitly import it with `require \"uuid\"`","summary":"

Represents a UUID (Universally Unique IDentifier).

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L50"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"false"}}],"types":[{"html_id":"avram/UUID/Lucky","path":"UUID/Lucky.html","kind":"module","full_name":"UUID::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/UUID","kind":"struct","full_name":"UUID","name":"UUID"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, UUID).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:UUID)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"UUID"}],"args_string":"(value : UUID)","args_html":"(value : UUID)","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"UUID"}],"visibility":"Public","body":"SuccessfulCast(UUID).new(value)"}},{"html_id":"parse(values:Array(UUID))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"args_string":"(values : Array(UUID))","args_html":"(values : Array(UUID))","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"visibility":"Public","body":"SuccessfulCast(Array(UUID)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(UUID).new(UUID.new(value))\nrescue\n FailedCast.new\nend"}},{"html_id":"to_db(value:UUID):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"UUID"}],"args_string":"(value : UUID) : String","args_html":"(value : UUID) : String","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L28"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"UUID"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(UUID))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"args_string":"(values : Array(UUID))","args_html":"(values : Array(UUID))","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L32"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/UUID/Lucky/ColumnType","path":"UUID/Lucky/ColumnType.html","kind":"alias","full_name":"UUID::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"UUID","aliased_html":"UUID","const":false,"namespace":{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}},{"html_id":"avram/UUID/Lucky/Criteria","path":"UUID/Lucky/Criteria.html","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L36"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L37"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}}]}]}]}]}} \ No newline at end of file +{"repository_name":"avram","body":"# Avram\n\n[![API Documentation Website](https://img.shields.io/website?down_color=red&down_message=Offline&label=API%20Documentation&up_message=Online&url=https%3A%2F%2Fluckyframework.github.io%2Favram%2F)](https://luckyframework.github.io/avram)\n\n### Why Avram?\n\nThe name comes from [Henriette Avram](https://en.wikipedia.org/wiki/Henriette_Avram).\n\n> Henriette Davidson Avram (October 7, 1919 – April 22, 2006) was a computer programmer and systems analyst who developed the MARC format (Machine Readable Cataloging), the international data standard for bibliographic and holdings information in libraries.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n avram:\n github: luckyframework/avram\n```\n\n## Usage\n\n```crystal\nrequire \"avram\"\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/luckyframework/avram/fork )\n1. Create your feature branch (git checkout -b my-new-feature)\n1. Install docker and docker-compose: https://docs.docker.com/compose/install/\n1. Run `script/setup`\n1. Make your changes\n1. Run `script/test` to run the specs, build shards, and check formatting\n1. Commit your changes (git commit -am 'Add some feature')\n1. Push to the branch (git push origin my-new-feature)\n1. Create a new Pull Request\n\n## Testing\n\nTo run the tests:\n\n1. Install docker and docker-compose: https://docs.docker.com/compose/install/\n1. Run `script/setup` to set up the docker environment\n1. Run `script/test` to run the specs, build shards, and check formatting\n\nYou can run individual tests like this: `docker-compose run --rm app crystal spec path/to/spec.cr`\n\n> Remember to run `docker-compose down` when you're done. This will stop the\n> Crystal container.\n\n## Contributors\n\n- [paulcsmith](https://github.com/paulcsmith) Paul Smith - creator, maintainer\n- [mikeeus](https://github.com/mikeeus) Mikias Abera - contributor\n","program":{"html_id":"avram/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"avram","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Array","path":"Array.html","kind":"class","full_name":"Array(T)","name":"Array","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"},{"html_id":"avram/Indexable","kind":"module","full_name":"Indexable","name":"Indexable"},{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"},{"html_id":"avram/Iterable","kind":"module","full_name":"Iterable","name":"Iterable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L55"},{"filename":"src/avram/charms/array_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/array_extensions.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L19"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"}],"doc":"An `Array` is an ordered, integer-indexed collection of objects of type T.\n\nArray indexing starts at 0. A negative index is assumed to be\nrelative to the end of the array: -1 indicates the last element,\n-2 is the next to last element, and so on.\n\nAn `Array` can be created using the usual `new` method (several are provided), or with an array literal:\n\n```\nArray(Int32).new # => []\n[1, 2, 3] # Array(Int32)\n[1, \"hello\", 'x'] # Array(Int32 | String | Char)\n```\n\nSee [`Array` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/array.html) in the language reference.\n\nAn `Array` can have mixed types, meaning T will be a union of types, but these are determined\nwhen the array is created, either by specifying T or by using an array literal. In the latter\ncase, T will be set to the union of the array literal elements' types.\n\nWhen creating an empty array you must always specify T:\n\n```\n[] of Int32 # same as Array(Int32)\n[] # syntax error\n```\n\nAn `Array` is implemented using an internal buffer of some capacity\nand is reallocated when elements are pushed to it when more capacity\nis needed. This is normally known as a [dynamic array](http://en.wikipedia.org/wiki/Dynamic_array).\n\nYou can use a special array literal syntax with other types too, as long as they define an argless\n`new` method and a `<<` method. `Set` is one such type:\n\n```\nset = Set{1, 2, 3} # => Set{1, 2, 3}\nset.class # => Set(Int32)\n```\n\nThe above is the same as this:\n\n```\nset = Set(typeof(1, 2, 3)).new\nset << 1\nset << 2\nset << 3\n```","summary":"

An Array is an ordered, integer-indexed collection of objects of type T.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","doc":"Proxy to the `T`'s adapter so we can call methods like\n`Array(String).adapter.to_db([\"test\"])`","summary":"

Proxy to the T's adapter so we can call methods like Array(String).adapter.to_db(["test"])

","abstract":false,"location":{"filename":"src/avram/charms/array_extensions.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/array_extensions.cr#L4"},"def":{"name":"adapter","visibility":"Public","body":"T.adapter"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L56"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"empty?"}},{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","doc":"Arrays of any size should be considered present","summary":"

Arrays of any size should be considered present

","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L21"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"false"}}]},{"html_id":"avram/Avram","path":"Avram.html","kind":"module","full_name":"Avram","name":"Avram","abstract":false,"ancestors":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"locations":[{"filename":"src/avram.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L25"},{"filename":"src/avram/chrono_units.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L1"},{"filename":"src/avram/criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L1"},{"filename":"src/avram/database/column_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L1"},{"filename":"src/avram/database/database_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L1"},{"filename":"src/avram/database/table_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L1"},{"filename":"src/avram/errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L1"},{"filename":"src/avram/order_by_clause.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L1"},{"filename":"src/avram/order_by_clause/order_by.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L1"},{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L1"},{"filename":"src/avram/version.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/version.cr#L1"},{"filename":"src/lucky/ext/avram/errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"FailedQueryLog","name":"FailedQueryLog","value":"Log.for(\"failed_query\")"},{"id":"HABITAT_SETTINGS","name":"HABITAT_SETTINGS","value":"[{decl: lazy_load_enabled : Bool = true, example: nil, validation: nil}, {decl: database_to_migrate : Avram::Database.class, example: \"AppDatabase\", validation: nil}, {decl: time_formats : Array(String) = [] of String, example: nil, validation: nil}, {decl: i18n_backend : Avram::I18nBackend = Avram::I18n.new, example: \"Avram::I18n.new\", validation: nil}, {decl: query_cache_enabled : Bool = false, example: nil, validation: nil}] of Nil"},{"id":"Log","name":"Log","value":"::Log.for(Avram)"},{"id":"QueryLog","name":"QueryLog","value":"Log.for(\"query\")"},{"id":"SaveFailedLog","name":"SaveFailedLog","value":"Log.for(\"save_failed\")"},{"id":"VERSION","name":"VERSION","value":"\"1.1.1\""}],"included_modules":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"class_methods":[{"html_id":"configure(&)-class-method","name":"configure","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L26"},"def":{"name":"configure","yields":1,"block_arity":1,"visibility":"Public","body":"yield settings"}},{"html_id":"initialize_logging-class-method","name":"initialize_logging","doc":"This subscribes to several `Pulsar` events.\nThese events are triggered during query and\noperation events","summary":"

This subscribes to several Pulsar events.

","abstract":false,"location":{"filename":"src/avram.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L44"},"def":{"name":"initialize_logging","visibility":"Public","body":"Avram::Events::QueryEvent.subscribe do |event, duration|\n if event.query.starts_with?(\"TRUNCATE\")\n next\n end\n Avram::QueryLog.dexter.info do\n queryable = event.queryable\n log_data = {query: event.query, args: event.args, duration: Pulsar.elapsed_text(duration)}\n if queryable\n {model: queryable}.merge(log_data)\n else\n log_data\n end\n end\nend\nAvram::Events::FailedQueryEvent.subscribe do |event|\n Avram::FailedQueryLog.dexter.error do\n queryable = event.queryable\n log_data = {error_message: event.error_message, query: event.query, args: \"[FILTERED]\"}\n if queryable\n {model: queryable}.merge(log_data)\n else\n log_data\n end\n end\nend\nAvram::Events::SaveFailedEvent.subscribe do |event|\n Avram::SaveFailedLog.dexter.warn do\n {failed_to_save: event.operation_class, validation_errors: event.error_messages_as_string}\n end\nend\n"}},{"html_id":"settings-class-method","name":"settings","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L26"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"instance_methods":[{"html_id":"settings-instance-method","name":"settings","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L26"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"types":[{"html_id":"avram/Avram/AddColumnAttributes","path":"Avram/AddColumnAttributes.html","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes","abstract":false,"locations":[{"filename":"src/avram/add_column_attributes.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/add_column_attributes.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"This module creates methods for each column in a model that map\nto an `Avram::Attribute` as well as methods that fill those attributes\nwith values that comes from params.","summary":"

This module creates methods for each column in a model that map to an Avram::Attribute as well as methods that fill those attributes with values that comes from params.

"},{"html_id":"avram/Avram/Associations","path":"Avram/Associations.html","kind":"module","full_name":"Avram::Associations","name":"Associations","abstract":false,"ancestors":[{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"}],"locations":[{"filename":"src/avram/associations.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations.cr#L3"},{"filename":"src/avram/associations/belongs_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/belongs_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"}],"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Associations/BelongsTo","path":"Avram/Associations/BelongsTo.html","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo","abstract":false,"locations":[{"filename":"src/avram/associations/belongs_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/belongs_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"belongs_to(type_declaration,foreign_key=nil)-macro","name":"belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, foreign_key = nil)","args_html":"(type_declaration, foreign_key = nil)","location":{"filename":"src/avram/associations/belongs_to.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/belongs_to.cr#L2"},"def":{"name":"belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if type_declaration.type.is_a?(Union) %}\n {% model = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% model = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n\n \n{% if !foreign_key %}\n {% foreign_key = \"#{assoc_name}_id\".id %}\n {% end %}\n\n\n column \n{{ foreign_key.id }}\n : \n{{ model }}\n::PrimaryKeyType\n{% if nilable %}?{% end %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name.id }}\n,\n type: \n{{ model }}\n,\n foreign_key: :\n{{ foreign_key.id }}\n,\n relationship_type: :belongs_to\n\n define_belongs_to_private_assoc_getter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key.id }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_public_preloaded_getters(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_preloaded_setter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n define_belongs_to_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key.id }}\n)\n \n"}}]},{"html_id":"avram/Avram/Associations/HasMany","path":"Avram/Associations/HasMany.html","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany","abstract":false,"locations":[{"filename":"src/avram/associations/has_many.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/has_many.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"has_many(type_declaration,through=nil,foreign_key=nil)-macro","name":"has_many","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, through = nil, foreign_key = nil)","args_html":"(type_declaration, through = nil, foreign_key = nil)","location":{"filename":"src/avram/associations/has_many.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/has_many.cr#L2"},"def":{"name":"has_many","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% if (!through.is_a?(NilLiteral)) && ((!through.is_a?(ArrayLiteral)) || through.any? do |item|\n !item.is_a?(SymbolLiteral)\nend) %}\n {% through.raise(\"'through' on #{@type.name} must be given an Array(Symbol). Instead, got: #{through}\\n\\nExample...\\n has_many comments : Comment\\n has_many related_authors : User, through: [:comments, :author]\\n\\nLearn more about associations: https://luckyframework.org/guides/database/models#model-associations\") %}\n {% end %}\n\n \n{% if (!through.is_a?(NilLiteral)) && through.size < 2 %}\n {% through.raise(\"'through' on #{@type.name} must be given at least two items. Instead, got: #{through}\\n\\nExample...\\n has_many comments : Comment\\n has_many related_authors : User, through: [:comments, :author]\\n\\nLearn more about associations: https://luckyframework.org/guides/database/models#model-associations\") %}\n {% end %}\n\n \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if foreign_key %}{% else %}\n {% foreign_key = \"#{(@type.name.underscore.split(\"::\")).last.id}_id\".id %}\n {% end %}\n\n\n \n{% foreign_key = foreign_key.id %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name }}\n,\n type: \n{{ type_declaration.type }}\n,\n foreign_key: :\n{{ foreign_key }}\n,\n through: \n{{ through }}\n,\n relationship_type: :has_many\n\n \n{% model = type_declaration.type %}\n\n\n define_has_many_lazy_loading(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ through }}\n)\n define_has_many_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ through }}\n)\n \n"}}]},{"html_id":"avram/Avram/Associations/HasOne","path":"Avram/Associations/HasOne.html","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne","abstract":false,"locations":[{"filename":"src/avram/associations/has_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/has_one.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"has_one(type_declaration,foreign_key=nil)-macro","name":"has_one","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, foreign_key = nil)","args_html":"(type_declaration, foreign_key = nil)","location":{"filename":"src/avram/associations/has_one.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/has_one.cr#L2"},"def":{"name":"has_one","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if type_declaration.type.is_a?(Union) %}\n {% model = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% model = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n\n \n{% if foreign_key %}{% else %}\n {% foreign_key = \"#{(@type.name.underscore.split(\"::\")).last.id}_id\".id %}\n {% end %}\n\n\n \n{% foreign_key = foreign_key.id %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name.id }}\n,\n type: \n{{ model }}\n,\n foreign_key: :\n{{ foreign_key.id }}\n,\n relationship_type: :has_one\n\n Avram::Associations.__define_public_preloaded_getters(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_preloaded_setter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n define_has_one_private_assoc_getter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ nilable }}\n)\n define_has_one_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n)\n \n"}}]}]},{"html_id":"avram/Avram/Attribute","path":"Avram/Attribute.html","kind":"class","full_name":"Avram::Attribute(T)","name":"Attribute","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/attribute.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/PermittedAttribute","kind":"class","full_name":"Avram::PermittedAttribute(T)","name":"PermittedAttribute"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(name:Symbol,value:T|Nil,param_key:String,param:Array(String)|Avram::Uploadable|String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::Symbol"},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"::String"},{"name":"param","default_value":"nil","external_name":"param","restriction":"::Array(::String) | ::Avram::Uploadable | ::String | ::Nil"}],"args_string":"(name : Symbol, value : T | Nil, param_key : String, param : Array(String) | Avram::Uploadable | String | Nil = nil)","args_html":"(name : Symbol, value : T | Nil, param_key : String, param : Array(String) | Avram::Uploadable | String | Nil = nil)","location":{"filename":"src/avram/attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::Symbol"},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"::String"},{"name":"param","default_value":"nil","external_name":"param","restriction":"::Array(::String) | ::Avram::Uploadable | ::String | ::Nil"}],"visibility":"Public","body":"_ = Attribute(T).allocate\n_.initialize(name, value, param_key, param)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"[](key)-instance-method","name":"[]","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/attribute.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L167"},"def":{"name":"[]","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":"call_value_instead_error_message(\".[key]\")"}},{"html_id":"[]?(key)-instance-method","name":"[]?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/attribute.cr","line_number":171,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L171"},"def":{"name":"[]?","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":"call_value_instead_error_message(\".[key]?\")"}},{"html_id":"add_error(message:String=\"isinvalid\")-instance-method","name":"add_error","abstract":false,"args":[{"name":"message","default_value":"\"is invalid\"","external_name":"message","restriction":"String"}],"args_string":"(message : String = \"is invalid\")","args_html":"(message : String = "is invalid")","location":{"filename":"src/avram/attribute.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L34"},"def":{"name":"add_error","args":[{"name":"message","default_value":"\"is invalid\"","external_name":"message","restriction":"String"}],"visibility":"Public","body":"@errors << message"}},{"html_id":"add_error(message:Proc|Avram::CallableErrorMessage)-instance-method","name":"add_error","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"Proc | Avram::CallableErrorMessage"}],"args_string":"(message : Proc | Avram::CallableErrorMessage)","args_html":"(message : Proc | Avram::CallableErrorMessage)","location":{"filename":"src/avram/attribute.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L38"},"def":{"name":"add_error","args":[{"name":"message","external_name":"message","restriction":"Proc | Avram::CallableErrorMessage"}],"visibility":"Public","body":"message_string = message.call(@name.to_s, @value.to_s)\nadd_error(message_string)\n"}},{"html_id":"allow_blank=(allow_blank:Bool)-instance-method","name":"allow_blank=","doc":"This can be used as an escape hatch when you\nmay have a blank string that's allowed to be saved.","summary":"

This can be used as an escape hatch when you may have a blank string that's allowed to be saved.

","abstract":false,"args":[{"name":"allow_blank","external_name":"allow_blank","restriction":"Bool"}],"args_string":"(allow_blank : Bool)","args_html":"(allow_blank : Bool)","location":{"filename":"src/avram/attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L11"},"def":{"name":"allow_blank=","args":[{"name":"allow_blank","external_name":"allow_blank","restriction":"Bool"}],"visibility":"Public","body":"@allow_blank = allow_blank"}},{"html_id":"allow_blank?:Bool-instance-method","name":"allow_blank?","doc":"This can be used as an escape hatch when you\nmay have a blank string that's allowed to be saved.","summary":"

This can be used as an escape hatch when you may have a blank string that's allowed to be saved.

","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L11"},"def":{"name":"allow_blank?","return_type":"Bool","visibility":"Public","body":"@allow_blank"}},{"html_id":"changed?(from:T|Nil|Nothing=Nothing.new,to:T|Nil|Nothing=Nothing.new):Bool-instance-method","name":"changed?","abstract":false,"args":[{"name":"from","default_value":"Nothing.new","external_name":"from","restriction":"T | ::Nil | Nothing"},{"name":"to","default_value":"Nothing.new","external_name":"to","restriction":"T | ::Nil | Nothing"}],"args_string":"(from : T | Nil | Nothing = Nothing.new, to : T | Nil | Nothing = Nothing.new) : Bool","args_html":"(from : T | Nil | Nothing = Nothing.new, to : T | Nil | Nothing = Nothing.new) : Bool","location":{"filename":"src/avram/attribute.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L79"},"def":{"name":"changed?","args":[{"name":"from","default_value":"Nothing.new","external_name":"from","restriction":"T | ::Nil | Nothing"},{"name":"to","default_value":"Nothing.new","external_name":"to","restriction":"T | ::Nil | Nothing"}],"return_type":"Bool","visibility":"Public","body":"from = from.is_a?(Nothing) ? true : from == original_value\nto = to.is_a?(Nothing) ? true : to == value\n((value != original_value) && from) && to\n"}},{"html_id":"errors:Array(String)-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L47"},"def":{"name":"errors","return_type":"Array(String)","visibility":"Public","body":"@errors.uniq"}},{"html_id":"extract(params:Avram::Paramable)-instance-method","name":"extract","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/attribute.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L85"},"def":{"name":"extract","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"}],"visibility":"Public","body":"extract(params, type: T)"}},{"html_id":"name:Symbol-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L3"},"def":{"name":"name","return_type":"Symbol","visibility":"Public","body":"@name"}},{"html_id":"original_value:T|Nil-instance-method","name":"original_value","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L59"},"def":{"name":"original_value","return_type":"T | ::Nil","visibility":"Public","body":"if allow_blank?\n @original_value\nelse\n ensure_no_blank(@original_value)\nend"}},{"html_id":"param:Avram::Uploadable|Array(String)|String-instance-method","name":"param","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L30"},"def":{"name":"param","return_type":"Avram::Uploadable | Array(String) | String","visibility":"Public","body":"@param || value.to_s"}},{"html_id":"param_key:String-instance-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L5"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"@param_key"}},{"html_id":"permitted-instance-method","name":"permitted","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L19"},"def":{"name":"permitted","visibility":"Public","body":"@_permitted || (@_permitted = (Avram::PermittedAttribute(T).new(name: @name, param: @param, value: @value, param_key: @param_key).tap do |attribute|\n attribute.allow_blank = allow_blank?\n errors.each do |error|\n attribute.add_error(error)\n end\nend))"}},{"html_id":"reset_errors-instance-method","name":"reset_errors","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L43"},"def":{"name":"reset_errors","visibility":"Public","body":"@errors = [] of String"}},{"html_id":"to_f-instance-method","name":"to_f","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":159,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L159"},"def":{"name":"to_f","visibility":"Public","body":"call_value_instead_error_message(\".to_f\")"}},{"html_id":"to_f64-instance-method","name":"to_f64","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":163,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L163"},"def":{"name":"to_f64","visibility":"Public","body":"call_value_instead_error_message(\".to_f64\")"}},{"html_id":"to_i-instance-method","name":"to_i","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L147"},"def":{"name":"to_i","visibility":"Public","body":"call_value_instead_error_message(\".to_i\")"}},{"html_id":"to_i32-instance-method","name":"to_i32","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":151,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L151"},"def":{"name":"to_i32","visibility":"Public","body":"call_value_instead_error_message(\".to_i32\")"}},{"html_id":"to_i64-instance-method","name":"to_i64","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L155"},"def":{"name":"to_i64","visibility":"Public","body":"call_value_instead_error_message(\".to_i64\")"}},{"html_id":"to_s(time_format:String)-instance-method","name":"to_s","doc":"NOTE: to_s(io : IO) is used when passing an object\nin to string interpolation. Don't override that method.","summary":"

NOTE to_s(io : IO) is used when passing an object in to string interpolation.

","abstract":false,"args":[{"name":"time_format","external_name":"time_format","restriction":"String"}],"args_string":"(time_format : String)","args_html":"(time_format : String)","location":{"filename":"src/avram/attribute.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L143"},"def":{"name":"to_s","args":[{"name":"time_format","external_name":"time_format","restriction":"String"}],"visibility":"Public","body":"call_value_instead_error_message(\".to_s(...)\")"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"These methods may accidentally get called on attributes\ninside of operations. Since these methods don't exist,\nchances are, you meant to call them on the value.\n```\nusername.to_s\n# VS\nusername.value.to_s\n```","summary":"

These methods may accidentally get called on attributes inside of operations.

","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L137"},"def":{"name":"to_s","visibility":"Public","body":"call_value_instead_error_message(\".to_s\")"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L75"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"errors.empty?"}},{"html_id":"value:T|Nil-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L51"},"def":{"name":"value","return_type":"T | ::Nil","visibility":"Public","body":"if allow_blank?\n @value\nelse\n ensure_no_blank(@value)\nend"}},{"html_id":"value=(value:T|Nil)-instance-method","name":"value=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T | ::Nil"}],"args_string":"(value : T | Nil)","args_html":"(value : T | Nil)","location":{"filename":"src/avram/attribute.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L4"},"def":{"name":"value=","args":[{"name":"value","external_name":"value","restriction":"T | ::Nil"}],"visibility":"Public","body":"@value = value"}}],"macros":[{"html_id":"call_value_instead_error_message(method)-macro","name":"call_value_instead_error_message","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""}],"args_string":"(method)","args_html":"(method)","location":{"filename":"src/avram/attribute.cr","line_number":175,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L175"},"def":{"name":"call_value_instead_error_message","args":[{"name":"method","external_name":"method","restriction":""}],"visibility":"Public","body":" \n{% raise(\"\\nThe #{method.id} method should not be called directly on attributes (#{@type}).\\nDid you mean to call it on the value property?\\n\\nTry this...\\n\\n ▸ attribute.value#{method.id}\\n\") %}\n\n \n"}}],"types":[{"html_id":"avram/Avram/Attribute/ErrorMessage","path":"Avram/Attribute/ErrorMessage.html","kind":"alias","full_name":"Avram::Attribute::ErrorMessage","name":"ErrorMessage","abstract":false,"locations":[{"filename":"src/avram/attribute.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Avram::CallableErrorMessage | Proc(String, String, String) | String)","aliased_html":"Avram::CallableErrorMessage | String, String -> String | String","const":false,"namespace":{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute(T)","name":"Attribute"}}]},{"html_id":"avram/Avram/AvramError","path":"Avram/AvramError.html","kind":"class","full_name":"Avram::AvramError","name":"AvramError","abstract":false,"superclass":{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/ConnectionError","kind":"class","full_name":"Avram::ConnectionError","name":"ConnectionError"},{"html_id":"avram/Avram/FailedMigration","kind":"class","full_name":"Avram::FailedMigration","name":"FailedMigration"},{"html_id":"avram/Avram/FailedOperation","kind":"class","full_name":"Avram::FailedOperation","name":"FailedOperation"},{"html_id":"avram/Avram/ImpossibleValidation","kind":"class","full_name":"Avram::ImpossibleValidation","name":"ImpossibleValidation"},{"html_id":"avram/Avram/InvalidDatabaseNameError","kind":"class","full_name":"Avram::InvalidDatabaseNameError","name":"InvalidDatabaseNameError"},{"html_id":"avram/Avram/InvalidOperationError","kind":"class","full_name":"Avram::InvalidOperationError","name":"InvalidOperationError"},{"html_id":"avram/Avram/InvalidQueryError","kind":"class","full_name":"Avram::InvalidQueryError","name":"InvalidQueryError"},{"html_id":"avram/Avram/LazyLoadError","kind":"class","full_name":"Avram::LazyLoadError","name":"LazyLoadError"},{"html_id":"avram/Avram/MissingRequiredAssociationError","kind":"class","full_name":"Avram::MissingRequiredAssociationError","name":"MissingRequiredAssociationError"},{"html_id":"avram/Avram/PGClientNotInstalledError","kind":"class","full_name":"Avram::PGClientNotInstalledError","name":"PGClientNotInstalledError"},{"html_id":"avram/Avram/PGNotRunningError","kind":"class","full_name":"Avram::PGNotRunningError","name":"PGNotRunningError"},{"html_id":"avram/Avram/RecordNotFoundError","kind":"class","full_name":"Avram::RecordNotFoundError","name":"RecordNotFoundError"},{"html_id":"avram/Avram/Rollback","kind":"class","full_name":"Avram::Rollback","name":"Rollback"},{"html_id":"avram/Avram/SchemaMismatchError","kind":"class","full_name":"Avram::SchemaMismatchError","name":"SchemaMismatchError"},{"html_id":"avram/Avram/UnsupportedQueryError","kind":"class","full_name":"Avram::UnsupportedQueryError","name":"UnsupportedQueryError"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Generic Avram exception class.","summary":"

Generic Avram exception class.

"},{"html_id":"avram/Avram/BaseQueryTemplate","path":"Avram/BaseQueryTemplate.html","kind":"class","full_name":"Avram::BaseQueryTemplate","name":"BaseQueryTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/base_query_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/base_query_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,associations,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, associations, *args, **named_args)","args_html":"(type, columns, associations, *args, **named_args)","location":{"filename":"src/avram/base_query_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/base_query_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":3,"visibility":"Public","body":" class ::\n{{ type }}\n::BaseQuery\n def_clone\n include Avram::Queryable(\n{{ type }}\n)\n\n \n{% if type.resolve.has_constant?(\"PRIMARY_KEY_NAME\") %}\n include Avram::PrimaryKeyQueryable({{ type }})\n {% end %}\n\n\n macro generate_criteria_method(name, type)\n def \n\\{\n{ name }}\n \n\\{\n{ type }}.adapter.criteria(self, \"#{table_name}.\n\\{\n{ name }}\")\n \nend\n \nend\n\n def update(\n \n{% for column in columns %}\n {{ column[:name] }} : {{ column[:type] }} | Avram::Nothing{% if column[:nilable] %} | Nil{% end %} = Avram::Nothing.new,\n {% end %}\n\n ) : Int64\n\n _changes = \n{} of Symbol => String?\n\n \n{% for column in columns %}\n if {{ column[:name] }}.nil?\n _changes[:{{ column[:name] }}] = nil\n elsif {{ column[:name] }}.is_a?(Avram::Nothing)\n nil\n else\n value = {{ column[:name] }}.not_nil!.class.adapter.to_db({{ column[:name] }}).to_s\n _changes[:{{ column[:name] }}] = value\n end\n {% end %}\n\n\n database.exec(\n query.statement_for_update(_changes, return_columns: false),\n args: query.args_for_update(_changes)\n ).rows_affected\n \nend\n\n \n{% for column in columns %}\n def {{ column[:name] }}(value)\n {{ column[:name] }}.eq(value)\n end\n\n generate_criteria_method({{ column[:name] }}, {{ column[:type] }})\n\n macro inherited\n generate_criteria_method({{ column[:name] }}, {{ column[:type] }})\n end\n {% end %}\n\n\n \n{% for assoc in associations %}\n def join_{{ assoc[:assoc_name] }}\n inner_join_{{ assoc[:assoc_name] }}\n end\n\n {% for join_type in [\"Inner\", \"Left\", \"Right\", \"Full\"] %}\n def {{ join_type.downcase.id }}_join_{{ assoc[:assoc_name] }}\n {% if assoc[:relationship_type] == (:belongs_to) %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n primary_key: {{ assoc[:foreign_key].id.symbolize }},\n foreign_key: {{ assoc[:type] }}::PRIMARY_KEY_NAME\n )\n )\n {% else %}{% if assoc[:relationship_type] == (:has_one) %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n foreign_key: {{ assoc[:foreign_key].id.symbolize }},\n primary_key: primary_key_name\n )\n )\n {% else %}{% if assoc[:through] %}\n {{ join_type.downcase.id }}_join_{{ assoc[:through].first.id }}\n .__yield_where_{{ assoc[:through].first.id }} do |join_query|\n join_query.{{ join_type.downcase.id }}_join_{{ assoc[:through][1].id }}\n end\n {% else %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n foreign_key: {{ assoc[:foreign_key] }},\n primary_key: primary_key_name\n )\n )\n {% end %}{% end %}{% end %}\n end\n {% end %}\n\n\n def where_{{ assoc[:assoc_name] }}(assoc_query : {{ assoc[:type] }}::BaseQuery, auto_inner_join : Bool = true)\n if auto_inner_join\n join_{{ assoc[:assoc_name] }}.merge_query(assoc_query.query)\n else\n merge_query(assoc_query.query)\n end\n end\n\n # :nodoc:\n # Used internally for has_many through queries\n def __yield_where_{{ assoc[:assoc_name] }}\n assoc_query = yield {{ assoc[:type] }}::BaseQuery.new\n merge_query(assoc_query.query)\n end\n {% end %}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/BetweenCriteria","path":"Avram/BetweenCriteria.html","kind":"module","full_name":"Avram::BetweenCriteria(T, V)","name":"BetweenCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/between_criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria_extensions/between_criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Float64/Lucky/Criteria","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int16/Lucky/Criteria","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/CallableErrorMessage","path":"Avram/CallableErrorMessage.html","kind":"module","full_name":"Avram::CallableErrorMessage","name":"CallableErrorMessage","abstract":false,"locations":[{"filename":"src/avram/validations/callable_error_message.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations/callable_error_message.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"call(attribute_name,attribute_value)-instance-method","name":"call","abstract":true,"args":[{"name":"attribute_name","external_name":"attribute_name","restriction":""},{"name":"attribute_value","external_name":"attribute_value","restriction":""}],"args_string":"(attribute_name, attribute_value)","args_html":"(attribute_name, attribute_value)","location":{"filename":"src/avram/validations/callable_error_message.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations/callable_error_message.cr#L2"},"def":{"name":"call","args":[{"name":"attribute_name","external_name":"attribute_name","restriction":""},{"name":"attribute_value","external_name":"attribute_value","restriction":""}],"visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Callbacks","path":"Avram/Callbacks.html","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks","abstract":false,"locations":[{"filename":"src/avram/callbacks.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"after_commit(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_commit","doc":"Run the given method after save and after successful transaction commit\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_commit notify_post_author\n\n private def notify_post_author(comment : Comment)\n NewCommentNotificationEmail.new(comment, to: comment.author!).deliver_now\n end\nend\n```\n","summary":"

Run the given method after save and after successful transaction commit

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":439,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L439"},"def":{"name":"after_commit","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_commit, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_commit, {{ method_name }}, :unless)\n {% end %}\n\n after_commit(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_commit(if_if=nil,unless_unless=nil,&block)-macro","name":"after_commit","doc":"Run the given block after save and after successful transaction commit\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_commit do |comment|\n NewCommentNotificationEmail.new(comment, to: comment.author!).deliver_now\n end\nend\n```","summary":"

Run the given block after save and after successful transaction commit

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":462,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L462"},"def":{"name":"after_commit","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_commit callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_commit, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_commit, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_commit' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_commit do |saved_user|\\n some_method(saved_user)\\n end\")\nend %}\n\n def after_commit(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_commit).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"after_delete(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_delete","doc":"Same as `after_save` but with a different name","summary":"

Same as after_save but with a different name

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":243,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L243"},"def":{"name":"after_delete","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_delete, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_delete, {{ method_name }}, :unless)\n {% end %}\n\n after_delete(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_delete(if_if=nil,unless_unless=nil,&block)-macro","name":"after_delete","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":323,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L323"},"def":{"name":"after_delete","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_delete callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_delete, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_delete, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_delete' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_delete do |deleted_user|\\n some_method(deleted_user)\\n end\")\nend %}\n\n def after_delete(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_delete).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"after_run(method_name)-macro","name":"after_run","doc":"Run the given method after `run` is called on an `Operation`.\nThe return value of the `run` method is passed to `method_name`.\n\n```\nafter_run :log_entry\n\nprivate def log_entry(value)\n log_stuff(value)\nend\n```","summary":"

Run the given method after run is called on an Operation.

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/avram/callbacks.cr","line_number":378,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L378"},"def":{"name":"after_run","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" after_run do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_run(&block)-macro","name":"after_run","doc":"Run the given block after the operation runs\n\nThe return value from `run` will be passed to this block.\n\n```\nclass GenerateReport < Avram::Operation\n after_run do |value|\n value == \"some report\"\n end\n\n def run\n \"some report\"\n end\nend\n```","summary":"

Run the given block after the operation runs

","abstract":false,"location":{"filename":"src/avram/callbacks.cr","line_number":399,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L399"},"def":{"name":"after_run","block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if block.args.size != 1\n raise(\"The 'after_run' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_run { |value| some_method(value) }\")\nend %}\n\n def after_run(\n%object\n)\n \n{% if @type.methods.map(&.name).includes?((:after_run).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ block.args.first }}\n = \n%object\n\n \n{{ block.body }}\n\n \nend\n \n"}},{"html_id":"after_save(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_save","doc":"Run the given method after save, but before transaction is committed\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThis is a great place to do other database saves because if something goes\nwrong the whole transaction would be rolled back.\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_save touch_post\n\n private def touch_post(comment : Comment)\n SavePost.update!(comment.post!, updated_at: Time.utc)\n end\nend\n```\n\n> This is *not* a good place to do things like send messages, enqueue\n> background jobs, or charge payments. Since the transaction could be rolled\n> back the record may not be persisted to the database.\n> Instead use `after_commit`","summary":"

Run the given method after save, but before transaction is committed

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":230,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L230"},"def":{"name":"after_save","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_save, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_save, {{ method_name }}, :unless)\n {% end %}\n\n after_save(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_save(if_if=nil,unless_unless=nil,&block)-macro","name":"after_save","doc":"Run the given block after save, but before transaction is committed\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThis is a great place to do other database saves because if something goes\nwrong the whole transaction would be rolled back.\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_save do |comment|\n SavePost.update!(comment.post!, updated_at: Time.utc)\n end\nend\n```\n\n> This is *not* a good place to do things like send messages, enqueue\n> background jobs, or charge payments. Since the transaction could be rolled\n> back the record may not be persisted to the database.\n> Instead use `after_commit`","summary":"

Run the given block after save, but before transaction is committed

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":278,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L278"},"def":{"name":"after_save","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_save callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_save, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_save, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_save' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_save do |saved_user|\\n some_method(saved_user)\\n end\")\nend %}\n\n def after_save(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_save).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"before_delete(method_name,if_if=nil,unless_unless=nil)-macro","name":"before_delete","doc":"Same as `before_save`, but with a different name","summary":"

Same as before_save, but with a different name

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":76,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L76"},"def":{"name":"before_delete","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_delete, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_delete, {{ method_name }}, :unless)\n {% end %}\n\n before_delete(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_delete(if_if=nil,unless_unless=nil)-macro","name":"before_delete","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil)","args_html":"(if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":154,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L154"},"def":{"name":"before_delete","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your before_delete callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_delete, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_delete, :unless)\n {% end %}\n\n\n def before_delete\n \n{% if @type.methods.map(&.name).includes?((:before_delete).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ yield }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ yield }}\n end\n {% else %}\n {{ yield }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"before_run(method_name)-macro","name":"before_run","doc":"Run the given method before `run` is called on an `Operation`.\n\n```\nbefore_run :validate_inputs\n\nprivate def validate_inputs\n validate_required data\nend\n```","summary":"

Run the given method before run is called on an Operation.

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/avram/callbacks.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L97"},"def":{"name":"before_run","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" before_run do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_run-macro","name":"before_run","doc":"Run the given block before `run` is called on an `Operation`.\n\n```\nbefore_run do\n validate_required data\nend\n```","summary":"

Run the given block before run is called on an Operation.

","abstract":false,"location":{"filename":"src/avram/callbacks.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L193"},"def":{"name":"before_run","visibility":"Public","body":" def before_run\n \n{% if @type.methods.map(&.name).includes?((:before_run).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}},{"html_id":"before_save(method_name,if_if=nil,unless_unless=nil)-macro","name":"before_save","doc":"Run the given method before saving or creating for `SaveOperation`\n\nThis runs before saving and before the database transaction is started.\nYou can set defaults, validate, or perform any other setup necessary for\nsaving.\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\n```\nbefore_save :run_validations\nbefore_save :validate_can_internet, unless: :too_cool_for_school?\n\nprivate def run_validations\n validate_required name, age\nend\n\nprivate def validate_can_internet\n validate_size_of age, min: 13\nend\n\nprivate def too_cool_for_school?\n [true, false].sample\nend\n```","summary":"

Run the given method before saving or creating for SaveOperation

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L63"},"def":{"name":"before_save","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_save, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_save, {{ method_name }}, :unless)\n {% end %}\n\n before_save(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_save(if_if=nil,unless_unless=nil)-macro","name":"before_save","doc":"Run the given block before saving or creating for `SaveOperation`\n\nThis runs before saving and before the database transaction is started.\nYou can set defaults, validate, or perform any other setup necessary for\nsaving.\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\n```\nbefore_save(unless: :skip_callback?) do\n validate_required name, age\nend\n\nprivate def skip_callback?\n false\nend\n```","summary":"

Run the given block before saving or creating for SaveOperation

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil)","args_html":"(if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":122,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L122"},"def":{"name":"before_save","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your before_save callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_save, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_save, :unless)\n {% end %}\n\n\n def before_save\n \n{% if @type.methods.map(&.name).includes?((:before_save).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ yield }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ yield }}\n end\n {% else %}\n {{ yield }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"conditional_error_for_block_callbacks(callback,condition)-macro","name":"conditional_error_for_block_callbacks","abstract":false,"args":[{"name":"callback","external_name":"callback","restriction":""},{"name":"condition","external_name":"condition","restriction":""}],"args_string":"(callback, condition)","args_html":"(callback, condition)","location":{"filename":"src/avram/callbacks.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L19"},"def":{"name":"conditional_error_for_block_callbacks","args":[{"name":"callback","external_name":"callback","restriction":""},{"name":"condition","external_name":"condition","restriction":""}],"visibility":"Public","body":" \n\\{%\n \nraise <<-ERROR\n You must pass a Symbol to `\n{{ condition.id }}\n` in \n{{ @type }}\n. The Symbol will reference a method you define.\n\n Try this...\n\n \n{{ callback.id }}\n(\n{{ condition.id }}\n: :check_condition?) do\n # your callback block\n end\n\n def check_condition?\n # return your bool value here\n end\n ERROR\n %}\n \n"}}]},{"html_id":"avram/Avram/ChronoUnits","path":"Avram/ChronoUnits.html","kind":"enum","full_name":"Avram::ChronoUnits","name":"ChronoUnits","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/chrono_units.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L2"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Century","name":"Century","value":"0"},{"id":"Day","name":"Day","value":"1"},{"id":"Decade","name":"Decade","value":"2"},{"id":"Dow","name":"Dow","value":"3"},{"id":"Doy","name":"Doy","value":"4"},{"id":"Epoch","name":"Epoch","value":"5"},{"id":"Hour","name":"Hour","value":"6"},{"id":"Isodow","name":"Isodow","value":"7"},{"id":"Isoyear","name":"Isoyear","value":"8"},{"id":"Julian","name":"Julian","value":"9"},{"id":"Microseconds","name":"Microseconds","value":"10"},{"id":"Millennium","name":"Millennium","value":"11"},{"id":"Milliseconds","name":"Milliseconds","value":"12"},{"id":"Minute","name":"Minute","value":"13"},{"id":"Month","name":"Month","value":"14"},{"id":"Quarter","name":"Quarter","value":"15"},{"id":"Second","name":"Second","value":"16"},{"id":"Timezone","name":"Timezone","value":"17"},{"id":"TimezoneHour","name":"TimezoneHour","value":"18"},{"id":"TimezoneMinute","name":"TimezoneMinute","value":"19"},{"id":"Week","name":"Week","value":"20"},{"id":"Year","name":"Year","value":"21"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"century?-instance-method","name":"century?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L3"},"def":{"name":"century?","visibility":"Public","body":"self == Century"}},{"html_id":"day?-instance-method","name":"day?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L4"},"def":{"name":"day?","visibility":"Public","body":"self == Day"}},{"html_id":"decade?-instance-method","name":"decade?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L5"},"def":{"name":"decade?","visibility":"Public","body":"self == Decade"}},{"html_id":"dow?-instance-method","name":"dow?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L6"},"def":{"name":"dow?","visibility":"Public","body":"self == Dow"}},{"html_id":"doy?-instance-method","name":"doy?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L7"},"def":{"name":"doy?","visibility":"Public","body":"self == Doy"}},{"html_id":"epoch?-instance-method","name":"epoch?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L8"},"def":{"name":"epoch?","visibility":"Public","body":"self == Epoch"}},{"html_id":"hour?-instance-method","name":"hour?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L9"},"def":{"name":"hour?","visibility":"Public","body":"self == Hour"}},{"html_id":"isodow?-instance-method","name":"isodow?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L10"},"def":{"name":"isodow?","visibility":"Public","body":"self == Isodow"}},{"html_id":"isoyear?-instance-method","name":"isoyear?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L11"},"def":{"name":"isoyear?","visibility":"Public","body":"self == Isoyear"}},{"html_id":"julian?-instance-method","name":"julian?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L12"},"def":{"name":"julian?","visibility":"Public","body":"self == Julian"}},{"html_id":"microseconds?-instance-method","name":"microseconds?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L13"},"def":{"name":"microseconds?","visibility":"Public","body":"self == Microseconds"}},{"html_id":"millennium?-instance-method","name":"millennium?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L14"},"def":{"name":"millennium?","visibility":"Public","body":"self == Millennium"}},{"html_id":"milliseconds?-instance-method","name":"milliseconds?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L15"},"def":{"name":"milliseconds?","visibility":"Public","body":"self == Milliseconds"}},{"html_id":"minute?-instance-method","name":"minute?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L16"},"def":{"name":"minute?","visibility":"Public","body":"self == Minute"}},{"html_id":"month?-instance-method","name":"month?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L17"},"def":{"name":"month?","visibility":"Public","body":"self == Month"}},{"html_id":"quarter?-instance-method","name":"quarter?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L18"},"def":{"name":"quarter?","visibility":"Public","body":"self == Quarter"}},{"html_id":"second?-instance-method","name":"second?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L19"},"def":{"name":"second?","visibility":"Public","body":"self == Second"}},{"html_id":"timezone?-instance-method","name":"timezone?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L20"},"def":{"name":"timezone?","visibility":"Public","body":"self == Timezone"}},{"html_id":"timezone_hour?-instance-method","name":"timezone_hour?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L21"},"def":{"name":"timezone_hour?","visibility":"Public","body":"self == TimezoneHour"}},{"html_id":"timezone_minute?-instance-method","name":"timezone_minute?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L22"},"def":{"name":"timezone_minute?","visibility":"Public","body":"self == TimezoneMinute"}},{"html_id":"week?-instance-method","name":"week?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L23"},"def":{"name":"week?","visibility":"Public","body":"self == Week"}},{"html_id":"year?-instance-method","name":"year?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L24"},"def":{"name":"year?","visibility":"Public","body":"self == Year"}}]},{"html_id":"avram/Avram/Connection","path":"Avram/Connection.html","kind":"class","full_name":"Avram::Connection","name":"Connection","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Handles the connection to the DB.","summary":"

Handles the connection to the DB.

","constructors":[{"html_id":"new(connection_string:String,database_class:Avram::Database.class)-class-method","name":"new","abstract":false,"args":[{"name":"connection_string","external_name":"connection_string","restriction":"String"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"args_string":"(connection_string : String, database_class : Avram::Database.class)","args_html":"(connection_string : String, database_class : Avram::Database.class)","location":{"filename":"src/avram/connection.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L5"},"def":{"name":"new","args":[{"name":"connection_string","external_name":"connection_string","restriction":"String"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection_string, database_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"close:Nil-instance-method","name":"close","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L12"},"def":{"name":"close","return_type":"Nil","visibility":"Public","body":"@db.try(&.close)\n@db = nil\n"}},{"html_id":"connect_listen(*channels:String,&block:PQ::Notification->):Nil-instance-method","name":"connect_listen","abstract":false,"args":[{"name":"channels","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String, &block : PQ::Notification -> ) : Nil","args_html":"(*channels : String, &block : PQ::Notification -> ) : Nil","location":{"filename":"src/avram/connection.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L17"},"def":{"name":"connect_listen","args":[{"name":"channels","external_name":"channels","restriction":"String"}],"splat_index":0,"yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(PQ::Notification ->)"},"return_type":"Nil","visibility":"Public","body":"begin\n PG.connect_listen(@connection_string, *channels, &block)\nrescue DB::ConnectionRefused\n raise(ConnectionError.new(connection_uri, database_class: @database_class))\nend"}},{"html_id":"open:DB::Database-instance-method","name":"open","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L8"},"def":{"name":"open","return_type":"DB::Database","visibility":"Public","body":"@db = try_connection!"}},{"html_id":"try_connection!:DB::Database-instance-method","name":"try_connection!","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L23"},"def":{"name":"try_connection!","return_type":"DB::Database","visibility":"Public","body":"begin\n DB.open(@connection_string)\nrescue DB::ConnectionRefused\n raise(ConnectionError.new(connection_uri, database_class: @database_class))\nend"}}]},{"html_id":"avram/Avram/ConnectionError","path":"Avram/ConnectionError.html","kind":"class","full_name":"Avram::ConnectionError","name":"ConnectionError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L82"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"DEFAULT_PG_PORT","name":"DEFAULT_PG_PORT","value":"5432"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(connection_details:URI,database_class:Avram::Database.class)-class-method","name":"new","abstract":false,"args":[{"name":"connection_details","external_name":"connection_details","restriction":"URI"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"args_string":"(connection_details : URI, database_class : Avram::Database.class)","args_html":"(connection_details : URI, database_class : Avram::Database.class)","location":{"filename":"src/avram/errors.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L88"},"def":{"name":"new","args":[{"name":"connection_details","external_name":"connection_details","restriction":"URI"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection_details, database_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"connection_details:URI-instance-method","name":"connection_details","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L85"},"def":{"name":"connection_details","return_type":"URI","visibility":"Public","body":"@connection_details"}},{"html_id":"database_class:Avram::Database.class-instance-method","name":"database_class","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L86"},"def":{"name":"database_class","return_type":"Avram::Database.class","visibility":"Public","body":"@database_class"}}]},{"html_id":"avram/Avram/Credentials","path":"Avram/Credentials.html","kind":"class","full_name":"Avram::Credentials","name":"Credentials","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/credentials.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"parse?(connection_url:String|Nil):Credentials|Nil-class-method","name":"parse?","doc":"Parse a postgres connection string URL. This may come from an\nenvironment variable.\nReturns `nil` if no `connection_url` is provided.\n\n```\nAvram::Credentials.parse?(ENV[\"DB_URL\"]?)\n```","summary":"

Parse a postgres connection string URL.

","abstract":false,"args":[{"name":"connection_url","external_name":"connection_url","restriction":"String | ::Nil"}],"args_string":"(connection_url : String | Nil) : Credentials | Nil","args_html":"(connection_url : String | Nil) : Credentials | Nil","location":{"filename":"src/avram/credentials.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L28"},"def":{"name":"parse?","args":[{"name":"connection_url","external_name":"connection_url","restriction":"String | ::Nil"}],"return_type":"Credentials | ::Nil","visibility":"Public","body":"if connection_url.nil?\n return nil\nend\nparse(connection_url.as(String))\n"}}],"constructors":[{"html_id":"new(database:String,hostname:String|Nil=nil,username:String|Nil=nil,password:String|Nil=nil,port:Int32|Nil=nil,query:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"String"},{"name":"hostname","default_value":"nil","external_name":"hostname","restriction":"String | ::Nil"},{"name":"username","default_value":"nil","external_name":"username","restriction":"String | ::Nil"},{"name":"password","default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"port","default_value":"nil","external_name":"port","restriction":"Int32 | ::Nil"},{"name":"query","default_value":"nil","external_name":"query","restriction":"String | ::Nil"}],"args_string":"(database : String, hostname : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil, port : Int32 | Nil = nil, query : String | Nil = nil)","args_html":"(database : String, hostname : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil, port : Int32 | Nil = nil, query : String | Nil = nil)","location":{"filename":"src/avram/credentials.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L4"},"def":{"name":"new","args":[{"name":"database","external_name":"database","restriction":"String"},{"name":"hostname","default_value":"nil","external_name":"hostname","restriction":"String | ::Nil"},{"name":"username","default_value":"nil","external_name":"username","restriction":"String | ::Nil"},{"name":"password","default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"port","default_value":"nil","external_name":"port","restriction":"Int32 | ::Nil"},{"name":"query","default_value":"nil","external_name":"query","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(database, hostname, username, password, port, query)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"parse(connection_url:String):Credentials-class-method","name":"parse","doc":"Parse a postgres connection string URL. This may come from an\nenvironment variable.\n\n```\nAvram::Credentials.parse(ENV[\"DB_URL\"])\n```","summary":"

Parse a postgres connection string URL.

","abstract":false,"args":[{"name":"connection_url","external_name":"connection_url","restriction":"String"}],"args_string":"(connection_url : String) : Credentials","args_html":"(connection_url : String) : Credentials","location":{"filename":"src/avram/credentials.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L39"},"def":{"name":"parse","args":[{"name":"connection_url","external_name":"connection_url","restriction":"String"}],"return_type":"Credentials","visibility":"Public","body":"uri = URI.parse(connection_url)\nnew(database: uri.path.to_s, hostname: uri.host, username: uri.user, password: uri.password, port: uri.port, query: uri.query)\n"}},{"html_id":"void:Credentials-class-method","name":"void","doc":"Used when you need to configure credentials,\nbut no database connection is made.","summary":"

Used when you need to configure credentials, but no database connection is made.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L17"},"def":{"name":"void","return_type":"Credentials","visibility":"Public","body":"new(database: \"unused\")"}}],"instance_methods":[{"html_id":"connection_string:String-instance-method","name":"connection_string","doc":"This is the full connection string used\nto connect to the PostgreSQL server.","summary":"

This is the full connection string used to connect to the PostgreSQL server.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L85"},"def":{"name":"connection_string","return_type":"String","visibility":"Public","body":"String.build do |io|\n set_url_protocol(io)\n set_url_creds(io)\n set_url_host(io)\n set_url_port(io)\nend"}},{"html_id":"database:String-instance-method","name":"database","doc":"The name of the database you want to connect to","summary":"

The name of the database you want to connect to

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L52"},"def":{"name":"database","return_type":"String","visibility":"Public","body":"@database = @database.strip\nif @database.starts_with?('/')\n @database = @database[1..-1]\nend\nif @database.empty?\n raise(InvalidDatabaseNameError.new(\"The database name specified was blank. Be sure to set a value.\"))\nend\n@database\n"}},{"html_id":"hostname:String|Nil-instance-method","name":"hostname","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L63"},"def":{"name":"hostname","return_type":"String | ::Nil","visibility":"Public","body":"@hostname.try(&.strip).presence"}},{"html_id":"password:String|Nil-instance-method","name":"password","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L71"},"def":{"name":"password","return_type":"String | ::Nil","visibility":"Public","body":"@password.try(&.strip).presence"}},{"html_id":"port:Int32|Nil-instance-method","name":"port","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L75"},"def":{"name":"port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@port"}},{"html_id":"query:String|Nil-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L79"},"def":{"name":"query","return_type":"String | ::Nil","visibility":"Public","body":"@query.try(&.strip).presence"}},{"html_id":"url:String-instance-method","name":"url","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L2"},"def":{"name":"url","return_type":"String","visibility":"Public","body":"@url"}},{"html_id":"url_without_query_params:String-instance-method","name":"url_without_query_params","doc":"Returns the postgres connection string without\nany query params.","summary":"

Returns the postgres connection string without any query params.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":96,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L96"},"def":{"name":"url_without_query_params","return_type":"String","visibility":"Public","body":"url.sub(\"?#{@query}\", \"\")"}},{"html_id":"username:String|Nil-instance-method","name":"username","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L67"},"def":{"name":"username","return_type":"String | ::Nil","visibility":"Public","body":"@username.try(&.strip).presence"}}]},{"html_id":"avram/Avram/Criteria","path":"Avram/Criteria.html","kind":"class","full_name":"Avram::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Bool/Lucky/Criteria","kind":"class","full_name":"Bool::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Float64/Lucky/Criteria","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int16/Lucky/Criteria","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/JSON/Any/Lucky/Criteria","kind":"class","full_name":"JSON::Any::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/JSON/Serializable/Lucky/Criteria","kind":"class","full_name":"JSON::Serializable::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Slice/Lucky/Criteria","kind":"class","full_name":"Slice::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/String/Lucky/Criteria","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/UUID/Lucky/Criteria","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"asc_order(null_sorting:Avram::OrderBy::NullSorting=:default):T-instance-method","name":"asc_order","abstract":false,"args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"args_string":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","args_html":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","location":{"filename":"src/avram/criteria.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L14"},"def":{"name":"asc_order","args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderBy.new(column, :asc, null_sorting))"}},{"html_id":"column:Symbol|String-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L3"},"def":{"name":"column","return_type":"Symbol | String","visibility":"Public","body":"@column"}},{"html_id":"column=(column:Symbol|String)-instance-method","name":"column=","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(column : Symbol | String)","args_html":"(column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L3"},"def":{"name":"column=","args":[{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"@column = column"}},{"html_id":"desc_order(null_sorting:Avram::OrderBy::NullSorting=:default):T-instance-method","name":"desc_order","abstract":false,"args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"args_string":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","args_html":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","location":{"filename":"src/avram/criteria.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L10"},"def":{"name":"desc_order","args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderBy.new(column, :desc, null_sorting))"}},{"html_id":"eq(value):T-instance-method","name":"eq","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L22"},"def":{"name":"eq","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"check_just_nil!(typeof(value))\ncheck_nilable!(value)\nperform_eq(value)\n"}},{"html_id":"gt(value):T-instance-method","name":"gt","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":116,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L116"},"def":{"name":"gt","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::GreaterThan.new(column, V.adapter.to_db!(value)))"}},{"html_id":"gte(value):T-instance-method","name":"gte","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":120,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L120"},"def":{"name":"gte","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::GreaterThanOrEqualTo.new(column, V.adapter.to_db!(value)))"}},{"html_id":"in(values):T-instance-method","name":"in","abstract":false,"args":[{"name":"values","external_name":"values","restriction":""}],"args_string":"(values) : T","args_html":"(values) : T","location":{"filename":"src/avram/criteria.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L152"},"def":{"name":"in","args":[{"name":"values","external_name":"values","restriction":""}],"return_type":"T","visibility":"Public","body":"values = values.map do |value|\n V.adapter.to_db!(value)\nend\nadd_clause(Avram::Where::In.new(column, values))\n"}},{"html_id":"is_nil:T-instance-method","name":"is_nil","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":102,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L102"},"def":{"name":"is_nil","return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Null.new(column))"}},{"html_id":"is_not_nil:T-instance-method","name":"is_not_nil","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L106"},"def":{"name":"is_not_nil","return_type":"T","visibility":"Public","body":"not()\nis_nil\n"}},{"html_id":"lt(value):T-instance-method","name":"lt","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":124,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L124"},"def":{"name":"lt","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::LessThan.new(column, V.adapter.to_db!(value)))"}},{"html_id":"lte(value):T-instance-method","name":"lte","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":128,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L128"},"def":{"name":"lte","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::LessThanOrEqualTo.new(column, V.adapter.to_db!(value)))"}},{"html_id":"nilable_eq(value):T-instance-method","name":"nilable_eq","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":92,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L92"},"def":{"name":"nilable_eq","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"check_just_nil!(typeof(value))\nif value.nil?\n is_nil\nelse\n perform_eq(value)\nend\n"}},{"html_id":"not:Avram::Criteria-instance-method","name":"not","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":111,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L111"},"def":{"name":"not","return_type":"Avram::Criteria","visibility":"Public","body":"@negate_next_criteria = true\nself\n"}},{"html_id":"random_order:T-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L18"},"def":{"name":"random_order","return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderByRandom.new)"}},{"html_id":"rows:T-instance-method","name":"rows","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L2"},"def":{"name":"rows","return_type":"T","visibility":"Public","body":"@rows"}},{"html_id":"rows=(rows:T)-instance-method","name":"rows=","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"}],"args_string":"(rows : T)","args_html":"(rows : T)","location":{"filename":"src/avram/criteria.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L2"},"def":{"name":"rows=","args":[{"name":"rows","external_name":"rows","restriction":"T"}],"visibility":"Public","body":"@rows = rows"}},{"html_id":"select_average:Float64|Nil-instance-method","name":"select_average","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L140"},"def":{"name":"select_average","return_type":"Float64 | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_average(column)).as(PG::Numeric | ::Nil)).try(&.to_f64)"}},{"html_id":"select_average!:Float64-instance-method","name":"select_average!","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":144,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L144"},"def":{"name":"select_average!","return_type":"Float64","visibility":"Public","body":"select_average || 0_f64"}},{"html_id":"select_max:V|Nil-instance-method","name":"select_max","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":136,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L136"},"def":{"name":"select_max","return_type":"V | ::Nil","visibility":"Public","body":"rows.exec_scalar(&.select_max(column)).as(V | ::Nil)"}},{"html_id":"select_min:V|Nil-instance-method","name":"select_min","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L132"},"def":{"name":"select_min","return_type":"V | ::Nil","visibility":"Public","body":"rows.exec_scalar(&.select_min(column)).as(V | ::Nil)"}},{"html_id":"select_sum-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":148,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L148"},"def":{"name":"select_sum","visibility":"Public","body":"rows.exec_scalar(&.select_sum(column))"}}],"macros":[{"html_id":"define_function_criteria(name,output_type=V,sql_name=nil)-macro","name":"define_function_criteria","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"output_type","default_value":"V","external_name":"output_type","restriction":""},{"name":"sql_name","default_value":"nil","external_name":"sql_name","restriction":""}],"args_string":"(name, output_type = V, sql_name = nil)","args_html":"(name, output_type = V, sql_name = nil)","location":{"filename":"src/avram/criteria.cr","line_number":190,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L190"},"def":{"name":"define_function_criteria","args":[{"name":"name","external_name":"name","restriction":""},{"name":"output_type","default_value":"V","external_name":"output_type","restriction":""},{"name":"sql_name","default_value":"nil","external_name":"sql_name","restriction":""}],"visibility":"Public","body":" \n{% sql_name = sql_name ? sql_name.id : name.id.upcase %}\n\n def \n{{ name }}\n\n Criteria(T,\n{{ output_type }}\n).new(rows, \"\n{{ sql_name }}\n(#{column})\")\n \nend\n \n"}}]},{"html_id":"avram/Avram/Database","path":"Avram/Database.html","kind":"class","full_name":"Avram::Database","name":"Database","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L1"},{"filename":"src/avram/database/column_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L2"},{"filename":"src/avram/database/database_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L2"},{"filename":"src/avram/database/table_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"close_connections!-class-method","name":"close_connections!","doc":"Close all available connections as well as the DB","summary":"

Close all available connections as well as the DB

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L162"},"def":{"name":"close_connections!","visibility":"Public","body":"connections.values.map(&.close)\n@@db.try(&.close)\n"}},{"html_id":"connections-class-method","name":"connections","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L6"},"def":{"name":"connections","visibility":"Public","body":"@@connections"}},{"html_id":"credentials-class-method","name":"credentials","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L140"},"def":{"name":"credentials","visibility":"Public","body":"settings.credentials"}},{"html_id":"database_info:DatabaseInfo-class-method","name":"database_info","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L69"},"def":{"name":"database_info","return_type":"DatabaseInfo","visibility":"Public","body":"@@database_info || (@@database_info = DatabaseInfo.load(self))"}},{"html_id":"delete-class-method","name":"delete","doc":"Run a SQL `DELETE` on all tables in the database","summary":"

Run a SQL DELETE on all tables in the database

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L49"},"def":{"name":"delete","visibility":"Public","body":"new.delete"}},{"html_id":"exec(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"exec","doc":"Same as crystal-db's `DB::QueryMethods#exec` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#exec but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"exec","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.exec(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"listen(*channels:String,&block:PQ::Notification->):Nil-class-method","name":"listen","doc":"Listens for `pg_notify()` calls on each channel in `channels`\nYields a `PQ::Notification` object with `channel`, `payload`, and `pid`.\n\n```\n# pg_notify(\"callback\", \"123\")\nAppDatabase.listen(\"callback\", \"jobs\") do |notification|\n notification.channel # => \"callback\"\n notification.payload # => \"123\"\nend\n```","summary":"

Listens for pg_notify() calls on each channel in channels Yields a PQ::Notification object with channel, payload, and pid.

","abstract":false,"args":[{"name":"channels","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String, &block : PQ::Notification -> ) : Nil","args_html":"(*channels : String, &block : PQ::Notification -> ) : Nil","location":{"filename":"src/avram/database.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L63"},"def":{"name":"listen","args":[{"name":"channels","external_name":"channels","restriction":"String"}],"splat_index":0,"yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(PQ::Notification ->)"},"return_type":"Nil","visibility":"Public","body":"new.listen(*channels, &block)"}},{"html_id":"lock_id:UInt64|Nil-class-method","name":"lock_id","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L7"},"def":{"name":"lock_id","return_type":"UInt64 | ::Nil","visibility":"Public","body":"@@lock_id"}},{"html_id":"lock_id=(lock_id:UInt64|Nil)-class-method","name":"lock_id=","abstract":false,"args":[{"name":"lock_id","external_name":"lock_id","restriction":"UInt64 | ::Nil"}],"args_string":"(lock_id : UInt64 | Nil)","args_html":"(lock_id : UInt64 | Nil)","location":{"filename":"src/avram/database.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L7"},"def":{"name":"lock_id=","args":[{"name":"lock_id","external_name":"lock_id","restriction":"UInt64 | ::Nil"}],"visibility":"Public","body":"@@lock_id = lock_id"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#:query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_all(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#:query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_all(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_each(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_each","doc":"Same as crystal-db's `DB::QueryMethods#:query_each` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_each but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_each","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_each(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_one(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#:query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_one(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#query_one?` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one? but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_one?(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#:\"query_one?\"` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:"query_one?" but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_one?(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"rollback-class-method","name":"rollback","doc":"Rollback the current transaction","summary":"

Rollback the current transaction

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L39"},"def":{"name":"rollback","visibility":"Public","body":"new.rollback"}},{"html_id":"run(&)-class-method","name":"run","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":148,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L148"},"def":{"name":"run","yields":1,"block_arity":1,"visibility":"Public","body":"new.run do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"scalar(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"scalar","doc":"Same as crystal-db's `DB::QueryMethods#scalar` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#scalar but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"scalar","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.scalar(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"setup_connection(&block:DB::Connection->Nil)-class-method","name":"setup_connection","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L28"},"def":{"name":"setup_connection","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(DB::Connection -> Nil)"},"visibility":"Public","body":"new.db.setup_connection do |conn|\n block.call(conn)\nend"}},{"html_id":"transaction(&)-class-method","name":"transaction","doc":"Wrap the block in a database transaction\n\n```\nAppDatabase.transaction do\n # Create, read, update\n # Force a rollback with AppDatabase.rollback\nend\n```","summary":"

Wrap the block in a database transaction

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L81"},"def":{"name":"transaction","yields":1,"block_arity":1,"visibility":"Public","body":"new.transaction do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"truncate(**named_args)-class-method","name":"truncate","doc":"Run a SQL `TRUNCATE` on all tables in the database","summary":"

Run a SQL TRUNCATE on all tables in the database

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L44"},"def":{"name":"truncate","double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"visibility":"Public","body":"new.truncate(**named_args)"}},{"html_id":"verify_connection-class-method","name":"verify_connection","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L34"},"def":{"name":"verify_connection","visibility":"Public","body":"new.connection.open.close"}}],"instance_methods":[{"html_id":"exec(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"exec","doc":"Same as crystal-db's `DB::QueryMethods#exec` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#exec but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"exec","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.exec(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"publish_query_event(query,args_,args,queryable,&)-instance-method","name":"publish_query_event","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","external_name":"args","restriction":""},{"name":"queryable","external_name":"queryable","restriction":""}],"args_string":"(query, args_, args, queryable, &)","args_html":"(query, args_, args, queryable, &)","location":{"filename":"src/avram/database.cr","line_number":125,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L125"},"def":{"name":"publish_query_event","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","external_name":"args","restriction":""},{"name":"queryable","external_name":"queryable","restriction":""}],"yields":0,"block_arity":0,"visibility":"Public","body":"begin\n logging_args = (DB::EnumerableConcat.build(args_, args)).to_s\n Avram::Events::QueryEvent.publish(query: query, args: logging_args, queryable: queryable) do\n yield\n end\nrescue e : PQ::PQError\n Avram::Events::FailedQueryEvent.publish(error_message: e.message.to_s, query: query, queryable: queryable, args: logging_args)\n raise(e)\nend"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#:query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_all(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#:query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_all(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_each(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_each","doc":"Same as crystal-db's `DB::QueryMethods#:query_each` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_each but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_each","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_each(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#:query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#query_one?` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one? but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one?(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#:\"query_one?\"` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:"query_one?" but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one?(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"scalar(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"scalar","doc":"Same as crystal-db's `DB::QueryMethods#scalar` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#scalar but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"scalar","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.scalar(query, *args_, **named_args, args: args)\n end\nend"}}],"types":[{"html_id":"avram/Avram/Database/ColumnInfo","path":"Avram/Database/ColumnInfo.html","kind":"struct","full_name":"Avram::Database::ColumnInfo","name":"ColumnInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/DB/Mappable","kind":"module","full_name":"DB::Mappable","name":"Mappable"},{"html_id":"avram/DB/Serializable","kind":"module","full_name":"DB::Serializable","name":"Serializable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/column_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/Mappable","kind":"module","full_name":"DB::Mappable","name":"Mappable"},{"html_id":"avram/DB/Serializable","kind":"module","full_name":"DB::Serializable","name":"Serializable"}],"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"class_methods":[{"html_id":"from_rs(rs:DB::ResultSet)-class-method","name":"from_rs","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/database/column_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L4"},"def":{"name":"from_rs","args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"visibility":"Public","body":"begin\n objs = Array(self).new\n rs.each do\n objs << (self.new(rs))\n end\n objs\nensure\n rs.close\nend"}}],"constructors":[{"html_id":"new(rs:DB::ResultSet)-class-method","name":"new","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/database/column_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L4"},"def":{"name":"new","args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"visibility":"Public","body":"instance = allocate\ninstance.initialize(__set_for_db_serializable: rs)\nif instance.responds_to?(:finalize)\n GC.add_finalizer(instance)\nend\ninstance\n"}}],"instance_methods":[{"html_id":"column_default:String|Nil-instance-method","name":"column_default","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L12"},"def":{"name":"column_default","return_type":"String | ::Nil","visibility":"Public","body":"@column_default"}},{"html_id":"column_default=(column_default:String|Nil)-instance-method","name":"column_default=","abstract":false,"args":[{"name":"column_default","external_name":"column_default","restriction":"String | ::Nil"}],"args_string":"(column_default : String | Nil)","args_html":"(column_default : String | Nil)","location":{"filename":"src/avram/database/column_info.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L12"},"def":{"name":"column_default=","args":[{"name":"column_default","external_name":"column_default","restriction":"String | ::Nil"}],"visibility":"Public","body":"@column_default = column_default"}},{"html_id":"column_name:String-instance-method","name":"column_name","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L10"},"def":{"name":"column_name","return_type":"String","visibility":"Public","body":"@column_name"}},{"html_id":"column_name=(column_name:String)-instance-method","name":"column_name=","abstract":false,"args":[{"name":"column_name","external_name":"column_name","restriction":"String"}],"args_string":"(column_name : String)","args_html":"(column_name : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L10"},"def":{"name":"column_name=","args":[{"name":"column_name","external_name":"column_name","restriction":"String"}],"visibility":"Public","body":"@column_name = column_name"}},{"html_id":"data_type:String-instance-method","name":"data_type","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L13"},"def":{"name":"data_type","return_type":"String","visibility":"Public","body":"@data_type"}},{"html_id":"data_type=(data_type:String)-instance-method","name":"data_type=","abstract":false,"args":[{"name":"data_type","external_name":"data_type","restriction":"String"}],"args_string":"(data_type : String)","args_html":"(data_type : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L13"},"def":{"name":"data_type=","args":[{"name":"data_type","external_name":"data_type","restriction":"String"}],"visibility":"Public","body":"@data_type = data_type"}},{"html_id":"is_nullable:String-instance-method","name":"is_nullable","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L11"},"def":{"name":"is_nullable","return_type":"String","visibility":"Public","body":"@is_nullable"}},{"html_id":"is_nullable=(is_nullable:String)-instance-method","name":"is_nullable=","abstract":false,"args":[{"name":"is_nullable","external_name":"is_nullable","restriction":"String"}],"args_string":"(is_nullable : String)","args_html":"(is_nullable : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L11"},"def":{"name":"is_nullable=","args":[{"name":"is_nullable","external_name":"is_nullable","restriction":"String"}],"visibility":"Public","body":"@is_nullable = is_nullable"}},{"html_id":"nilable?:Bool-instance-method","name":"nilable?","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L15"},"def":{"name":"nilable?","return_type":"Bool","visibility":"Public","body":"is_nullable == \"YES\""}},{"html_id":"table:Avram::Database::TableInfo-instance-method","name":"table","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L19"},"def":{"name":"table","return_type":"Avram::Database::TableInfo","visibility":"Public","body":"TableInfo.new(table_name, table_type, table_schema)"}},{"html_id":"table_catalog:String-instance-method","name":"table_catalog","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L6"},"def":{"name":"table_catalog","return_type":"String","visibility":"Public","body":"@table_catalog"}},{"html_id":"table_catalog=(table_catalog:String)-instance-method","name":"table_catalog=","abstract":false,"args":[{"name":"table_catalog","external_name":"table_catalog","restriction":"String"}],"args_string":"(table_catalog : String)","args_html":"(table_catalog : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L6"},"def":{"name":"table_catalog=","args":[{"name":"table_catalog","external_name":"table_catalog","restriction":"String"}],"visibility":"Public","body":"@table_catalog = table_catalog"}},{"html_id":"table_name:String-instance-method","name":"table_name","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L8"},"def":{"name":"table_name","return_type":"String","visibility":"Public","body":"@table_name"}},{"html_id":"table_name=(table_name:String)-instance-method","name":"table_name=","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"String"}],"args_string":"(table_name : String)","args_html":"(table_name : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L8"},"def":{"name":"table_name=","args":[{"name":"table_name","external_name":"table_name","restriction":"String"}],"visibility":"Public","body":"@table_name = table_name"}},{"html_id":"table_schema:String-instance-method","name":"table_schema","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L7"},"def":{"name":"table_schema","return_type":"String","visibility":"Public","body":"@table_schema"}},{"html_id":"table_schema=(table_schema:String)-instance-method","name":"table_schema=","abstract":false,"args":[{"name":"table_schema","external_name":"table_schema","restriction":"String"}],"args_string":"(table_schema : String)","args_html":"(table_schema : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L7"},"def":{"name":"table_schema=","args":[{"name":"table_schema","external_name":"table_schema","restriction":"String"}],"visibility":"Public","body":"@table_schema = table_schema"}},{"html_id":"table_type:String-instance-method","name":"table_type","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L9"},"def":{"name":"table_type","return_type":"String","visibility":"Public","body":"@table_type"}},{"html_id":"table_type=(table_type:String)-instance-method","name":"table_type=","abstract":false,"args":[{"name":"table_type","external_name":"table_type","restriction":"String"}],"args_string":"(table_type : String)","args_html":"(table_type : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L9"},"def":{"name":"table_type=","args":[{"name":"table_type","external_name":"table_type","restriction":"String"}],"visibility":"Public","body":"@table_type = table_type"}}]},{"html_id":"avram/Avram/Database/DatabaseCleaner","path":"Avram/Database/DatabaseCleaner.html","kind":"class","full_name":"Avram::Database::DatabaseCleaner","name":"DatabaseCleaner","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database.cr","line_number":253,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L253"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"new(database:Avram::Database)-class-method","name":"new","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"::Avram::Database"}],"args_string":"(database : Avram::Database)","args_html":"(database : Avram::Database)","location":{"filename":"src/avram/database.cr","line_number":257,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L257"},"def":{"name":"new","args":[{"name":"database","external_name":"database","restriction":"::Avram::Database"}],"visibility":"Public","body":"_ = allocate\n_.initialize(database)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"delete-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":277,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L277"},"def":{"name":"delete","visibility":"Public","body":"if table_names.empty?\n return\nend\ntable_names.each do |t|\n statement = (\"DELETE FROM #{t}\")\n database.exec(statement)\nend\n"}},{"html_id":"truncate(*,cascade:Bool=true,restart_identity:Bool=true)-instance-method","name":"truncate","abstract":false,"args":[{"name":"","external_name":"","restriction":""},{"name":"cascade","default_value":"true","external_name":"cascade","restriction":"Bool"},{"name":"restart_identity","default_value":"true","external_name":"restart_identity","restriction":"Bool"}],"args_string":"(*, cascade : Bool = true, restart_identity : Bool = true)","args_html":"(*, cascade : Bool = true, restart_identity : Bool = true)","location":{"filename":"src/avram/database.cr","line_number":266,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L266"},"def":{"name":"truncate","args":[{"name":"","external_name":"","restriction":""},{"name":"cascade","default_value":"true","external_name":"cascade","restriction":"Bool"},{"name":"restart_identity","default_value":"true","external_name":"restart_identity","restriction":"Bool"}],"splat_index":0,"visibility":"Public","body":"if table_names.empty?\n return\nend\ncascade_sql = cascade ? \" CASCADE\" : \"\"\nrestart_id_sql = restart_identity ? \" RESTART IDENTITY\" : \"\"\ntable_names_sql = table_names.join(\", \")\nsql = \"TRUNCATE TABLE #{table_names_sql}#{restart_id_sql}#{cascade_sql}\"\ndatabase.exec(sql)\n"}}]},{"html_id":"avram/Avram/Database/DatabaseInfo","path":"Avram/Database/DatabaseInfo.html","kind":"struct","full_name":"Avram::Database::DatabaseInfo","name":"DatabaseInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/database_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SQL_QUERY","name":"SQL_QUERY","value":"\" SELECT columns.table_name,\\n tables.table_type,\\n columns.table_schema,\\n columns.table_catalog,\\n columns.column_name,\\n columns.is_nullable,\\n columns.column_default,\\n columns.data_type\\n FROM information_schema.columns as columns\\n JOIN information_schema.tables as tables\\n ON tables.table_name = columns.table_name\\n AND tables.table_catalog = columns.table_catalog\\n AND tables.table_schema = columns.table_schema\\n WHERE columns.table_schema='public';\""}],"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"load(database:Avram::Database.class):DatabaseInfo-class-method","name":"load","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"Avram::Database.class"}],"args_string":"(database : Avram::Database.class) : DatabaseInfo","args_html":"(database : Avram::Database.class) : DatabaseInfo","location":{"filename":"src/avram/database/database_info.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L21"},"def":{"name":"load","args":[{"name":"database","external_name":"database","restriction":"Avram::Database.class"}],"return_type":"DatabaseInfo","visibility":"Public","body":"column_infos = database.query(SQL_QUERY) do |rs|\n ColumnInfo.from_rs(rs)\nend\ngrouped = column_infos.group_by(&.table)\ngrouped.each do |table, columns|\n columns.each do |c|\n table.columns << c\n end\nend\ntable_infos = grouped.keys\nnew(table_infos)\n"}},{"html_id":"new(table_infos:Array(Avram::Database::TableInfo))-class-method","name":"new","abstract":false,"args":[{"name":"table_infos","external_name":"table_infos","restriction":"::Array(::Avram::Database::TableInfo)"}],"args_string":"(table_infos : Array(Avram::Database::TableInfo))","args_html":"(table_infos : Array(Avram::Database::TableInfo))","location":{"filename":"src/avram/database/database_info.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L34"},"def":{"name":"new","args":[{"name":"table_infos","external_name":"table_infos","restriction":"::Array(::Avram::Database::TableInfo)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_infos)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"table(name:String):TableInfo|Nil-instance-method","name":"table","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : TableInfo | Nil","args_html":"(name : String) : TableInfo | Nil","location":{"filename":"src/avram/database/database_info.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L45"},"def":{"name":"table","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"TableInfo | ::Nil","visibility":"Public","body":"table_infos.find() do |__arg2|\n __arg2.table_name == name\nend"}},{"html_id":"table?(name:String):Bool-instance-method","name":"table?","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : Bool","args_html":"(name : String) : Bool","location":{"filename":"src/avram/database/database_info.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L37"},"def":{"name":"table?","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"Bool","visibility":"Public","body":"table_names.includes?(name)"}},{"html_id":"table_infos:Array(TableInfo)-instance-method","name":"table_infos","abstract":false,"location":{"filename":"src/avram/database/database_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L32"},"def":{"name":"table_infos","return_type":"Array(TableInfo)","visibility":"Public","body":"@table_infos"}},{"html_id":"table_infos=(table_infos:Array(TableInfo))-instance-method","name":"table_infos=","abstract":false,"args":[{"name":"table_infos","external_name":"table_infos","restriction":"Array(TableInfo)"}],"args_string":"(table_infos : Array(TableInfo))","args_html":"(table_infos : Array(TableInfo))","location":{"filename":"src/avram/database/database_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L32"},"def":{"name":"table_infos=","args":[{"name":"table_infos","external_name":"table_infos","restriction":"Array(TableInfo)"}],"visibility":"Public","body":"@table_infos = table_infos"}},{"html_id":"table_names:Array(String)-instance-method","name":"table_names","abstract":false,"location":{"filename":"src/avram/database/database_info.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L41"},"def":{"name":"table_names","return_type":"Array(String)","visibility":"Public","body":"table_infos.map(&.table_name)"}}]},{"html_id":"avram/Avram/Database/FiberId","path":"Avram/Database/FiberId.html","kind":"alias","full_name":"Avram::Database::FiberId","name":"FiberId","abstract":false,"locations":[{"filename":"src/avram/database.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"UInt64","aliased_html":"UInt64","const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"}},{"html_id":"avram/Avram/Database/TableInfo","path":"Avram/Database/TableInfo.html","kind":"struct","full_name":"Avram::Database::TableInfo","name":"TableInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/table_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"new(table_name:String,table_type:String,table_schema:String)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"::String"},{"name":"table_type","external_name":"table_type","restriction":"::String"},{"name":"table_schema","external_name":"table_schema","restriction":"::String"}],"args_string":"(table_name : String, table_type : String, table_schema : String)","args_html":"(table_name : String, table_type : String, table_schema : String)","location":{"filename":"src/avram/database/table_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L9"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"::String"},{"name":"table_type","external_name":"table_type","restriction":"::String"},{"name":"table_schema","external_name":"table_schema","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, table_type, table_schema)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column(name:String):ColumnInfo|Nil-instance-method","name":"column","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : ColumnInfo | Nil","args_html":"(name : String) : ColumnInfo | Nil","location":{"filename":"src/avram/database/table_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L32"},"def":{"name":"column","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"ColumnInfo | ::Nil","visibility":"Public","body":"columns.find() do |__arg1|\n __arg1.column_name == name\nend"}},{"html_id":"column?(name:String):Bool-instance-method","name":"column?","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : Bool","args_html":"(name : String) : Bool","location":{"filename":"src/avram/database/table_info.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L24"},"def":{"name":"column?","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"Bool","visibility":"Public","body":"column_names.includes?(name)"}},{"html_id":"column_names:Array(String)-instance-method","name":"column_names","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L28"},"def":{"name":"column_names","return_type":"Array(String)","visibility":"Public","body":"columns.map(&.column_name)"}},{"html_id":"columns:Array(Avram::Database::ColumnInfo)-instance-method","name":"columns","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L7"},"def":{"name":"columns","visibility":"Public","body":"@columns"}},{"html_id":"migrations_table?:Bool-instance-method","name":"migrations_table?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L36"},"def":{"name":"migrations_table?","return_type":"Bool","visibility":"Public","body":"table_name == \"migrations\""}},{"html_id":"table?:Bool-instance-method","name":"table?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L16"},"def":{"name":"table?","return_type":"Bool","visibility":"Public","body":"table_type == \"BASE TABLE\""}},{"html_id":"table_name:String-instance-method","name":"table_name","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L4"},"def":{"name":"table_name","return_type":"String","visibility":"Public","body":"@table_name"}},{"html_id":"table_schema:String-instance-method","name":"table_schema","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L6"},"def":{"name":"table_schema","return_type":"String","visibility":"Public","body":"@table_schema"}},{"html_id":"table_type:String-instance-method","name":"table_type","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L5"},"def":{"name":"table_type","return_type":"String","visibility":"Public","body":"@table_type"}},{"html_id":"view?:Bool-instance-method","name":"view?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L20"},"def":{"name":"view?","return_type":"Bool","visibility":"Public","body":"table_type == \"VIEW\""}}]}]},{"html_id":"avram/Avram/DatabaseValidations","path":"Avram/DatabaseValidations.html","kind":"module","full_name":"Avram::DatabaseValidations(T)","name":"DatabaseValidations","abstract":false,"locations":[{"filename":"src/avram/database_validations.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database_validations.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/DefineAttribute","path":"Avram/DefineAttribute.html","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute","abstract":false,"locations":[{"filename":"src/avram/define_attribute.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"attributes-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L34"},"def":{"name":"attributes","visibility":"Public","body":"[] of Avram::PermittedAttribute(Nil)"}}],"macros":[{"html_id":"attribute(type_declaration)-macro","name":"attribute","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/define_attribute.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L36"},"def":{"name":"attribute","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.type.is_a?(Union) %}\n {% if type_declaration.value.is_a?(Nop) %}\n {% default_value = \"\" %}\n {% else %}\n {% default_value = \"= #{type_declaration.value}\" %}\n {% end %}\n {% raise(\"`attribute` in #{@type} must not be called with a type union or nilable type but was called with #{type_declaration.type}\\nIf you were attempting to create a nilable attribute, all attributes are considered nilable by default.\\n\\nTry this...\\n\\n attribute #{type_declaration.var} : #{type_declaration.type.types.first} #{default_value.id}\\n\\nRead more on attributes: https://luckyframework.org/guides/database/validating-saving\") %}\n {% end %}\n\n\n \n{% ATTRIBUTES << type_declaration %}\n\n\n \n{% type = type_declaration.type %}\n\n \n{% name = type_declaration.var %}\n\n \n{% default_value = if type_declaration.value.is_a?(Nop)\n nil\nelse\n type_declaration.value\nend %}\n\n @_\n{{ name }}\n : Avram::Attribute(\n{{ type }}\n)?\n\n \nensure_base_attributes_method_is_present\n\n def attributes\n ([\n{{ name }}\n] + previous_def + super).uniq\n \nend\n\n def \n{{ name }}\n\n _\n{{ name }}\n.permitted\n \nend\n\n private def _\n{{ name }}\n\n @_\n{{ name }}\n ||= Avram::Attribute(\n{{ type }}\n).new(\n name: \n{{ name.id.symbolize }}\n,\n value: \n{{ default_value }}\n,\n param_key: self.class.param_key\n ).tap do |attribute|\n attribute.extract(params)\n \nend\n \nend\n \n"}},{"html_id":"ensure_base_attributes_method_is_present-macro","name":"ensure_base_attributes_method_is_present","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L2"},"def":{"name":"ensure_base_attributes_method_is_present","visibility":"Public","body":" \n{% if !(@type.methods.map(&.name).includes?((:attributes).id)) %}\n def attributes\n [] of Avram::PermittedAttribute(Nil)\n end\n {% end %}\n\n \n"}},{"html_id":"file_attribute(key)-macro","name":"file_attribute","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/define_attribute.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L90"},"def":{"name":"file_attribute","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" \n{% if key.is_a?(SymbolLiteral) %}{% else %}\n {% raise(\"file_attribute must be declared with a Symbol\") %}\n {% end %}\n\n\n attribute \n{{ key.id }}\n : Avram::Uploadable\n \n"}},{"html_id":"inherit_attributes-macro","name":"inherit_attributes","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L18"},"def":{"name":"inherit_attributes","visibility":"Public","body":" \n\\{% if\n !@type.constant(:ATTRIBUTES) %}\n ATTRIBUTES = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n attribute in @type.ancestors.first.constant :ATTRIBUTES %}\n \n\\{% \nATTRIBUTES << attribute %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_attributes\n \nend\n \n"}}]},{"html_id":"avram/Avram/DeleteOperation","path":"Avram/DeleteOperation.html","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L34"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"T.name.underscore"}}],"instance_methods":[{"html_id":"after_delete(_record:T)-instance-method","name":"after_delete","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/delete_operation.cr","line_number":89,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L89"},"def":{"name":"after_delete","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"before_delete-instance-method","name":"before_delete","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L87"},"def":{"name":"before_delete","visibility":"Public","body":""}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"delete:Bool-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L38"},"def":{"name":"delete","return_type":"Bool","visibility":"Public","body":"before_delete\nif valid?\n result = delete_or_soft_delete(@record)\n @record = result\n after_delete(@record)\n publish_delete_success_event\n mark_as_deleted\nelse\n publish_delete_failed_event\n mark_as_failed\nend\n"}},{"html_id":"delete!-instance-method","name":"delete!","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":53,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L53"},"def":{"name":"delete!","visibility":"Public","body":"if delete\n @record\nelse\n raise(Avram::InvalidOperationError.new(operation: self))\nend"}},{"html_id":"deleted?:Bool-instance-method","name":"deleted?","doc":"Returns true if the operation has run and saved the record successfully","summary":"

Returns true if the operation has run and saved the record successfully

","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L78"},"def":{"name":"deleted?","return_type":"Bool","visibility":"Public","body":"delete_status == OperationStatus::Deleted"}},{"html_id":"mark_as_deleted:Bool-instance-method","name":"mark_as_deleted","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L72"},"def":{"name":"mark_as_deleted","return_type":"Bool","visibility":"Public","body":"self.delete_status = OperationStatus::Deleted\ntrue\n"}},{"html_id":"mark_as_failed:Bool-instance-method","name":"mark_as_failed","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L82"},"def":{"name":"mark_as_failed","return_type":"Bool","visibility":"Public","body":"self.delete_status = OperationStatus::DeleteFailed\nfalse\n"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L67"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}}],"types":[{"html_id":"avram/Avram/DeleteOperation/OperationStatus","path":"Avram/DeleteOperation/OperationStatus.html","kind":"enum","full_name":"Avram::DeleteOperation::OperationStatus","name":"OperationStatus","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L19"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Deleted","name":"Deleted","value":"0"},{"id":"DeleteFailed","name":"DeleteFailed","value":"1"},{"id":"Unperformed","name":"Unperformed","value":"2"}],"namespace":{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},"instance_methods":[{"html_id":"delete_failed?-instance-method","name":"delete_failed?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L21"},"def":{"name":"delete_failed?","visibility":"Public","body":"self == DeleteFailed"}},{"html_id":"deleted?-instance-method","name":"deleted?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L20"},"def":{"name":"deleted?","visibility":"Public","body":"self == Deleted"}},{"html_id":"unperformed?-instance-method","name":"unperformed?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L22"},"def":{"name":"unperformed?","visibility":"Public","body":"self == Unperformed"}}]}]},{"html_id":"avram/Avram/DeleteOperationTemplate","path":"Avram/DeleteOperationTemplate.html","kind":"class","full_name":"Avram::DeleteOperationTemplate","name":"DeleteOperationTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, *args, **named_args)","args_html":"(type, columns, *args, **named_args)","location":{"filename":"src/avram/delete_operation_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":2,"visibility":"Public","body":" def delete_operation_class : ::\n{{ type }}\n::DeleteOperation.class\n ::\n{{ type }}\n::DeleteOperation\n \nend\n\n class ::\n{{ type }}\n::DeleteOperation < Avram::DeleteOperation(\n{{ type }}\n)\n\n add_column_attributes(\n{{ columns }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/Events","path":"Avram/Events.html","kind":"module","full_name":"Avram::Events","name":"Events","abstract":false,"locations":[{"filename":"src/avram/events/delete_failed_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Events/DeleteFailedEvent","path":"Avram/Events/DeleteFailedEvent.html","kind":"class","full_name":"Avram::Events::DeleteFailedEvent","name":"DeleteFailedEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/delete_failed_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,errors:Hash(Symbol,Array(String)))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Hash(Symbol, Array(String))"}],"args_string":"(operation_class : String, errors : Hash(Symbol, Array(String)))","args_html":"(operation_class : String, errors : Hash(Symbol, Array(String)))","location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Hash(Symbol, Array(String))"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, errors)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"error_messages_as_string-instance-method","name":"error_messages_as_string","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L10"},"def":{"name":"error_messages_as_string","visibility":"Public","body":"String.build do |msg|\n errors.each do |key, messages|\n msg << \"#{key} #{messages.join(\", \")}\"\n end\nend"}},{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L2"},"def":{"name":"errors","visibility":"Public","body":"@errors"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/DeleteSuccessEvent","path":"Avram/Events/DeleteSuccessEvent.html","kind":"class","full_name":"Avram::Events::DeleteSuccessEvent","name":"DeleteSuccessEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/delete_success_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_success_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String)-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"}],"args_string":"(operation_class : String)","args_html":"(operation_class : String)","location":{"filename":"src/avram/events/delete_success_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_success_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/delete_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_success_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/FailedQueryEvent","path":"Avram/Events/FailedQueryEvent.html","kind":"class","full_name":"Avram::Events::FailedQueryEvent","name":"FailedQueryEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/failed_query_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(error_message:String,query:String,args:String|Nil,queryable:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"error_message","external_name":"error_message","restriction":"String"},{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(error_message : String, query : String, args : String | Nil, queryable : String | Nil = nil)","args_html":"(error_message : String, query : String, args : String | Nil, queryable : String | Nil = nil)","location":{"filename":"src/avram/events/failed_query_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L4"},"def":{"name":"new","args":[{"name":"error_message","external_name":"error_message","restriction":"String"},{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(error_message, query, args, queryable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:String?-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"args","visibility":"Public","body":"@args"}},{"html_id":"error_message:String-instance-method","name":"error_message","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"error_message","visibility":"Public","body":"@error_message"}},{"html_id":"query:String-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"query","visibility":"Public","body":"@query"}},{"html_id":"queryable:String?-instance-method","name":"queryable","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"queryable","visibility":"Public","body":"@queryable"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/QueryEvent","path":"Avram/Events/QueryEvent.html","kind":"class","full_name":"Avram::Events::QueryEvent","name":"QueryEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/TimedEvent","kind":"class","full_name":"Pulsar::TimedEvent","name":"TimedEvent"},"ancestors":[{"html_id":"avram/Pulsar/TimedEvent","kind":"class","full_name":"Pulsar::TimedEvent","name":"TimedEvent"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/query_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(query:String,args:String|Nil,queryable:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query : String, args : String | Nil, queryable : String | Nil = nil)","args_html":"(query : String, args : String | Nil, queryable : String | Nil = nil)","location":{"filename":"src/avram/events/query_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L4"},"def":{"name":"new","args":[{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(query, args, queryable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:String?-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L2"},"def":{"name":"args","visibility":"Public","body":"@args"}},{"html_id":"query:String-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L2"},"def":{"name":"query","visibility":"Public","body":"@query"}},{"html_id":"queryable:String?-instance-method","name":"queryable","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L2"},"def":{"name":"queryable","visibility":"Public","body":"@queryable"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/SaveFailedEvent","path":"Avram/Events/SaveFailedEvent.html","kind":"class","full_name":"Avram::Events::SaveFailedEvent","name":"SaveFailedEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/save_failed_event.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,attributes:Array(Avram::GenericAttribute))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"args_string":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","args_html":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","location":{"filename":"src/avram/events/save_failed_event.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L7"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, attributes)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attributes:Array(Avram::GenericAttribute)-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L5"},"def":{"name":"attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"@attributes"}},{"html_id":"error_messages_as_string:String-instance-method","name":"error_messages_as_string","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L17"},"def":{"name":"error_messages_as_string","return_type":"String","visibility":"Public","body":"invalid_attributes.join(\". \") do |attribute|\n \"#{attribute.name} #{attribute.errors.join(\", \")}\"\nend"}},{"html_id":"invalid_attributes:Array(Avram::GenericAttribute)-instance-method","name":"invalid_attributes","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L13"},"def":{"name":"invalid_attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"attributes.reject(&.valid?)"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L4"},"def":{"name":"operation_class","return_type":"String","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/SaveSuccessEvent","path":"Avram/Events/SaveSuccessEvent.html","kind":"class","full_name":"Avram::Events::SaveSuccessEvent","name":"SaveSuccessEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/save_success_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_success_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,attributes:Array(Avram::GenericAttribute))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"args_string":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","args_html":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","location":{"filename":"src/avram/events/save_success_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_success_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, attributes)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attributes:Array(Avram::GenericAttribute)-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/events/save_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_success_event.cr#L2"},"def":{"name":"attributes","visibility":"Public","body":"@attributes"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/save_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_success_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]}]},{"html_id":"avram/Avram/ExtractCriteria","path":"Avram/ExtractCriteria.html","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/extract_criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria_extensions/extract_criteria.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Factory","path":"Avram/Factory.html","kind":"class","full_name":"Avram::Factory","name":"Factory","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/factory.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SEQUENCES","name":"SEQUENCES","value":"{} of String => Int32"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"build_attributes(&)-class-method","name":"build_attributes","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L66"},"def":{"name":"build_attributes","yields":1,"block_arity":1,"visibility":"Public","body":"(yield(new)).attributes"}},{"html_id":"build_attributes-class-method","name":"build_attributes","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L70"},"def":{"name":"build_attributes","visibility":"Public","body":"new.attributes"}},{"html_id":"create-class-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L74"},"def":{"name":"create","visibility":"Public","body":"new.create"}},{"html_id":"create(&)-class-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L78"},"def":{"name":"create","yields":1,"block_arity":1,"visibility":"Public","body":"(yield(new)).create"}},{"html_id":"create_pair-class-method","name":"create_pair","doc":"Returns an array with 2 instances of the model from the Factory.\n\nUsage:\n\n```\ntags = TagFactory.create_pair\ntypeof(tags) # => Array(Tag)\ntags.size # => 2\n```","summary":"

Returns an array with 2 instances of the model from the Factory.

","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L97"},"def":{"name":"create_pair","visibility":"Public","body":"create_pair do |factory|\n factory\nend"}},{"html_id":"create_pair(&)-class-method","name":"create_pair","doc":"Similar to `create_pair`, but accepts a block which yields the factory instance.\n\nBoth factories receive the same argument values.\n\nUsage:\n\n```\nTagFactory.create_pair do |factory|\n # set both factories name to \"test\"\n factory.name(\"test\")\nend\n```","summary":"

Similar to .create_pair, but accepts a block which yields the factory instance.

","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":113,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L113"},"def":{"name":"create_pair","yields":1,"block_arity":1,"visibility":"Public","body":"[1, 2].map do |n|\n self.create do |factory|\n yield(factory)\n end\nend"}}],"instance_methods":[{"html_id":"create-instance-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L82"},"def":{"name":"create","visibility":"Public","body":"run_before_save_callbacks\nrecord = operation.save!\nrun_after_save_callbacks(record)\n"}},{"html_id":"operation-instance-method","name":"operation","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L2"},"def":{"name":"operation","visibility":"Public","body":"@operation"}},{"html_id":"sequence(value:String):String-instance-method","name":"sequence","doc":"Returns a value with a number to use for unique values.\n\nUsage:\n\n```\nclass UserFactory < Avram::Factory\n def initialize\n username sequence(\"username\") # => username-1, username-2, etc.\n email \"#{sequence(\"email\")}@example.com\" # => email-1@example.com, email-2@example.com, etc.\n end\nend\n```","summary":"

Returns a value with a number to use for unique values.

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/factory.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L131"},"def":{"name":"sequence","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"__temp_91 = value\n__temp_92 = SEQUENCES\n__temp_92[__temp_91]? || (__temp_92[__temp_91] = 0)\n__temp_93 = value\n__temp_94 = SEQUENCES\n__temp_94[__temp_93] = __temp_94[__temp_93] + 1\n\"#{value}-#{SEQUENCES[value]}\"\n"}}],"macros":[{"html_id":"setup_attribute_shortcuts(operation)-macro","name":"setup_attribute_shortcuts","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/factory.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L20"},"def":{"name":"setup_attribute_shortcuts","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":" \n{% for attribute in operation.resolve.constant(:COLUMN_ATTRIBUTES) %}\n def {{ attribute[:name] }}(value : {{ attribute[:type] }}{% if attribute[:nilable] %}?{% end %})\n operation.{{ attribute[:name] }}.value = value\n self\n end\n {% end %}\n\n \n"}},{"html_id":"setup_attributes(operation)-macro","name":"setup_attributes","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/factory.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L29"},"def":{"name":"setup_attributes","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":" def attributes\n \n{\n \n{% for attribute in operation.resolve.constant(:COLUMN_ATTRIBUTES) %}\n {{ attribute[:name] }}: operation.{{ attribute[:name] }}.value,\n {% end %}\n\n }\n \nend\n \n"}},{"html_id":"setup_callbacks(model_name)-macro","name":"setup_callbacks","abstract":false,"args":[{"name":"model_name","external_name":"model_name","restriction":""}],"args_string":"(model_name)","args_html":"(model_name)","location":{"filename":"src/avram/factory.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L39"},"def":{"name":"setup_callbacks","args":[{"name":"model_name","external_name":"model_name","restriction":""}],"visibility":"Public","body":" \n# Run `block` before the record is created\n\n def before_save(&block : -> Nil) : self\n @before_saves << block\n\n self\n \nend\n\n \n# Run `block` after the record is created.\n\n \n# The block will yield the created record instance\n\n def after_save(&block : \n{{ model_name.id }}\n -> Nil) : self\n @after_saves << block\n\n self\n \nend\n\n private def run_before_save_callbacks\n @before_saves.each(&.call)\n \nend\n\n private def run_after_save_callbacks(record : \n{{ model_name.id }}\n)\n @after_saves.each(&.call(record))\n\n record\n \nend\n \n"}}]},{"html_id":"avram/Avram/FailedMigration","path":"Avram/FailedMigration.html","kind":"class","full_name":"Avram::FailedMigration","name":"FailedMigration","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":160,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L160"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(migration:String,statements:Array(String),cause:Exception)-class-method","name":"new","abstract":false,"args":[{"name":"migration","external_name":"migration","restriction":"String"},{"name":"statements","external_name":"statements","restriction":"Array(String)"},{"name":"cause","external_name":"cause","restriction":"Exception"}],"args_string":"(migration : String, statements : Array(String), cause : Exception)","args_html":"(migration : String, statements : Array(String), cause : Exception)","location":{"filename":"src/avram/errors.cr","line_number":164,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L164"},"def":{"name":"new","args":[{"name":"migration","external_name":"migration","restriction":"String"},{"name":"statements","external_name":"statements","restriction":"Array(String)"},{"name":"cause","external_name":"cause","restriction":"Exception"}],"visibility":"Public","body":"_ = allocate\n_.initialize(migration, statements, cause)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"migration:String-instance-method","name":"migration","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":161,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L161"},"def":{"name":"migration","return_type":"String","visibility":"Public","body":"@migration"}},{"html_id":"statements:Array(String)-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L162"},"def":{"name":"statements","return_type":"Array(String)","visibility":"Public","body":"@statements"}}]},{"html_id":"avram/Avram/FailedOperation","path":"Avram/FailedOperation.html","kind":"class","full_name":"Avram::FailedOperation","name":"FailedOperation","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":157,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L157"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Used when `Avram::Operation` fails.","summary":"

Used when Avram::Operation fails.

"},{"html_id":"avram/Avram/GenericAttribute","path":"Avram/GenericAttribute.html","kind":"class","full_name":"Avram::GenericAttribute","name":"GenericAttribute","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/generic_attribute.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"A generic version of `Avram::Attribute` that is used for reporting and metrics.\n\nThis is a data only version of an `Avram::Atribute`. It is purely for\nretrieving and reporting on data. For example, `Avram::GenericAttribute` is\nused by `Avram::Events::SaveFailedEvent` so that subscribers can\nget information about attributes that failed to save.","summary":"

A generic version of Avram::Attribute that is used for reporting and metrics.

","constructors":[{"html_id":"new(name:Symbol,param:String|Nil,original_value:String|Nil,value:String|Nil,param_key:String,errors:Array(String))-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"Symbol"},{"name":"param","external_name":"param","restriction":"String | ::Nil"},{"name":"original_value","external_name":"original_value","restriction":"String | ::Nil"},{"name":"value","external_name":"value","restriction":"String | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Array(String)"}],"args_string":"(name : Symbol, param : String | Nil, original_value : String | Nil, value : String | Nil, param_key : String, errors : Array(String))","args_html":"(name : Symbol, param : String | Nil, original_value : String | Nil, value : String | Nil, param_key : String, errors : Array(String))","location":{"filename":"src/avram/generic_attribute.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L15"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"Symbol"},{"name":"param","external_name":"param","restriction":"String | ::Nil"},{"name":"original_value","external_name":"original_value","restriction":"String | ::Nil"},{"name":"value","external_name":"value","restriction":"String | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Array(String)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, param, original_value, value, param_key, errors)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"errors:Array(String)-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L13"},"def":{"name":"errors","return_type":"Array(String)","visibility":"Public","body":"@errors"}},{"html_id":"name:Symbol-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L8"},"def":{"name":"name","return_type":"Symbol","visibility":"Public","body":"@name"}},{"html_id":"original_value:String|Nil-instance-method","name":"original_value","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L10"},"def":{"name":"original_value","return_type":"String | ::Nil","visibility":"Public","body":"@original_value"}},{"html_id":"param:String|Nil-instance-method","name":"param","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L9"},"def":{"name":"param","return_type":"String | ::Nil","visibility":"Public","body":"@param"}},{"html_id":"param_key:String-instance-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L12"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"@param_key"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L25"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"errors.empty?"}},{"html_id":"value:String|Nil-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L11"},"def":{"name":"value","return_type":"String | ::Nil","visibility":"Public","body":"@value"}}]},{"html_id":"avram/Avram/HabitatSettings","path":"Avram/HabitatSettings.html","kind":"class","full_name":"Avram::HabitatSettings","name":"HabitatSettings","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"database_to_migrate:Avram::Database.class-class-method","name":"database_to_migrate","abstract":false,"def":{"name":"database_to_migrate","return_type":"Avram::Database.class","visibility":"Public","body":"@@database_to_migrate.not_nil!"}},{"html_id":"database_to_migrate=(value:Avram::Database.class)-class-method","name":"database_to_migrate=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::Database.class"}],"args_string":"(value : Avram::Database.class)","args_html":"(value : Avram::Database.class)","def":{"name":"database_to_migrate=","args":[{"name":"value","external_name":"value","restriction":"Avram::Database.class"}],"visibility":"Public","body":"@@database_to_migrate = value"}},{"html_id":"database_to_migrate?-class-method","name":"database_to_migrate?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use database_to_migrate in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use database_to_migrate in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"database_to_migrate?","visibility":"Public","body":"@@database_to_migrate"}},{"html_id":"i18n_backend:Avram::I18nBackend-class-method","name":"i18n_backend","abstract":false,"def":{"name":"i18n_backend","return_type":"Avram::I18nBackend","visibility":"Public","body":"@@i18n_backend.not_nil!"}},{"html_id":"i18n_backend=(value:Avram::I18nBackend)-class-method","name":"i18n_backend=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::I18nBackend"}],"args_string":"(value : Avram::I18nBackend)","args_html":"(value : Avram::I18nBackend)","def":{"name":"i18n_backend=","args":[{"name":"value","external_name":"value","restriction":"Avram::I18nBackend"}],"visibility":"Public","body":"@@i18n_backend = value"}},{"html_id":"i18n_backend?-class-method","name":"i18n_backend?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use i18n_backend in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use i18n_backend in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"i18n_backend?","visibility":"Public","body":"@@i18n_backend"}},{"html_id":"lazy_load_enabled:Bool-class-method","name":"lazy_load_enabled","abstract":false,"def":{"name":"lazy_load_enabled","return_type":"Bool","visibility":"Public","body":"@@lazy_load_enabled.not_nil!"}},{"html_id":"lazy_load_enabled=(value:Bool)-class-method","name":"lazy_load_enabled=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","def":{"name":"lazy_load_enabled=","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"@@lazy_load_enabled = value"}},{"html_id":"lazy_load_enabled?-class-method","name":"lazy_load_enabled?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use lazy_load_enabled in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use lazy_load_enabled in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"lazy_load_enabled?","visibility":"Public","body":"@@lazy_load_enabled"}},{"html_id":"query_cache_enabled:Bool-class-method","name":"query_cache_enabled","abstract":false,"def":{"name":"query_cache_enabled","return_type":"Bool","visibility":"Public","body":"@@query_cache_enabled.not_nil!"}},{"html_id":"query_cache_enabled=(value:Bool)-class-method","name":"query_cache_enabled=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","def":{"name":"query_cache_enabled=","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"@@query_cache_enabled = value"}},{"html_id":"query_cache_enabled?-class-method","name":"query_cache_enabled?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use query_cache_enabled in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use query_cache_enabled in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"query_cache_enabled?","visibility":"Public","body":"@@query_cache_enabled"}},{"html_id":"time_formats:Array(String)-class-method","name":"time_formats","abstract":false,"def":{"name":"time_formats","return_type":"Array(String)","visibility":"Public","body":"@@time_formats.not_nil!"}},{"html_id":"time_formats=(value:Array(String))-class-method","name":"time_formats=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Array(String)"}],"args_string":"(value : Array(String))","args_html":"(value : Array(String))","def":{"name":"time_formats=","args":[{"name":"value","external_name":"value","restriction":"Array(String)"}],"visibility":"Public","body":"@@time_formats = value"}},{"html_id":"time_formats?-class-method","name":"time_formats?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use time_formats in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use time_formats in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"time_formats?","visibility":"Public","body":"@@time_formats"}},{"html_id":"to_h-class-method","name":"to_h","doc":"Generates a hash using the provided values","summary":"

Generates a hash using the provided values

","abstract":false,"def":{"name":"to_h","visibility":"Public","body":"{\"lazy_load_enabled\" => lazy_load_enabled, \"database_to_migrate\" => database_to_migrate, \"time_formats\" => time_formats, \"i18n_backend\" => i18n_backend, \"query_cache_enabled\" => query_cache_enabled}"}}]},{"html_id":"avram/Avram/I18n","path":"Avram/I18n.html","kind":"struct","full_name":"Avram::I18n","name":"I18n","abstract":false,"superclass":{"html_id":"avram/Avram/I18nBackend","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend"},"ancestors":[{"html_id":"avram/Avram/I18nBackend","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/i18n_backend.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L5"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"get(key:String|Symbol):String-instance-method","name":"get","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"args_string":"(key : String | Symbol) : String","args_html":"(key : String | Symbol) : String","location":{"filename":"src/avram/i18n_backend.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L6"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"return_type":"String","visibility":"Public","body":"{validate_acceptance_of: \"must be accepted\", validate_at_most_one_filled: \"must be blank\", validate_confirmation_of: \"must match\", validate_exact_size_of: \"must be exactly %d characters long\", validate_exactly_one_filled: \"at least one must be filled\", validate_format_of: \"is invalid\", validate_inclusion_of: \"is not included in the list\", validate_max_size_of: \"must not have more than %d characters\", validate_min_size_of: \"must have at least %d characters\", validate_numeric_max: \"must be no more than %s\", validate_numeric_min: \"must be at least %s\", validate_numeric_nil: \"must not be nil\", validate_required: \"is required\", validate_uniqueness_of: \"is already taken\"}[key]"}}]},{"html_id":"avram/Avram/I18nBackend","path":"Avram/I18nBackend.html","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend","abstract":true,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/I18n","kind":"struct","full_name":"Avram::I18n","name":"I18n"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L1"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"get(key:String|Symbol):String-instance-method","name":"get","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"args_string":"(key : String | Symbol) : String","args_html":"(key : String | Symbol) : String","location":{"filename":"src/avram/i18n_backend.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L2"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"return_type":"String","visibility":"Public","body":""}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L1"},"def":{"name":"initialize","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/ImpossibleValidation","path":"Avram/ImpossibleValidation.html","kind":"class","full_name":"Avram::ImpossibleValidation","name":"ImpossibleValidation","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L50"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when a validation is expecting an impossible constraint","summary":"

Raised when a validation is expecting an impossible constraint

","constructors":[{"html_id":"new(attribute:Symbol,message:String=\"animpossiblevalidation\")-class-method","name":"new","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Symbol"},{"name":"message","default_value":"\"an impossible validation\"","external_name":"message","restriction":"String"}],"args_string":"(attribute : Symbol, message : String = \"an impossible validation\")","args_html":"(attribute : Symbol, message : String = "an impossible validation")","location":{"filename":"src/avram/errors.cr","line_number":53,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L53"},"def":{"name":"new","args":[{"name":"attribute","external_name":"attribute","restriction":"Symbol"},{"name":"message","default_value":"\"an impossible validation\"","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(attribute, message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attribute:Symbol-instance-method","name":"attribute","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L51"},"def":{"name":"attribute","return_type":"Symbol","visibility":"Public","body":"@attribute"}}]},{"html_id":"avram/Avram/IncludesCriteria","path":"Avram/IncludesCriteria.html","kind":"module","full_name":"Avram::IncludesCriteria(T, V)","name":"IncludesCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/includes_criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria_extensions/includes_criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/String/Lucky/Criteria","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/UUID/Lucky/Criteria","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/InheritColumnAttributes","path":"Avram/InheritColumnAttributes.html","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes","abstract":false,"locations":[{"filename":"src/avram/inherit_column_attributes.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/inherit_column_attributes.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"inherit_column_attributes-macro","name":"inherit_column_attributes","abstract":false,"location":{"filename":"src/avram/inherit_column_attributes.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/inherit_column_attributes.cr#L8"},"def":{"name":"inherit_column_attributes","visibility":"Public","body":" \n\\{% if\n !@type.constant(:COLUMN_ATTRIBUTES) %}\n COLUMN_ATTRIBUTES = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n attribute in @type.ancestors.first.constant :COLUMN_ATTRIBUTES %}\n \n\\{% \nCOLUMN_ATTRIBUTES << attribute %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_column_attributes\n \nend\n \n"}}]},{"html_id":"avram/Avram/Insert","path":"Avram/Insert.html","kind":"class","full_name":"Avram::Insert","name":"Insert","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/insert.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(table:TableName,params:Params,column_names:Array(Symbol)=[]ofSymbol)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"params","external_name":"params","restriction":"Params"},{"name":"column_names","default_value":"[] of Symbol","external_name":"column_names","restriction":"Array(Symbol)"}],"args_string":"(table : TableName, params : Params, column_names : Array(Symbol) = [] of Symbol)","args_html":"(table : TableName, params : Params, column_names : Array(Symbol) = [] of Symbol)","location":{"filename":"src/avram/insert.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L4"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"params","external_name":"params","restriction":"Params"},{"name":"column_names","default_value":"[] of Symbol","external_name":"column_names","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, params, column_names)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/insert.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L19"},"def":{"name":"args","visibility":"Public","body":"@params.values"}},{"html_id":"statement:String-instance-method","name":"statement","abstract":false,"location":{"filename":"src/avram/insert.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L7"},"def":{"name":"statement","return_type":"String","visibility":"Public","body":"\"insert into #{@table}(#{fields}) values(#{values_placeholders}) returning #{returning}\""}}],"types":[{"html_id":"avram/Avram/Insert/Params","path":"Avram/Insert/Params.html","kind":"alias","full_name":"Avram::Insert::Params","name":"Params","abstract":false,"locations":[{"filename":"src/avram/insert.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Hash(Symbol, Nil) | Hash(Symbol, String | Nil) | Hash(Symbol, String))","aliased_html":"Hash(Symbol, Nil) | Hash(Symbol, String?) | Hash(Symbol, String)","const":false,"namespace":{"html_id":"avram/Avram/Insert","kind":"class","full_name":"Avram::Insert","name":"Insert"}}]},{"html_id":"avram/Avram/InvalidDatabaseNameError","path":"Avram/InvalidDatabaseNameError.html","kind":"class","full_name":"Avram::InvalidDatabaseNameError","name":"InvalidDatabaseNameError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":150,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L150"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/InvalidOperationError","path":"Avram/InvalidOperationError.html","kind":"class","full_name":"Avram::InvalidOperationError","name":"InvalidOperationError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Lucky/RenderableError","kind":"module","full_name":"Lucky::RenderableError","name":"RenderableError"},{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L59"},{"filename":"src/lucky/ext/avram/errors.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/RenderableError","kind":"module","full_name":"Lucky::RenderableError","name":"RenderableError"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when using the create!, update!, or delete! methods on an operation when it does not have the proper attributes","summary":"

Raised when using the create!, update!, or delete! methods on an operation when it does not have the proper attributes

","constructors":[{"html_id":"new(operation)-class-method","name":"new","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/errors.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L62"},"def":{"name":"new","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L60"},"def":{"name":"errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@errors"}},{"html_id":"invalid_attribute_name:String-instance-method","name":"invalid_attribute_name","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L17"},"def":{"name":"invalid_attribute_name","return_type":"String","visibility":"Public","body":"invalid_attribute[0].to_s"}},{"html_id":"renderable_details:String-instance-method","name":"renderable_details","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L13"},"def":{"name":"renderable_details","return_type":"String","visibility":"Public","body":"\"#{invalid_attribute_name} #{validation_messages.first}\""}},{"html_id":"renderable_message:String-instance-method","name":"renderable_message","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L9"},"def":{"name":"renderable_message","return_type":"String","visibility":"Public","body":"\"Invalid params\""}},{"html_id":"renderable_status:Int32-instance-method","name":"renderable_status","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L5"},"def":{"name":"renderable_status","return_type":"Int32","visibility":"Public","body":"400"}}]},{"html_id":"avram/Avram/InvalidQueryError","path":"Avram/InvalidQueryError.html","kind":"class","full_name":"Avram::InvalidQueryError","name":"InvalidQueryError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L153"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Join","path":"Avram/Join.html","kind":"module","full_name":"Avram::Join","name":"Join","abstract":false,"locations":[{"filename":"src/avram/join.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Join/Full","path":"Avram/Join/Full.html","kind":"class","full_name":"Avram::Join::Full","name":"Full","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L63"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L64"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"FULL\""}}]},{"html_id":"avram/Avram/Join/Inner","path":"Avram/Join/Inner.html","kind":"class","full_name":"Avram::Join::Inner","name":"Inner","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L46"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"INNER\""}}]},{"html_id":"avram/Avram/Join/Left","path":"Avram/Join/Left.html","kind":"class","full_name":"Avram::Join::Left","name":"Left","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L51"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L52"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"LEFT\""}}]},{"html_id":"avram/Avram/Join/Right","path":"Avram/Join/Right.html","kind":"class","full_name":"Avram::Join::Right","name":"Right","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L57"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L58"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"RIGHT\""}}]},{"html_id":"avram/Avram/Join/SqlClause","path":"Avram/Join/SqlClause.html","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Join/Full","kind":"class","full_name":"Avram::Join::Full","name":"Full"},{"html_id":"avram/Avram/Join/Inner","kind":"class","full_name":"Avram::Join::Inner","name":"Inner"},{"html_id":"avram/Avram/Join/Left","kind":"class","full_name":"Avram::Join::Left","name":"Left"},{"html_id":"avram/Avram/Join/Right","kind":"class","full_name":"Avram::Join::Right","name":"Right"}],"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"constructors":[{"html_id":"new(from:TableName,to:TableName,primary_key:Symbol|Nil=nil,foreign_key:Symbol|Nil=nil,comparison:String|Nil=\"=\",using:Array(Symbol)=[]ofSymbol)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"primary_key","default_value":"nil","external_name":"primary_key","restriction":"Symbol | ::Nil"},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":"Symbol | ::Nil"},{"name":"comparison","default_value":"\"=\"","external_name":"comparison","restriction":"String | ::Nil"},{"name":"using","default_value":"[] of Symbol","external_name":"using","restriction":"Array(Symbol)"}],"args_string":"(from : TableName, to : TableName, primary_key : Symbol | Nil = nil, foreign_key : Symbol | Nil = nil, comparison : String | Nil = \"=\", using : Array(Symbol) = [] of Symbol)","args_html":"(from : TableName, to : TableName, primary_key : Symbol | Nil = nil, foreign_key : Symbol | Nil = nil, comparison : String | Nil = "=", using : Array(Symbol) = [] of Symbol)","location":{"filename":"src/avram/join.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L8"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"primary_key","default_value":"nil","external_name":"primary_key","restriction":"Symbol | ::Nil"},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":"Symbol | ::Nil"},{"name":"comparison","default_value":"\"=\"","external_name":"comparison","restriction":"String | ::Nil"},{"name":"using","default_value":"[] of Symbol","external_name":"using","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, to, primary_key, foreign_key, comparison, using)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone:self-instance-method","name":"clone","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L40"},"def":{"name":"clone","return_type":"self","visibility":"Public","body":"self"}},{"html_id":"default_foreign_key:String-instance-method","name":"default_foreign_key","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L36"},"def":{"name":"default_foreign_key","return_type":"String","visibility":"Public","body":"(Wordsmith::Inflector.singularize(@from)) + \"_id\""}},{"html_id":"from:TableName-instance-method","name":"from","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L5"},"def":{"name":"from","return_type":"TableName","visibility":"Public","body":"@from"}},{"html_id":"from_column:String-instance-method","name":"from_column","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L28"},"def":{"name":"from_column","return_type":"String","visibility":"Public","body":"\"#{@from}.#{@primary_key || \"id\"}\""}},{"html_id":"join_type:String-instance-method","name":"join_type","abstract":true,"location":{"filename":"src/avram/join.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L18"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":""}},{"html_id":"to:TableName-instance-method","name":"to","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L6"},"def":{"name":"to","return_type":"TableName","visibility":"Public","body":"@to"}},{"html_id":"to_column:String-instance-method","name":"to_column","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L32"},"def":{"name":"to_column","return_type":"String","visibility":"Public","body":"\"#{@to}.#{@foreign_key || default_foreign_key}\""}},{"html_id":"to_sql:String-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L20"},"def":{"name":"to_sql","return_type":"String","visibility":"Public","body":"if !@using.empty?\n \"#{join_type} JOIN #{@to} USING (#{@using.join(\", \")})\"\nelse\n \"#{join_type} JOIN #{@to} ON #{from_column} #{@comparison} #{to_column}\"\nend"}}]}]},{"html_id":"avram/Avram/LazyLoadError","path":"Avram/LazyLoadError.html","kind":"class","full_name":"Avram::LazyLoadError","name":"LazyLoadError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L16"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when trying to access a record that was not preloaded and lazy load\nis disabled.","summary":"

Raised when trying to access a record that was not preloaded and lazy load is disabled.

","constructors":[{"html_id":"new(model:String,association:String)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"String"},{"name":"association","external_name":"association","restriction":"String"}],"args_string":"(model : String, association : String)","args_html":"(model : String, association : String)","location":{"filename":"src/avram/errors.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L20"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"String"},{"name":"association","external_name":"association","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, association)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"association:String-instance-method","name":"association","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L18"},"def":{"name":"association","return_type":"String","visibility":"Public","body":"@association"}},{"html_id":"model:String-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L17"},"def":{"name":"model","return_type":"String","visibility":"Public","body":"@model"}}]},{"html_id":"avram/Avram/MarkAsFailed","path":"Avram/MarkAsFailed.html","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed","abstract":false,"locations":[{"filename":"src/avram/mark_as_failed.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/mark_as_failed.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"mark_as_failed:Nil-instance-method","name":"mark_as_failed","abstract":false,"location":{"filename":"src/avram/mark_as_failed.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/mark_as_failed.cr#L2"},"def":{"name":"mark_as_failed","return_type":"Nil","visibility":"Public","body":"self.save_status = Avram::SaveOperation::OperationStatus::SaveFailed"}}]},{"html_id":"avram/Avram/Migrator","path":"Avram/Migrator.html","kind":"module","full_name":"Avram::Migrator","name":"Migrator","abstract":false,"locations":[{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L1"},{"filename":"src/avram/migrator/migrator.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migrator.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"run(&)-class-method","name":"run","abstract":false,"location":{"filename":"src/avram/migrator/migrator.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migrator.cr#L2"},"def":{"name":"run","yields":0,"block_arity":0,"visibility":"Public","body":"begin\n yield\nrescue e\n puts(e.inspect_with_backtrace)\n exit(1)\nend"}}],"types":[{"html_id":"avram/Avram/Migrator/AlterExtensionStatement","path":"Avram/Migrator/AlterExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::AlterExtensionStatement","name":"AlterExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,to:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"args_string":"(name : String, to : String | Nil = nil)","args_html":"(name : String, to : String | Nil = nil)","location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, to)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"String.build do |sql|\n sql << \"ALTER EXTENSION \\\"#{@name}\\\" UPDATE\"\n if @to\n sql << to_version\n end\n sql << \";\"\nend"}},{"html_id":"to_version-instance-method","name":"to_version","abstract":false,"location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L13"},"def":{"name":"to_version","visibility":"Public","body":"\" TO '#{@to}'\""}}]},{"html_id":"avram/Avram/Migrator/AlterTableStatement","path":"Avram/Migrator/AlterTableStatement.html","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L15"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_change_default_statement(column:Avram::Migrator::Columns::Base)-instance-method","name":"add_change_default_statement","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"args_string":"(column : Avram::Migrator::Columns::Base)","args_html":"(column : Avram::Migrator::Columns::Base)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L86"},"def":{"name":"add_change_default_statement","args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"visibility":"Public","body":"change_default_statements << (column.build_change_default_statement(@table_name))"}},{"html_id":"add_change_type_statement(column:Avram::Migrator::Columns::Base)-instance-method","name":"add_change_type_statement","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"args_string":"(column : Avram::Migrator::Columns::Base)","args_html":"(column : Avram::Migrator::Columns::Base)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L82"},"def":{"name":"add_change_type_statement","args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"visibility":"Public","body":"change_type_statements << (column.build_change_type_statement(@table_name))"}},{"html_id":"add_fill_existing_with_statements(column:Symbol|String,type,value,nilable)-instance-method","name":"add_fill_existing_with_statements","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol | String"},{"name":"type","external_name":"type","restriction":""},{"name":"value","external_name":"value","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""}],"args_string":"(column : Symbol | String, type, value, nilable)","args_html":"(column : Symbol | String, type, value, nilable)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L250"},"def":{"name":"add_fill_existing_with_statements","args":[{"name":"column","external_name":"column","restriction":"Symbol | String"},{"name":"type","external_name":"type","restriction":""},{"name":"value","external_name":"value","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""}],"visibility":"Public","body":"@fill_existing_with_statements << \"UPDATE #{@table_name} SET #{column} = #{value};\"\nif nilable\nelse\n @fill_existing_with_statements << \"ALTER TABLE #{@table_name} ALTER COLUMN #{column} SET NOT NULL;\"\nend\n"}},{"html_id":"alter_statements:Array(String)-instance-method","name":"alter_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":119,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L119"},"def":{"name":"alter_statements","return_type":"Array(String)","visibility":"Public","body":"alterations = renamed_rows.map do |statement|\n \"ALTER TABLE #{@table_name} #{statement};\"\nend\nif (rows + dropped_rows).empty?\nelse\n alterations << String.build do |statement|\n statement << \"ALTER TABLE #{@table_name}\"\n statement << \"\\n\"\n statement << ((rows + dropped_rows).join(\",\\n\"))\n statement << ';'\n end\nend\nalterations\n"}},{"html_id":"build(&)-instance-method","name":"build","doc":"Accepts a block to alter a table using the `add` method. The generated sql\nstatements are aggregated in the `statements` getter.\n\n## Usage\n\n```\nbuilt = Avram::Migrator::AlterTableStatement.new(:users).build do\n add name : String\n add age : Int32\n remove old_field\nend\n\nbuilt.statements\n# => [\n\"ALTER TABLE users\n ADD name text NOT NULL,\n ADD age int NOT NULL,\n DROP old_field\"\n]\n```","summary":"

Accepts a block to alter a table using the add method.

","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":110,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L110"},"def":{"name":"build","yields":0,"block_arity":0,"visibility":"Public","body":"with self yield\nself\n"}},{"html_id":"change_default_statements:Array(String)-instance-method","name":"change_default_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L13"},"def":{"name":"change_default_statements","visibility":"Public","body":"@change_default_statements"}},{"html_id":"change_type_statements:Array(String)-instance-method","name":"change_type_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L12"},"def":{"name":"change_type_statements","visibility":"Public","body":"@change_type_statements"}},{"html_id":"dropped_rows:Array(String)-instance-method","name":"dropped_rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L10"},"def":{"name":"dropped_rows","visibility":"Public","body":"@dropped_rows"}},{"html_id":"fill_existing_with_statements:Array(String)-instance-method","name":"fill_existing_with_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L11"},"def":{"name":"fill_existing_with_statements","visibility":"Public","body":"@fill_existing_with_statements"}},{"html_id":"renamed_rows:Array(String)-instance-method","name":"renamed_rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L9"},"def":{"name":"renamed_rows","visibility":"Public","body":"@renamed_rows"}},{"html_id":"rows:Array(String)-instance-method","name":"rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L8"},"def":{"name":"rows","visibility":"Public","body":"@rows"}},{"html_id":"statements-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":115,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L115"},"def":{"name":"statements","visibility":"Public","body":"(((alter_statements + change_default_statements) + change_type_statements) + index_statements) + fill_existing_with_statements"}}],"macros":[{"html_id":"add(type_declaration,index=false,using=:btree,unique=false,default=nil,fill_existing_with=nil,**type_options)-macro","name":"add","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""}],"args_string":"(type_declaration, index = false, using = :btree, unique = false, default = nil, fill_existing_with = nil, **type_options)","args_html":"(type_declaration, index = false, using = :btree, unique = false, default = nil, fill_existing_with = nil, **type_options)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":181,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L181"},"def":{"name":"add","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% type = type_declaration.type.resolve %}\n\n \n{% nilable = false %}\n\n \n{% array = false %}\n\n \n{% should_fill_existing = (!(fill_existing_with == nil)) && (fill_existing_with != (:nothing)) %}\n\n\n \n{% if type.nilable? %}\n {% type = type.union_types.reject(&.==(Nil)).first %}\n {% nilable = true %}\n {% end %}\n\n \n{% if type < Array %}\n {% type = type.type_vars.first %}\n {% array = true %}\n {% end %}\n\n\n \n{% if ((!nilable) && (default == nil)) && (fill_existing_with == nil) %}\n {% raise(\"\\nYou must provide a default value or use fill_existing_with when adding a required column to an existing table.\\n\\nTry one of these...\\n\\n ▸ add #{type_declaration}, default: \\\"Something\\\"\\n ▸ add #{type_declaration}, fill_existing_with: \\\"Something\\\"\\n ▸ add #{type_declaration}, fill_existing_with: :nothing\") %}\n {% end %}\n\n\n \n{% if (default != nil) && (fill_existing_with != nil) %}\n {% type_declaration.raise(\"\\nCannot use both 'default' and 'fill_existing_with' arguments for add(#{type_declaration}).\\n\\nTry this...\\n\\n ▸ Use `default` to set the default value, and backfill existing columns\\n ▸ Use `fill_existing_with` to backfill existing columns without a default value\") %}\n {% end %}\n\n\n rows << Avram::Migrator::Columns::\n{{ type }}\nColumn(\n \n{% if array %}Array({{ type }}){% else %}{{ type }}{% end %}\n\n ).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable || should_fill_existing }}\n,\n default: \n{{ default }}\n,\n \n{{ type_options.double_splat }}\n\n )\n \n{% if array %}\n .array!\n {% end %}\n\n .build_add_statement_for_alter\n\n \n{% if should_fill_existing %}\n add_fill_existing_with_statements(\n column: {{ type_declaration.var.stringify }},\n type: {{ type }},\n value: Avram::Migrator::Columns::{{ type }}Column.prepare_value_for_database({{ fill_existing_with }}),\n nilable: {{ nilable }}\n )\n {% end %}\n\n\n \n{% if index || unique %}\n add_index :{{ type_declaration.var }}, using: {{ using }}, unique: {{ unique }}\n {% end %}\n\n \n"}},{"html_id":"add_belongs_to(type_declaration,on_delete,references=nil,foreign_key_type=Int64,fill_existing_with=nil,unique=false)-macro","name":"add_belongs_to","doc":"Adds a references column and index given a model class and references option.","summary":"

Adds a references column and index given a model class and references option.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"args_string":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, fill_existing_with = nil, unique = false)","args_html":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, fill_existing_with = nil, unique = false)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L135"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.is_a?(TypeDeclaration) %}{% else %}\n {% raise(\"add_belongs_to expected a type declaration like 'user : User', instead got: '#{type_declaration}'\") %}\n {% end %}\n\n \n{% if (type_declaration.type.stringify =~ (/\\w::\\w/)) && references.nil? %}\n {% raise(\"Namespaced models must include the `references` option with the name of the table.\\n\\nTry this...\\n\\n ▸ add_belongs_to(#{type_declaration}, on_delete: #{on_delete}, references: :the_table_name)\") %}\n {% end %}\n\n \n{% optional = type_declaration.type.is_a?(Union) %}\n\n\n \n{% if optional %}\n {% underscored_class = type_declaration.type.types.first %}\n {% else %}\n {% underscored_class = type_declaration.type %}\n {% end %}\n\n \n{% underscored_class = underscored_class.stringify.underscore.gsub(/::/, \"_\") %}\n\n\n \n{% foreign_key_name = type_declaration.var + \"_id\" %}\n\n \n%table_name\n = \n{{ references }}\n || Wordsmith::Inflector.pluralize(\n{{ underscored_class }}\n)\n\n rows << ::Avram::Migrator::Columns::\n{{ foreign_key_type }}\nColumn(\n{{ foreign_key_type }}\n).new(\n name: \n{{ foreign_key_name.stringify }}\n,\n nilable: \n{{ optional }}\n,\n default: nil\n )\n .set_references(references: \n%table_name\n.to_s, on_delete: \n{{ on_delete }}\n)\n .build_add_statement_for_alter\n\n \n{% if (!(fill_existing_with == nil)) && (fill_existing_with != (:nothing)) %}\n add_fill_existing_with_statements(\n column: {{ foreign_key_name.stringify }},\n type: {{ foreign_key_type }},\n value: Avram::Migrator::Columns::{{ foreign_key_type }}Column.prepare_value_for_database({{ fill_existing_with }}),\n nilable: {{ optional }}\n )\n {% end %}\n\n\n add_index :\n{{ foreign_key_name }}\n, unique: \n{{ unique }}\n\n \n"}},{"html_id":"change_default(type_declaration,default)-macro","name":"change_default","doc":"Change the columns' default value to `default`\n```\nalter table_for(Post) do\n change_default published_at, default: :now\nend\n```","summary":"

Change the columns' default value to default alter table_for(Post) do change_default published_at, default: :now end

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(type_declaration, default)","args_html":"(type_declaration, default)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L68"},"def":{"name":"change_default","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":" \n{% if !type_declaration.is_a?(TypeDeclaration)\n raise(\"Must pass a type declaration to 'change_default'. Example: change_default count : Int32, default: 1\")\nend %}\n\n \n%column\n = ::Avram::Migrator::Columns::\n{{ type_declaration.type }}\nColumn(\n{{ type_declaration.type }}\n).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: false,\n default: \n{{ default }}\n\n )\n add_change_default_statement \n%column\n\n \n"}},{"html_id":"change_type(type_declaration,**type_options)-macro","name":"change_type","doc":"Change the column's type from whatever it is currently to\n`type_declaration.type`. The only exceptions are when changing\nfrom `text` to `citext` with `String` using `case_sensitive`, or changing to\na `Float64` column which requires setting the `precision`, and `scale`.\n```\nalter table_for(User) do\n change_type email : String, case_sensitive: false\nend\n```","summary":"

Change the column's type from whatever it is currently to type_declaration.type.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration, **type_options)","args_html":"(type_declaration, **type_options)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L27"},"def":{"name":"change_type","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% if !type_declaration.is_a?(TypeDeclaration)\n raise(\"Must pass a type declaration to 'change_type'. Example: change_type age : Int32\")\nelse\n if type_options.keys.includes?(\"default\".id)\n raise(\"Cannot change the default value from `change_type`. Use `change_default` instead.\")\n end\nend %}\n\n \n{% type = type_declaration.type.resolve\nnilable = false\nbytes = false\n %}\n\n \n{% if type.nilable?\n type = type.union_types.reject(&.==(Nil)).first\n nilable = true\nend %}\n\n \n{% if type < Slice\n type = \"Bytes\".id\n bytes = true\nend %}\n\n\n \n%column\n = ::Avram::Migrator::Columns::\n{{ type }}\nColumn(\n{{ type }}\n).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable }}\n,\n default: nil,\n \n{{ type_options.double_splat }}\n\n )\n add_change_type_statement \n%column\n\n \n"}},{"html_id":"remove(name)-macro","name":"remove","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name)","args_html":"(name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":294,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L294"},"def":{"name":"remove","args":[{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":" \n{% if name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"remove\", {{ name }})\n {% end %}\n\n dropped_rows << \" DROP #{\n{{ name }}\n}\"\n \n"}},{"html_id":"remove_belongs_to(association_name)-macro","name":"remove_belongs_to","abstract":false,"args":[{"name":"association_name","external_name":"association_name","restriction":""}],"args_string":"(association_name)","args_html":"(association_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":301,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L301"},"def":{"name":"remove_belongs_to","args":[{"name":"association_name","external_name":"association_name","restriction":""}],"visibility":"Public","body":" \n{% if association_name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"remove_belongs_to\", {{ name }})\n {% end %}\n\n remove \n{{ association_name }}\n_id\n \n"}},{"html_id":"rename(old_name,new_name)-macro","name":"rename","abstract":false,"args":[{"name":"old_name","external_name":"old_name","restriction":""},{"name":"new_name","external_name":"new_name","restriction":""}],"args_string":"(old_name, new_name)","args_html":"(old_name, new_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":276,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L276"},"def":{"name":"rename","args":[{"name":"old_name","external_name":"old_name","restriction":""},{"name":"new_name","external_name":"new_name","restriction":""}],"visibility":"Public","body":" \n{% for name in {old_name, new_name} %}\n {% if name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"rename\", {{ name }})\n {% end %}\n {% end %}\n\n renamed_rows << \"RENAME COLUMN #{\n{{ old_name }}\n} TO #{\n{{ new_name }}\n}\"\n \n"}},{"html_id":"rename_belongs_to(old_association_name,new_association_name)-macro","name":"rename_belongs_to","abstract":false,"args":[{"name":"old_association_name","external_name":"old_association_name","restriction":""},{"name":"new_association_name","external_name":"new_association_name","restriction":""}],"args_string":"(old_association_name, new_association_name)","args_html":"(old_association_name, new_association_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":285,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L285"},"def":{"name":"rename_belongs_to","args":[{"name":"old_association_name","external_name":"old_association_name","restriction":""},{"name":"new_association_name","external_name":"new_association_name","restriction":""}],"visibility":"Public","body":" \n{% for association_name in {old_association_name, new_association_name} %}\n {% if association_name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"rename_belongs_to\", {{ name }})\n {% end %}\n {% end %}\n\n rename \n{{ old_association_name }}\n_id, \n{{ new_association_name }}\n_id\n \n"}},{"html_id":"symbol_expected_error(action,name)-macro","name":"symbol_expected_error","abstract":false,"args":[{"name":"action","external_name":"action","restriction":""},{"name":"name","external_name":"name","restriction":""}],"args_string":"(action, name)","args_html":"(action, name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":255,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L255"},"def":{"name":"symbol_expected_error","args":[{"name":"action","external_name":"action","restriction":""},{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":" \n{% if name.is_a?(TypeDeclaration) %}\n {% example = name.var %}\n {% else %}\n {% example = name.id %}\n {% end %}\n\n\n \n{% raise(\"\\n#{action} expected a symbol like :#{example}, instead got: #{name}.\\n\\nin: #{name.filename}:#{name.line_number}:#{name.column_number}\\n\\nTry replacing...\\n\\n ▸ #{name} with :#{example}\") %}\n\n \n"}}]},{"html_id":"avram/Avram/Migrator/BuildReferenceFragment","path":"Avram/Migrator/BuildReferenceFragment.html","kind":"class","full_name":"Avram::Migrator::BuildReferenceFragment","name":"BuildReferenceFragment","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/build_reference_fragment.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(references:String|Symbol|Nil,on_delete:Symbol|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"::String | ::Symbol | ::Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"args_string":"(references : String | Symbol | Nil, on_delete : Symbol | Nil)","args_html":"(references : String | Symbol | Nil, on_delete : Symbol | Nil)","location":{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/build_reference_fragment.cr#L7"},"def":{"name":"new","args":[{"name":"references","external_name":"references","restriction":"::String | ::Symbol | ::Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(references, on_delete)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/build_reference_fragment.cr#L10"},"def":{"name":"build","visibility":"Public","body":"if on_delete == (:do_nothing)\n \" REFERENCES #{references}\"\nelse\n (\" REFERENCES #{references}\" + \" ON DELETE \") + on_delete_sql\nend"}}]},{"html_id":"avram/Avram/Migrator/ChangeNullStatement","path":"Avram/Migrator/ChangeNullStatement.html","kind":"class","full_name":"Avram::Migrator::ChangeNullStatement","name":"ChangeNullStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/change_null_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/change_null_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for changing a columns NOT NULL status.\n\n### Usage\n\n```\nChangeNullStatement.new(:users, :email, make: :optional).build\n# => \"ALTER TABLE users ALTER COLUMN email DROP NOT NULL;\"\n```","summary":"

Builds an SQL statement for changing a columns NOT NULL status.

","constructors":[{"html_id":"new(table:TableName,column:Symbol,required:Bool)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"required","external_name":"required","restriction":"Bool"}],"args_string":"(table : TableName, column : Symbol, required : Bool)","args_html":"(table : TableName, column : Symbol, required : Bool)","location":{"filename":"src/avram/migrator/change_null_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/change_null_statement.cr#L10"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"required","external_name":"required","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, column, required)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/change_null_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/change_null_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"if @required\n change = \"SET\"\nelse\n change = \"DROP\"\nend\nString.build do |index|\n index << \"ALTER TABLE #{@table}\"\n index << \" ALTER COLUMN #{@column}\"\n index << \" #{change} NOT NULL;\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/Columns","path":"Avram/Migrator/Columns.html","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L1"},{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bool_column.cr#L3"},{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bytes_column.cr#L3"},{"filename":"src/avram/migrator/columns/float_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L3"},{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int16_column.cr#L3"},{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int32_column.cr#L3"},{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int64_column.cr#L3"},{"filename":"src/avram/migrator/columns/string_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/string_column.cr#L3"},{"filename":"src/avram/migrator/columns/time_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L3"},{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/uuid_column.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"types":[{"html_id":"avram/Avram/Migrator/Columns/Base","path":"Avram/Migrator/Columns/Base.html","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/BoolColumn","kind":"class","full_name":"Avram::Migrator::Columns::BoolColumn(T)","name":"BoolColumn"},{"html_id":"avram/Avram/Migrator/Columns/BytesColumn","kind":"class","full_name":"Avram::Migrator::Columns::BytesColumn(T)","name":"BytesColumn"},{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn(T)","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Int16Column","kind":"class","full_name":"Avram::Migrator::Columns::Int16Column(T)","name":"Int16Column"},{"html_id":"avram/Avram/Migrator/Columns/Int32Column","kind":"class","full_name":"Avram::Migrator::Columns::Int32Column(T)","name":"Int32Column"},{"html_id":"avram/Avram/Migrator/Columns/Int64Column","kind":"class","full_name":"Avram::Migrator::Columns::Int64Column(T)","name":"Int64Column"},{"html_id":"avram/Avram/Migrator/Columns/JSON/AnyColumn","kind":"class","full_name":"Avram::Migrator::Columns::JSON::AnyColumn(T)","name":"AnyColumn"},{"html_id":"avram/Avram/Migrator/Columns/StringColumn","kind":"class","full_name":"Avram::Migrator::Columns::StringColumn(T)","name":"StringColumn"},{"html_id":"avram/Avram/Migrator/Columns/TimeColumn","kind":"class","full_name":"Avram::Migrator::Columns::TimeColumn(T)","name":"TimeColumn"},{"html_id":"avram/Avram/Migrator/Columns/UUIDColumn","kind":"class","full_name":"Avram::Migrator::Columns::UUIDColumn(T)","name":"UUIDColumn"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"class_methods":[{"html_id":"escape_literal(value)-class-method","name":"escape_literal","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L78"},"def":{"name":"escape_literal","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"PG::EscapeHelper.escape_literal(value)"}},{"html_id":"prepare_value_for_database(value:Array)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Array"}],"args_string":"(value : Array)","args_html":"(value : Array)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L74"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":"Array"}],"visibility":"Public","body":"escape_literal(PQ::Param.encode_array(value))"}},{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L70"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"escape_literal(value.to_s)"}}],"constructors":[{"html_id":"new(name)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name)","args_html":"(name)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"array!-instance-method","name":"array!","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L28"},"def":{"name":"array!","visibility":"Public","body":"@array = true\nself\n"}},{"html_id":"as_array_type:String-instance-method","name":"as_array_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L49"},"def":{"name":"as_array_type","return_type":"String","visibility":"Public","body":"@array ? \"[]\" : \"\""}},{"html_id":"build_add_statement_for_alter:String-instance-method","name":"build_add_statement_for_alter","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L41"},"def":{"name":"build_add_statement_for_alter","return_type":"String","visibility":"Public","body":"\" ADD \" + build_add_statement"}},{"html_id":"build_add_statement_for_create:String-instance-method","name":"build_add_statement_for_create","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L45"},"def":{"name":"build_add_statement_for_create","return_type":"String","visibility":"Public","body":"\" \" + build_add_statement"}},{"html_id":"build_change_default_statement(table_name:TableName):String-instance-method","name":"build_change_default_statement","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName) : String","args_html":"(table_name : TableName) : String","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L37"},"def":{"name":"build_change_default_statement","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"return_type":"String","visibility":"Public","body":"\"ALTER TABLE ONLY #{table_name} ALTER COLUMN #{name} SET#{default_fragment};\""}},{"html_id":"build_change_type_statement(table_name:TableName):String-instance-method","name":"build_change_type_statement","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName) : String","args_html":"(table_name : TableName) : String","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L33"},"def":{"name":"build_change_type_statement","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"return_type":"String","visibility":"Public","body":"\"ALTER TABLE #{table_name} ALTER COLUMN #{name} SET DATA TYPE #{column_type};\""}},{"html_id":"column_type:String-instance-method","name":"column_type","abstract":true,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L64"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":""}},{"html_id":"set_references(references:String,on_delete:Symbol)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"String"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"}],"args_string":"(references : String, on_delete : Symbol)","args_html":"(references : String, on_delete : Symbol)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L16"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"String"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\nself\n"}},{"html_id":"set_references(references:Nil,on_delete:Nil)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"Nil"}],"args_string":"(references : Nil, on_delete : Nil)","args_html":"(references : Nil, on_delete : Nil)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L20"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"Nil"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\nself\n"}},{"html_id":"set_references(references:Nil|String,on_delete:Symbol|Nil)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"::Nil | ::String"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"args_string":"(references : Nil | String, on_delete : Symbol | Nil)","args_html":"(references : Nil | String, on_delete : Symbol | Nil)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L24"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"::Nil | ::String"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\n{% raise(\"When setting a reference you must set the reference table and the 'on_delete' option.\") %}\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/BoolColumn","path":"Avram/Migrator/Columns/BoolColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::BoolColumn(T)","name":"BoolColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bool_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bool_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = BoolColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bool_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"boolean\""}}]},{"html_id":"avram/Avram/Migrator/Columns/BytesColumn","path":"Avram/Migrator/Columns/BytesColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::BytesColumn(T)","name":"BytesColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bytes_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Slice(UInt8)|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Slice(::UInt8) | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Slice(UInt8) | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Slice(UInt8) | T | Nil)","location":{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bytes_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Slice(::UInt8) | T | ::Nil"}],"visibility":"Public","body":"_ = BytesColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bytes_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bytea\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Float32Column","path":"Avram/Migrator/Columns/Float32Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Float32Column(T)","name":"Float32Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name,nilable,default,precision,scale)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"args_string":"(name, nilable, default, precision, scale)","args_html":"(name, nilable, default, precision, scale)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"visibility":"Public","body":"_ = Float32Column(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name,nilable,default)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(name, nilable, default)","args_html":"(name, nilable, default)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":"_ = Float32Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/Float64Column","path":"Avram/Migrator/Columns/Float64Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Float64Column(T)","name":"Float64Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L29"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name,nilable,default,precision,scale)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"args_string":"(name, nilable, default, precision, scale)","args_html":"(name, nilable, default, precision, scale)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"visibility":"Public","body":"_ = Float64Column(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name,nilable,default)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(name, nilable, default)","args_html":"(name, nilable, default)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":"_ = Float64Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","path":"Avram/Migrator/Columns/FloatColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn(T)","name":"FloatColumn","abstract":true,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/Float32Column","kind":"class","full_name":"Avram::Migrator::Columns::Float32Column(T)","name":"Float32Column"},{"html_id":"avram/Avram/Migrator/Columns/Float64Column","kind":"class","full_name":"Avram::Migrator::Columns::Float64Column(T)","name":"Float64Column"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Float32|T|Nil,precision:Int32|Nil,scale:Int32|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"},{"name":"precision","external_name":"precision","restriction":"::Int32 | ::Nil"},{"name":"scale","external_name":"scale","restriction":"::Int32 | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil, precision : Int32 | Nil, scale : Int32 | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil, precision : Int32 | Nil, scale : Int32 | Nil)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"},{"name":"precision","external_name":"precision","restriction":"::Int32 | ::Nil"},{"name":"scale","external_name":"scale","restriction":"::Int32 | ::Nil"}],"visibility":"Public","body":"_ = FloatColumn(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name:String,nilable:Bool|Nil,default:Float32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"}],"visibility":"Public","body":"_ = FloatColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L17"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"if precision && scale\n \"decimal(#{precision},#{scale})\"\nelse\n \"decimal\"\nend"}}]},{"html_id":"avram/Avram/Migrator/Columns/Int16Column","path":"Avram/Migrator/Columns/Int16Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int16Column(T)","name":"Int16Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int16_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Int32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int16_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"visibility":"Public","body":"_ = Int16Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int16_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"smallint\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Int32Column","path":"Avram/Migrator/Columns/Int32Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int32Column(T)","name":"Int32Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int32_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int32_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = Int32Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int32_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"int4\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Int64Column","path":"Avram/Migrator/Columns/Int64Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int64Column(T)","name":"Int64Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int64_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Int32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int64_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"visibility":"Public","body":"_ = Int64Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int64_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bigint\""}}]},{"html_id":"avram/Avram/Migrator/Columns/JSON","path":"Avram/Migrator/Columns/JSON.html","kind":"module","full_name":"Avram::Migrator::Columns::JSON","name":"JSON","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/json_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"types":[{"html_id":"avram/Avram/Migrator/Columns/JSON/AnyColumn","path":"Avram/Migrator/Columns/JSON/AnyColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::JSON::AnyColumn(T)","name":"AnyColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/json_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/JSON","kind":"module","full_name":"Avram::Migrator::Columns::JSON","name":"JSON"},"class_methods":[{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L14"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"escape_literal(value.to_json)"}}],"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:::JSON::Any|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::JSON::Any | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : ::JSON::Any | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : ::JSON::Any | Nil)","location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::JSON::Any | ::Nil"}],"visibility":"Public","body":"_ = AnyColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"jsonb\""}}]}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","path":"Avram/Migrator/Columns/PrimaryKeys.html","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/base.cr#L1"},{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"types":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","path":"Avram/Migrator/Columns/PrimaryKeys/Base.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/base.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int16PrimaryKey","name":"Int16PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int32PrimaryKey","name":"Int32PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int64PrimaryKey","name":"Int64PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::UUIDPrimaryKey","name":"UUIDPrimaryKey"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"instance_methods":[{"html_id":"build:String-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/base.cr#L8"},"def":{"name":"build","return_type":"String","visibility":"Public","body":"\" #{name} #{column_type} PRIMARY KEY\""}},{"html_id":"column_type-instance-method","name":"column_type","abstract":true,"location":{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/base.cr#L6"},"def":{"name":"column_type","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int16PrimaryKey","name":"Int16PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"smallserial\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int32PrimaryKey","name":"Int32PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"serial4\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int64PrimaryKey","name":"Int64PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bigserial\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::UUIDPrimaryKey","name":"UUIDPrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build:String-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L12"},"def":{"name":"build","return_type":"String","visibility":"Public","body":"\" #{name} #{column_type} PRIMARY KEY DEFAULT gen_random_uuid()\""}},{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"uuid\""}}]}]},{"html_id":"avram/Avram/Migrator/Columns/StringColumn","path":"Avram/Migrator/Columns/StringColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::StringColumn(T)","name":"StringColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/string_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/string_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil,case_sensitive:Bool=true)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"},{"name":"case_sensitive","default_value":"true","external_name":"case_sensitive","restriction":"::Bool"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil, case_sensitive : Bool = true)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil, case_sensitive : Bool = true)","location":{"filename":"src/avram/migrator/columns/string_column.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/string_column.cr#L8"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"},{"name":"case_sensitive","default_value":"true","external_name":"case_sensitive","restriction":"::Bool"}],"visibility":"Public","body":"_ = StringColumn(T).allocate\n_.initialize(name, nilable, default, case_sensitive)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","doc":"If `case_sensitive?` is false then the column type is set to `citext`\nwhich requires the `citext` extension to be enabled\notherwise the type is `text`","summary":"

If case_sensitive? is false then the column type is set to citext which requires the citext extension to be enabled otherwise the type is text

","abstract":false,"location":{"filename":"src/avram/migrator/columns/string_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/string_column.cr#L14"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"case_sensitive? ? \"text\" : \"citext\""}}]},{"html_id":"avram/Avram/Migrator/Columns/TimeColumn","path":"Avram/Migrator/Columns/TimeColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::TimeColumn(T)","name":"TimeColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/time_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"class_methods":[{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L14"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"if value == (:now)\n \"NOW()\"\nelse\n if value.is_a?(Time)\n escape_literal(value.to_utc.to_s)\n else\n raise(\"Unrecognized value :#{value} for a timestamptz. Please use a Time object or :now for current timestamp.\")\n end\nend"}}],"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Symbol|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Symbol | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Symbol | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Symbol | T | Nil)","location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Symbol | T | ::Nil"}],"visibility":"Public","body":"_ = TimeColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"timestamptz\""}}]},{"html_id":"avram/Avram/Migrator/Columns/UUIDColumn","path":"Avram/Migrator/Columns/UUIDColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::UUIDColumn(T)","name":"UUIDColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/uuid_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/uuid_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = UUIDColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/uuid_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"uuid\""}}]}]},{"html_id":"avram/Avram/Migrator/CreateExtensionStatement","path":"Avram/Migrator/CreateExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::CreateExtensionStatement","name":"CreateExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"CREATE EXTENSION IF NOT EXISTS \\\"#{@name}\\\";\""}}]},{"html_id":"avram/Avram/Migrator/CreateForeignKeyStatement","path":"Avram/Migrator/CreateForeignKeyStatement.html","kind":"class","full_name":"Avram::Migrator::CreateForeignKeyStatement","name":"CreateForeignKeyStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_foreign_key_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Generates an ALTER TABLE statement for adding a foreign key constraint on a table.\n\n### Usage\n\n```\nCreateForeignKeyStatement.new(from: :comments, to: :users, column: :author_id, primary_key: :uid, on_delete: :cascade).build\n# => \"ALTER TABLE comments ADD CONSTRAINT comments_author_id_fk FOREIGN KEY (author_id) REFERENCES users (uid) ON DELETE CASCADE;\"\n```","summary":"

Generates an ALTER TABLE statement for adding a foreign key constraint on a table.

","constructors":[{"html_id":"new(from:TableName,to:TableName,on_delete:Symbol,column:Symbol|Nil=nil,primary_key:Symbol=:id)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":"::Symbol"}],"args_string":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil = nil, primary_key : Symbol = :id)","args_html":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil = nil, primary_key : Symbol = :id)","location":{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_foreign_key_statement.cr#L10"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":"::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, to, on_delete, column, primary_key)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_foreign_key_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"foreign_key = @column || ((Wordsmith::Inflector.singularize(@to.to_s)) + \"_id\")\nString.build do |index|\n index << \"ALTER TABLE\"\n index << \" #{@from}\"\n index << \" ADD CONSTRAINT #{@from}_#{foreign_key}_fk\"\n index << \" FOREIGN KEY (#{foreign_key})\"\n index << (BuildReferenceFragment.new(\"#{@to} (#{@primary_key})\", @on_delete)).build\n index << \";\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/CreateFunctionStatement","path":"Avram/Migrator/CreateFunctionStatement.html","kind":"class","full_name":"Avram::Migrator::CreateFunctionStatement","name":"CreateFunctionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_function_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_function_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,body:String,returns:String=\"trigger\")-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"args_string":"(name : String, body : String, returns : String = \"trigger\")","args_html":"(name : String, body : String, returns : String = "trigger")","location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_function_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, body, returns)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_function_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"\"CREATE OR REPLACE FUNCTION #{function_name}\\n RETURNS #{@returns} AS $$\\nBEGIN\\n #{@body}\\nEND\\n$$ LANGUAGE 'plpgsql';\""}},{"html_id":"function_name-instance-method","name":"function_name","abstract":false,"location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_function_statement.cr#L5"},"def":{"name":"function_name","visibility":"Public","body":"if @name.ends_with?(')')\n @name\nelse\n \"#{@name}()\"\nend"}}]},{"html_id":"avram/Avram/Migrator/CreateIndexStatement","path":"Avram/Migrator/CreateIndexStatement.html","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_index_statement.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L28"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for creating an index using table name, column\nname(s), index type and unique flag.\n\n### Usage\n\nFor a single column:\n\n```\nCreateIndexStatement.new(:users, columns: :email, using: :btree, unique: true).build\n# => \"CREATE UNIQUE INDEX users_email_index ON users USING btree (email);\"\n```\n\nFor multiple columns:\n\n```\nCreateIndexStatement.new(:users, columns: [:email, :username], using: :btree, unique: true).build\n# => \"CREATE UNIQUE INDEX users_email_username_index ON users USING btree (email, username);\"\n```\n\nWith custom name:\n\n```\nCreateIndexStatement.new(:users, columns: [:email, :username], name: :custom_index_name).build\n# => \"CREATE INDEX custom_index_name ON users USING btree (email, username);\"\n```","summary":"

Builds an SQL statement for creating an index using table name, column name(s), index type and unique flag.

","constructors":[{"html_id":"new(table:TableName,columns:Columns,using:Symbol=:btree,unique:Bool=false,name:String|Nil|Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":"::Bool"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table : TableName, columns : Columns, using : Symbol = :btree, unique : Bool = false, name : String | Nil | Symbol | Nil = nil)","args_html":"(table : TableName, columns : Columns, using : Symbol = :btree, unique : Bool = false, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L39"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":"::Bool"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, columns, using, unique, name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L44"},"def":{"name":"build","visibility":"Public","body":"index_name = @name\nindex_name || (index_name = \"#{@table}_#{columns.join(\"_\")}_index\")\nString.build do |index|\n index << \"CREATE\"\n if @unique\n index << \" UNIQUE\"\n end\n index << \" INDEX #{index_name}\"\n index << \" ON #{@table}\"\n index << \" USING #{@using.to_s.downcase}\"\n index << \" (#{columns.join(\", \")});\"\nend\n"}}],"types":[{"html_id":"avram/Avram/Migrator/CreateIndexStatement/IndexTypes","path":"Avram/Migrator/CreateIndexStatement/IndexTypes.html","kind":"enum","full_name":"Avram::Migrator::CreateIndexStatement::IndexTypes","name":"IndexTypes","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_index_statement.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L31"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Btree","name":"Btree","value":"0"},{"id":"Hash","name":"Hash","value":"1"},{"id":"Gist","name":"Gist","value":"2"},{"id":"Gin","name":"Gin","value":"3"},{"id":"Brin","name":"Brin","value":"4"}],"namespace":{"html_id":"avram/Avram/Migrator/CreateIndexStatement","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement"},"instance_methods":[{"html_id":"brin?-instance-method","name":"brin?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L36"},"def":{"name":"brin?","visibility":"Public","body":"self == Brin"}},{"html_id":"btree?-instance-method","name":"btree?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L32"},"def":{"name":"btree?","visibility":"Public","body":"self == Btree"}},{"html_id":"gin?-instance-method","name":"gin?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L35"},"def":{"name":"gin?","visibility":"Public","body":"self == Gin"}},{"html_id":"gist?-instance-method","name":"gist?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L34"},"def":{"name":"gist?","visibility":"Public","body":"self == Gist"}},{"html_id":"hash?-instance-method","name":"hash?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L33"},"def":{"name":"hash?","visibility":"Public","body":"self == Hash"}}]}]},{"html_id":"avram/Avram/Migrator/CreateTableStatement","path":"Avram/Migrator/CreateTableStatement.html","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_table_statement.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L11"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build(&):CreateTableStatement-instance-method","name":"build","doc":"Accepts a block to build a table and indices using `add` and `add_index` methods.\n\nThe generated sql statements are aggregated in the `statements` method.\n\n## Usage\n\n```\nbuilt = Avram::Migrator::CreateTableStatement.new(:users).build do\n add_belongs_to Account, on_delete: :cascade\n add :email : String, unique: true\nend\n\nbuilt.statements\n# => [\n \"CREATE TABLE users (\n id serial PRIMARY KEY,\n created_at timestamptz NOT NULL,\n updated_at timestamptz NOT NULL,\n account_id bigint NOT NULL REFERENCES accounts (id) ON DELETE CASCADE,\n email text NOT NULL);\",\n \"CREATE UNIQUE INDEX users_email_index ON users USING btree (email);\"\n]\n```\n\nAn optional second argument can toggle between the usage of a numeric or uuid\nbased id column.\n\n```\nbuilt = Avram::Migrator::CreateTableStatement.new(:users, PrimaryKeyType::UUID).build do\n add :email : String, unique: true\nend\n```","summary":"

Accepts a block to build a table and indices using add and add_index methods.

","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L46"},"def":{"name":"build","yields":0,"block_arity":0,"return_type":"CreateTableStatement","visibility":"Public","body":"with self yield\nself\n"}},{"html_id":"statements-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L51"},"def":{"name":"statements","visibility":"Public","body":"[table_statement] + index_statements"}}],"macros":[{"html_id":"add(type_declaration,default=nil,index=false,unique=false,using=:btree,**type_options)-macro","name":"add","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""}],"args_string":"(type_declaration, default = nil, index = false, unique = false, using = :btree, **type_options)","args_html":"(type_declaration, default = nil, index = false, unique = false, using = :btree, **type_options)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":89,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L89"},"def":{"name":"add","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% type = type_declaration.type.resolve\nnilable = false\narray = false\nbytes = false\n %}\n\n \n{% if type.nilable?\n type = type.union_types.reject(&.==(Nil)).first\n nilable = true\nend %}\n\n \n{% if type < Array\n type = type.type_vars.first\n array = true\nend %}\n\n \n{% if type < Slice\n type = \"Bytes\".id\n bytes = true\nend %}\n\n\n\n rows << Avram::Migrator::Columns::\n{{ type }}\nColumn(\n \n{% if array %}Array({{ type }}){% else %}{{ type }}{% end %}\n\n ).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable }}\n,\n default: \n{{ default }}\n,\n \n{{ type_options.double_splat }}\n\n )\n \n{% if array %}\n .array!\n {% end %}\n\n .build_add_statement_for_create\n\n \n{% if index || unique %}\n add_index :{{ type_declaration.var }}, using: {{ using }}, unique: {{ unique }}\n {% end %}\n\n \n"}},{"html_id":"add_belongs_to(type_declaration,on_delete,references=nil,foreign_key_type=Int64,unique=false)-macro","name":"add_belongs_to","doc":"Adds a references column and index given a model class and references option.","summary":"

Adds a references column and index given a model class and references option.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"args_string":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, unique = false)","args_html":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, unique = false)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L135"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.is_a?(TypeDeclaration) %}{% else %}\n {% raise(\"add_belongs_to expected a type declaration like 'user : User', instead got: '#{type_declaration}'\") %}\n {% end %}\n\n \n{% if (type_declaration.type.stringify =~ (/\\w::\\w/)) && references.nil? %}\n {% raise(\"Namespaced models must include the `references` option with the name of the table.\\n\\nTry this...\\n\\n ▸ add_belongs_to(#{type_declaration}, on_delete: #{on_delete}, references: :the_table_name)\") %}\n {% end %}\n\n \n{% optional = type_declaration.type.is_a?(Union) %}\n\n\n \n{% if optional %}\n {% underscored_class = type_declaration.type.types.first %}\n {% else %}\n {% underscored_class = type_declaration.type %}\n {% end %}\n\n \n{% underscored_class = underscored_class.stringify.underscore.gsub(/::/, \"_\") %}\n\n\n \n{% foreign_key_name = type_declaration.var + \"_id\" %}\n\n \n%table_name\n = \n{{ references }}\n || Wordsmith::Inflector.pluralize(\n{{ underscored_class }}\n)\n\n rows << Avram::Migrator::Columns::\n{{ foreign_key_type }}\nColumn(\n{{ foreign_key_type }}\n).new(\n name: \n{{ foreign_key_name.stringify }}\n,\n nilable: \n{{ optional }}\n,\n default: nil,\n )\n .set_references(references: \n%table_name\n.to_s, on_delete: \n{{ on_delete }}\n)\n .build_add_statement_for_create\n\n add_index :\n{{ foreign_key_name }}\n, unique: \n{{ unique }}\n\n \n"}},{"html_id":"add_timestamps-macro","name":"add_timestamps","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":84,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L84"},"def":{"name":"add_timestamps","visibility":"Public","body":" add created_at : Time, default: :now\n add updated_at : Time, default: :now\n "}},{"html_id":"belongs_to(type_declaration,*args,**named_args)-macro","name":"belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type_declaration, *args, **named_args)","args_html":"(type_declaration, *args, **named_args)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":172,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L172"},"def":{"name":"belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% raise(\"Unexpected call to `belongs_to` in a migration.\\nFound in #{type_declaration.filename.id}:#{type_declaration.line_number}:#{type_declaration.column_number}.\\n\\nDid you mean to use 'add_belongs_to'?\\n\\n'add_belongs_to #{type_declaration}, ...'\") %}\n\n \n"}},{"html_id":"composite_primary_key(*columns)-macro","name":"composite_primary_key","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""}],"args_string":"(*columns)","args_html":"(*columns)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L77"},"def":{"name":"composite_primary_key","args":[{"name":"columns","external_name":"columns","restriction":""}],"splat_index":0,"visibility":"Public","body":" \n{% if columns.size < 2 %}\n {% raise(\"composite_primary_key expected at least two primary keys, instead got #{columns.size}\") %}\n {% end %}\n\n constraints << \" PRIMARY KEY (\n{{ (columns.join(\", \")).id }}\n)\"\n \n"}},{"html_id":"primary_key(type_declaration)-macro","name":"primary_key","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L71"},"def":{"name":"primary_key","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" rows << Avram::Migrator::Columns::PrimaryKeys::\n{{ type_declaration.type }}\nPrimaryKey\n .new(name: \n{{ type_declaration.var.stringify }}\n)\n .build\n \n"}}]},{"html_id":"avram/Avram/Migrator/CreateTriggerStatement","path":"Avram/Migrator/CreateTriggerStatement.html","kind":"class","full_name":"Avram::Migrator::CreateTriggerStatement","name":"CreateTriggerStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_trigger_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName,trigger_name:String,function:String,callbacktrigger_when:Symbol=:before,ontrigger_operation:Array(Symbol)=[:update])-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"},{"name":"function","external_name":"function","restriction":"String"},{"name":"trigger_when","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"trigger_operation","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"args_string":"(table_name : TableName, trigger_name : String, function : String, callback trigger_when : Symbol = :before, on trigger_operation : Array(Symbol) = [:update])","args_html":"(table_name : TableName, trigger_name : String, function : String, callback trigger_when : Symbol = :before, on trigger_operation : Array(Symbol) = [:update])","location":{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_trigger_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"},{"name":"function","external_name":"function","restriction":"String"},{"name":"trigger_when","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"trigger_operation","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, trigger_name, function, trigger_when, trigger_operation)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_trigger_statement.cr#L11"},"def":{"name":"build","visibility":"Public","body":"\"CREATE TRIGGER #{@trigger_name}\\n#{@trigger_when.to_s.upcase} #{operation_statement} ON #{@table_name}\\nFOR EACH ROW\\nEXECUTE PROCEDURE #{@function}();\""}}]},{"html_id":"avram/Avram/Migrator/DropExtensionStatement","path":"Avram/Migrator/DropExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::DropExtensionStatement","name":"DropExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP EXTENSION IF EXISTS \\\"#{@name}\\\" CASCADE;\""}}]},{"html_id":"avram/Avram/Migrator/DropForeignKeyStatement","path":"Avram/Migrator/DropForeignKeyStatement.html","kind":"class","full_name":"Avram::Migrator::DropForeignKeyStatement","name":"DropForeignKeyStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_foreign_key_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Generates an ALTER TABLE statement for dropping a foreign key constraint on a table.\n\n### Usage\n\n```\nDropForeignKeyStatement.new(from: :comments, references: :users, column: :author_id).build\n# => \"ALTER TABLE comments DROP CONSTRAINT comments_author_id_fk;\"\n```","summary":"

Generates an ALTER TABLE statement for dropping a foreign key constraint on a table.

","constructors":[{"html_id":"new(from:TableName,references:TableName,column:Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"}],"args_string":"(from : TableName, references : TableName, column : Symbol | Nil = nil)","args_html":"(from : TableName, references : TableName, column : Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_foreign_key_statement.cr#L10"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, references, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_foreign_key_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"foreign_key = @column || ((Wordsmith::Inflector.singularize(@references.to_s)) + \"_id\")\nString.build do |index|\n index << \"ALTER TABLE\"\n index << \" #{@from}\"\n index << \" DROP CONSTRAINT #{@from}_#{foreign_key}_fk\"\n index << \";\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/DropFunctionStatement","path":"Avram/Migrator/DropFunctionStatement.html","kind":"class","full_name":"Avram::Migrator::DropFunctionStatement","name":"DropFunctionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_function_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_function_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_function_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP FUNCTION IF EXISTS \\\"#{@name}\\\" CASCADE;\""}}]},{"html_id":"avram/Avram/Migrator/DropIndexStatement","path":"Avram/Migrator/DropIndexStatement.html","kind":"class","full_name":"Avram::Migrator::DropIndexStatement","name":"DropIndexStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_index_statement.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ALLOWED_ON_DELETE_STRATEGIES","name":"ALLOWED_ON_DELETE_STRATEGIES","value":"[:cascade, :restrict] of ::Symbol"}],"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for dropping an index by inferring it's name using table name and column(s).\n\n### Usage\n\nFor a single column index:\n\n```\nDropIndexStatement.new(:users, :email, if_exists: true, on_delete: :cascade).build\n# => \"DROP INDEX IF EXISTS users_email_index CASCADE;\"\n```\n\nFor multiple column index:\n\n```\nDropIndexStatement.new(:users, [:email, :username] if_exists: true, on_delete: :cascade).build\n# => \"DROP INDEX IF EXISTS users_email_username_index CASCADE;\"\n```\n\nFor index by name:\n\n```\nDropIndexStatement.new(:users, name: :custom_index_name).build\n# => \"DROP INDEX custom_index_name;\"\n```","summary":"

Builds an SQL statement for dropping an index by inferring it's name using table name and column(s).

","constructors":[{"html_id":"new(table:TableName,columns:Columns|Nil=nil,if_exists:Bool=false,on_delete:Symbol=:do_nothing,name:String|Nil|Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":"::Bool"},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":"::Symbol"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table : TableName, columns : Columns | Nil = nil, if_exists : Bool = false, on_delete : Symbol = :do_nothing, name : String | Nil | Symbol | Nil = nil)","args_html":"(table : TableName, columns : Columns | Nil = nil, if_exists : Bool = false, on_delete : Symbol = :do_nothing, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_index_statement.cr#L32"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":"::Bool"},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":"::Symbol"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, columns, if_exists, on_delete, name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_index_statement.cr#L35"},"def":{"name":"build","visibility":"Public","body":"String.build do |index|\n index << \"DROP INDEX\"\n if @if_exists\n index << \" IF EXISTS\"\n end\n index << \" #{index_name}\"\n index << (on_delete_strategy(@on_delete))\nend"}},{"html_id":"on_delete_strategy(on_delete=:do_nothing)-instance-method","name":"on_delete_strategy","abstract":false,"args":[{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""}],"args_string":"(on_delete = :do_nothing)","args_html":"(on_delete = :do_nothing)","location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_index_statement.cr#L44"},"def":{"name":"on_delete_strategy","args":[{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""}],"visibility":"Public","body":"if on_delete == (:do_nothing)\n \";\"\nelse\n if ALLOWED_ON_DELETE_STRATEGIES.includes?(on_delete)\n \" #{on_delete};\".upcase\n else\n raise(\"on_delete: :#{on_delete} is not supported. Please use :do_nothing, :cascade or :restrict\")\n end\nend"}}]},{"html_id":"avram/Avram/Migrator/DropTableStatement","path":"Avram/Migrator/DropTableStatement.html","kind":"class","full_name":"Avram::Migrator::DropTableStatement","name":"DropTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_table_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_table_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_table_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP TABLE #{@table_name}\""}}]},{"html_id":"avram/Avram/Migrator/DropTriggerStatement","path":"Avram/Migrator/DropTriggerStatement.html","kind":"class","full_name":"Avram::Migrator::DropTriggerStatement","name":"DropTriggerStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_trigger_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName,trigger_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"}],"args_string":"(table_name : TableName, trigger_name : String)","args_html":"(table_name : TableName, trigger_name : String)","location":{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_trigger_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, trigger_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_trigger_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP TRIGGER IF EXISTS #{@trigger_name} ON #{@table_name};\""}}]},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","path":"Avram/Migrator/IndexStatementHelpers.html","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers","abstract":false,"locations":[{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/index_statement_helpers.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/AlterTableStatement","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement"},{"html_id":"avram/Avram/Migrator/CreateIndexStatement","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement"},{"html_id":"avram/Avram/Migrator/CreateTableStatement","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement"},{"html_id":"avram/Avram/Migrator/DropIndexStatement","kind":"class","full_name":"Avram::Migrator::DropIndexStatement","name":"DropIndexStatement"},{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"instance_methods":[{"html_id":"add_index(column:Symbol,unique=false,using:Symbol=:btree)-instance-method","name":"add_index","doc":"Generates raw sql for adding an index to a table column. Accepts 'unique' and 'using' options.","summary":"

Generates raw sql for adding an index to a table column.

","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"}],"args_string":"(column : Symbol, unique = false, using : Symbol = :btree)","args_html":"(column : Symbol, unique = false, using : Symbol = :btree)","location":{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/index_statement_helpers.cr#L7"},"def":{"name":"add_index","args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"}],"visibility":"Public","body":"index = (CreateIndexStatement.new(@table_name, column, using, unique)).build\nif index_added?(index, column)\nelse\n index_statements << index\nend\n"}},{"html_id":"index_added?(index:String,column:Symbol)-instance-method","name":"index_added?","doc":"Returns false unless matching index exists. Ignores UNIQUE","summary":"

Returns false unless matching index exists.

","abstract":false,"args":[{"name":"index","external_name":"index","restriction":"String"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(index : String, column : Symbol)","args_html":"(index : String, column : Symbol)","location":{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/index_statement_helpers.cr#L13"},"def":{"name":"index_added?","args":[{"name":"index","external_name":"index","restriction":"String"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"if (index_statements.includes?(index)) || (index_statements.includes?(index.gsub(\" UNIQUE\", \"\")))\nelse\n return false\nend\nraise(\"index on #{@table_name}.#{column} already exists\")\n"}}],"types":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers/Columns","path":"Avram/Migrator/IndexStatementHelpers/Columns.html","kind":"alias","full_name":"Avram::Migrator::IndexStatementHelpers::Columns","name":"Columns","abstract":false,"locations":[{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/index_statement_helpers.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Array(Symbol) | Symbol)","aliased_html":"Array(Symbol) | Symbol","const":false,"namespace":{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}}]},{"html_id":"avram/Avram/Migrator/Migration","path":"Avram/Migrator/Migration.html","kind":"module","full_name":"Avram::Migrator::Migration","name":"Migration","abstract":false,"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"types":[{"html_id":"avram/Avram/Migrator/Migration/V1","path":"Avram/Migrator/Migration/V1.html","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"},{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator/Migration","kind":"module","full_name":"Avram::Migrator::Migration","name":"Migration"},"instance_methods":[{"html_id":"down(quiet=false)-instance-method","name":"down","doc":"Same as #up except calls rollback method in migration.","summary":"

Same as #up except calls rollback method in migration.

","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"args_string":"(quiet = false)","args_html":"(quiet = false)","location":{"filename":"src/avram/migrator/migration.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L48"},"def":{"name":"down","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"visibility":"Public","body":"suppress_logging do\n if pending?\n puts(\"Already rolled back #{self.class.name.colorize(:cyan)}\")\n else\n reset_prepared_statements\n rollback\n execute_in_transaction(@prepared_statements) do |tx|\n untrack_migration(tx)\n if quiet\n else\n puts(\"Rolled back #{self.class.name.colorize(:green)}\")\n end\n end\n end\nend"}},{"html_id":"migrate-instance-method","name":"migrate","abstract":true,"location":{"filename":"src/avram/migrator/migration.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L21"},"def":{"name":"migrate","visibility":"Public","body":""}},{"html_id":"migrated?-instance-method","name":"migrated?","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L69"},"def":{"name":"migrated?","visibility":"Public","body":"suppress_logging do\n Avram.settings.database_to_migrate.query_one?(\"SELECT id FROM migrations WHERE version = $1\", version, as: MigrationId)\nend"}},{"html_id":"pending?-instance-method","name":"pending?","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L65"},"def":{"name":"pending?","visibility":"Public","body":"!migrated?"}},{"html_id":"prepared_statements:Array(String)-instance-method","name":"prepared_statements","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L24"},"def":{"name":"prepared_statements","visibility":"Public","body":"@prepared_statements"}},{"html_id":"reset_prepared_statements-instance-method","name":"reset_prepared_statements","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":110,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L110"},"def":{"name":"reset_prepared_statements","visibility":"Public","body":"@prepared_statements = [] of String"}},{"html_id":"up(quiet=false)-instance-method","name":"up","doc":"Unless already migrated, calls migrate which in turn calls statement\nhelpers to generate and collect SQL statements in the\n@prepared_statements array. Each statement is then executed in a\ntransaction and tracked upon completion.","summary":"

Unless already migrated, calls migrate which in turn calls statement helpers to generate and collect SQL statements in the @prepared_statements array.

","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"args_string":"(quiet = false)","args_html":"(quiet = false)","location":{"filename":"src/avram/migrator/migration.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L30"},"def":{"name":"up","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"visibility":"Public","body":"suppress_logging do\n if migrated?\n puts(\"Already migrated #{self.class.name.colorize(:cyan)}\")\n else\n reset_prepared_statements\n migrate\n execute_in_transaction(@prepared_statements) do |tx|\n track_migration(tx)\n if quiet\n else\n puts(\"Migrated #{self.class.name.colorize(:green)}\")\n end\n end\n end\nend"}},{"html_id":"version:Int64-instance-method","name":"version","abstract":true,"location":{"filename":"src/avram/migrator/migration.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L22"},"def":{"name":"version","return_type":"Int64","visibility":"Public","body":""}}],"types":[{"html_id":"avram/Avram/Migrator/Migration/V1/MigrationId","path":"Avram/Migrator/Migration/V1/MigrationId.html","kind":"alias","full_name":"Avram::Migrator::Migration::V1::MigrationId","name":"MigrationId","abstract":false,"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Int32 | Int64)","aliased_html":"Int32 | Int64","const":false,"namespace":{"html_id":"avram/Avram/Migrator/Migration/V1","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1"}}]}]},{"html_id":"avram/Avram/Migrator/MigrationGenerator","path":"Avram/Migrator/MigrationGenerator.html","kind":"class","full_name":"Avram::Migrator::MigrationGenerator","name":"MigrationGenerator","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,migrate_contents:String,rollback_contents:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"migrate_contents","external_name":"migrate_contents","restriction":"String"},{"name":"rollback_contents","external_name":"rollback_contents","restriction":"String"}],"args_string":"(name : String, migrate_contents : String, rollback_contents : String)","args_html":"(name : String, migrate_contents : String, rollback_contents : String)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L17"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"migrate_contents","external_name":"migrate_contents","restriction":"String"},{"name":"rollback_contents","external_name":"rollback_contents","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, migrate_contents, rollback_contents)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"formatted_migrate_contents:String|Nil-instance-method","name":"formatted_migrate_contents","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L32"},"def":{"name":"formatted_migrate_contents","return_type":"String | ::Nil","visibility":"Public","body":"@migrate_contents.try do |contents|\n pad_contents(contents)\nend"}},{"html_id":"formatted_rollback_contents:String|Nil-instance-method","name":"formatted_rollback_contents","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L38"},"def":{"name":"formatted_rollback_contents","return_type":"String | ::Nil","visibility":"Public","body":"@rollback_contents.try do |contents|\n pad_contents(contents)\nend"}},{"html_id":"generate(_version:Nil|String=@_version)-instance-method","name":"generate","abstract":false,"args":[{"name":"_version","default_value":"@_version","external_name":"_version","restriction":"::Nil | ::String"}],"args_string":"(_version : Nil | String = @_version)","args_html":"(_version : Nil | String = @_version)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L20"},"def":{"name":"generate","args":[{"name":"_version","default_value":"@_version","external_name":"_version","restriction":"::Nil | ::String"}],"visibility":"Public","body":"@_version = _version\nensure_camelcase_name\nmake_migrations_folder_if_missing\nensure_unique\nFile.write(file_path, contents)\nio.puts(\"Created #{migration_class_name.colorize(:green)} in .#{relative_file_path.colorize(:green)}\")\n"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L7"},"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"to_s(__io__:IO):Nil-instance-method","name":"to_s","doc":"Appends a short String representation of this object\nwhich includes its class name and its object address.\n\n```\nclass Person\n def initialize(@name : String, @age : Int32)\n end\nend\n\nPerson.new(\"John\", 32).to_s # => #\n```","summary":"

Appends a short String representation of this object which includes its class name and its object address.

","abstract":false,"args":[{"name":"__io__","external_name":"__io__","restriction":"IO"}],"args_string":"(__io__ : IO) : Nil","args_html":"(__io__ : IO) : Nil","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L12"},"def":{"name":"to_s","args":[{"name":"__io__","external_name":"__io__","restriction":"IO"}],"return_type":"Nil","visibility":"Public","body":"ECR.embed(\"/home/runner/work/avram/avram/src/avram/tasks/gen/migration.ecr\", \"__io__\")"}}]},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","path":"Avram/Migrator/MissingOnDeleteWithBelongsToError.html","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError","abstract":false,"locations":[{"filename":"src/avram/migrator/missing_on_delete_with_belongs_to_error.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/missing_on_delete_with_belongs_to_error.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/AlterTableStatement","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement"},{"html_id":"avram/Avram/Migrator/CreateTableStatement","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"macros":[{"html_id":"add_belongs_to(type_declaration,references=nil)-macro","name":"add_belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""}],"args_string":"(type_declaration, references = nil)","args_html":"(type_declaration, references = nil)","location":{"filename":"src/avram/migrator/missing_on_delete_with_belongs_to_error.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/missing_on_delete_with_belongs_to_error.cr#L2"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""}],"visibility":"Public","body":" \n{% raise(\"Must use 'on_delete' with 'add_belongs_to'\\n\\nTry this...\\n\\n ▸ add_belongs_to #{type_declaration}, on_delete: :cascade\\n\\nYou can also use :restrict, :nullify, or :do_nothing\\n\\nRead more at: https://luckyframework.org/guides/database/migrations#associations\\n\\n\") %}\n\n \n"}}]},{"html_id":"avram/Avram/Migrator/Runner","path":"Avram/Migrator/Runner.html","kind":"class","full_name":"Avram::Migrator::Runner","name":"Runner","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/runner.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"MIGRATIONS_TABLE_NAME","name":"MIGRATIONS_TABLE_NAME","value":"\"migrations\""}],"extended_modules":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"class_methods":[{"html_id":"cmd_args-class-method","name":"cmd_args","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L40"},"def":{"name":"cmd_args","visibility":"Public","body":"String.build do |args|\n if self.db_user\n args << \"-U #{self.db_user}\"\n end\n if self.db_host\n args << \" -h #{self.db_host}\"\n end\n if self.db_port\n args << \" -p #{self.db_port}\"\n end\n args << \" #{self.db_name}\"\nend"}},{"html_id":"create_db(quiet?:Bool=false)-class-method","name":"create_db","abstract":false,"args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"args_string":"(quiet? : Bool = false)","args_html":"(quiet? : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L58"},"def":{"name":"create_db","args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"visibility":"Public","body":"begin\n DB.connect(\"#{credentials.connection_string}/#{db_user}\") do |db|\n db.exec(\"CREATE DATABASE #{db_name}\")\n end\n if quiet?\n else\n puts(\"Done creating #{db_name.colorize(:green)}\")\n end\nrescue e : DB::ConnectionRefused\n message = e.message.to_s\n if message.blank?\n raise(ConnectionError.new(URI.parse(credentials.url_without_query_params), Avram.settings.database_to_migrate))\n else\n raise(e)\n end\nrescue e : Exception\n message = e.message.to_s\n if message.includes?(\"\\\"#{self.db_name}\\\" already exists\")\n if quiet?\n else\n puts(\"Already created #{self.db_name.colorize(:green)}\")\n end\n else\n if message.includes?(\"Cannot establish connection\")\n raise(PGNotRunningError.new(message))\n else\n raise(e)\n end\n end\nend"}},{"html_id":"credentials-class-method","name":"credentials","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L36"},"def":{"name":"credentials","visibility":"Public","body":"Avram.settings.database_to_migrate.credentials"}},{"html_id":"db_host-class-method","name":"db_host","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L20"},"def":{"name":"db_host","visibility":"Public","body":"credentials.hostname"}},{"html_id":"db_name-class-method","name":"db_name","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L16"},"def":{"name":"db_name","visibility":"Public","body":"credentials.database"}},{"html_id":"db_password-class-method","name":"db_password","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L32"},"def":{"name":"db_password","visibility":"Public","body":"credentials.password"}},{"html_id":"db_port-class-method","name":"db_port","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L24"},"def":{"name":"db_port","visibility":"Public","body":"credentials.port"}},{"html_id":"db_user-class-method","name":"db_user","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L28"},"def":{"name":"db_user","visibility":"Public","body":"credentials.username"}},{"html_id":"drop_db(quiet?:Bool=false)-class-method","name":"drop_db","abstract":false,"args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"args_string":"(quiet? : Bool = false)","args_html":"(quiet? : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L49"},"def":{"name":"drop_db","args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"visibility":"Public","body":"DB.connect(\"#{credentials.connection_string}/#{db_user}\") do |db|\n db.exec(\"DROP DATABASE IF EXISTS #{db_name}\")\nend\nif quiet?\nelse\n puts(\"Done dropping #{Avram::Migrator::Runner.db_name.colorize(:green)}\")\nend\n"}},{"html_id":"dump_db(dump_to:String=\"db/structure.sql\",quiet:Bool=false)-class-method","name":"dump_db","doc":"Creates a new file at `dump_to` with your database schema,\nand includes the migtation data.","summary":"

Creates a new file at dump_to with your database schema, and includes the migtation data.

","abstract":false,"args":[{"name":"dump_to","default_value":"\"db/structure.sql\"","external_name":"dump_to","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(dump_to : String = \"db/structure.sql\", quiet : Bool = false)","args_html":"(dump_to : String = "db/structure.sql", quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":98,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L98"},"def":{"name":"dump_db","args":[{"name":"dump_to","default_value":"\"db/structure.sql\"","external_name":"dump_to","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"Db::VerifyConnection.new(quiet: true).run_task\nrun(\"pg_dump -s #{cmd_args} > #{dump_to}; pg_dump -t migrations --data-only #{cmd_args} >> #{dump_to}\")\nif quiet\nelse\n puts(\"Done dumping #{db_name.colorize(:green)}\")\nend\n"}},{"html_id":"migrations-class-method","name":"migrations","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L11"},"def":{"name":"migrations","visibility":"Public","body":"@@migrations"}},{"html_id":"restore_db(restore_file:String,quiet:Bool=false)-class-method","name":"restore_db","abstract":false,"args":[{"name":"restore_file","external_name":"restore_file","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(restore_file : String, quiet : Bool = false)","args_html":"(restore_file : String, quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L85"},"def":{"name":"restore_db","args":[{"name":"restore_file","external_name":"restore_file","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"if File.exists?(restore_file)\n run(\"psql -q #{cmd_args} -v ON_ERROR_STOP=1 < #{restore_file}\")\n if quiet\n else\n puts(\"Done restoring #{db_name.colorize(:green)}\")\n end\nelse\n raise(\"Unable to locate the restore file: #{restore_file}\")\nend"}},{"html_id":"run(command:String,output:IO=STDOUT)-class-method","name":"run","abstract":false,"args":[{"name":"command","external_name":"command","restriction":"String"},{"name":"output","default_value":"STDOUT","external_name":"output","restriction":"IO"}],"args_string":"(command : String, output : IO = STDOUT)","args_html":"(command : String, output : IO = STDOUT)","location":{"filename":"src/avram/migrator/runner.cr","line_number":130,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L130"},"def":{"name":"run","args":[{"name":"command","external_name":"command","restriction":"String"},{"name":"output","default_value":"STDOUT","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"error_messages = IO::Memory.new\nif self.db_password\n ENV[\"PGPASSWORD\"] = self.db_password\nend\nresult = Process.run(command, shell: true, output: output, error: error_messages)\nif self.db_password\n ENV.delete(\"PGPASSWORD\")\nend\nif result.success?\nelse\n raise(error_messages.to_s)\nend\n"}},{"html_id":"setup_migration_tracking_tables-class-method","name":"setup_migration_tracking_tables","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L106"},"def":{"name":"setup_migration_tracking_tables","visibility":"Public","body":"suppress_logging do\n db = Avram.settings.database_to_migrate\n db.exec(create_table_for_tracking_migrations)\n db.exec(create_unique_index_for_migrations)\nend"}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L13"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"ensure_migrated!-instance-method","name":"ensure_migrated!","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":184,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L184"},"def":{"name":"ensure_migrated!","visibility":"Public","body":"if !pending_migrations.empty?\n display_migration_error_banner\n Process.signal(:term, Process.ppid)\n exit(1)\nend"}},{"html_id":"rollback_all-instance-method","name":"rollback_all","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":161,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L161"},"def":{"name":"rollback_all","visibility":"Public","body":"self.class.setup_migration_tracking_tables\nmigrated_migrations.reverse.each do |__arg1|\n __arg1.new.down\nend\n"}},{"html_id":"rollback_one-instance-method","name":"rollback_one","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":166,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L166"},"def":{"name":"rollback_one","visibility":"Public","body":"self.class.setup_migration_tracking_tables\nif migrated_migrations.empty?\n puts(\"Did not roll anything back because the database has no migrations.\".colorize(:green))\nelse\n migrated_migrations.last.new.down\nend\n"}},{"html_id":"rollback_to(last_version:Int64)-instance-method","name":"rollback_to","abstract":false,"args":[{"name":"last_version","external_name":"last_version","restriction":"Int64"}],"args_string":"(last_version : Int64)","args_html":"(last_version : Int64)","location":{"filename":"src/avram/migrator/runner.cr","line_number":175,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L175"},"def":{"name":"rollback_to","args":[{"name":"last_version","external_name":"last_version","restriction":"Int64"}],"visibility":"Public","body":"self.class.setup_migration_tracking_tables\nsubset = migrated_migrations.select do |mm|\n mm.new.version > last_version\nend\nsubset.reverse.each do |__arg2|\n __arg2.new.down\nend\nputs(\"Done rolling back to #{last_version}\".colorize(:green))\n"}},{"html_id":"run_next_migration-instance-method","name":"run_next_migration","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L155"},"def":{"name":"run_next_migration","visibility":"Public","body":"prepare_for_migration do\n pending_migrations.first.new.up\nend"}},{"html_id":"run_pending_migrations-instance-method","name":"run_pending_migrations","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":149,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L149"},"def":{"name":"run_pending_migrations","visibility":"Public","body":"prepare_for_migration do\n pending_migrations.each do |__arg0|\n __arg0.new.up(@quiet)\n end\nend"}}]},{"html_id":"avram/Avram/Migrator/StatementHelpers","path":"Avram/Migrator/StatementHelpers.html","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers","abstract":false,"ancestors":[{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"locations":[{"filename":"src/avram/migrator/statement_helpers.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"}],"including_types":[{"html_id":"avram/Avram/Migrator/Migration/V1","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"instance_methods":[{"html_id":"create_foreign_key(from:TableName,to:TableName,on_delete:Symbol,column:Symbol|Nil,primary_key=:id)-instance-method","name":"create_foreign_key","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":""}],"args_string":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil, primary_key = :id)","args_html":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil, primary_key = :id)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L31"},"def":{"name":"create_foreign_key","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":""}],"visibility":"Public","body":"prepared_statements << (CreateForeignKeyStatement.new(from, to, on_delete, column, primary_key)).build"}},{"html_id":"create_function(name:String,body:String,returns:String=\"trigger\")-instance-method","name":"create_function","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"args_string":"(name : String, body : String, returns : String = \"trigger\")","args_html":"(name : String, body : String, returns : String = "trigger")","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L67"},"def":{"name":"create_function","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::CreateFunctionStatement.new(name, body: body, returns: returns)).build"}},{"html_id":"create_index(table_name:TableName,columns:Columns,unique=false,using=:btree,name:String|Nil|Symbol|Nil=nil)-instance-method","name":"create_index","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table_name : TableName, columns : Columns, unique = false, using = :btree, name : String | Nil | Symbol | Nil = nil)","args_html":"(table_name : TableName, columns : Columns, unique = false, using = :btree, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L39"},"def":{"name":"create_index","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (CreateIndexStatement.new(table_name, columns, using, unique, name)).build"}},{"html_id":"create_trigger(table_name:TableName,name:String,function_name:String,callback:Symbol=:before,on:Array(Symbol)=[:update])-instance-method","name":"create_trigger","doc":"Drop any existing trigger by this name first before creating.\nPostgres does not support updating or replacing a trigger as of version 12\n\nCreates a new TRIGGER named `name` on the table `table_name`.\n`function_name` - The PG function to run from this trigger.\n`callback` - When to run this trigger (BEFORE or AFTER). Default `:before`\n`on` - The operation(s) for this trigger (INSERT, UPDATE, DELETE). Default is `[:update]`\n\n```\ncreate_trigger(:users, \"trigger_set_timestamps\", \"set_timestamps\")\n# => CREATE TRIGGER trigger_set_timestamps BEFORE UPDATE ON users FOR EACH ROW EXECUTE PROCEDURE set_timestamps();\n```","summary":"

Drop any existing trigger by this name first before creating.

","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"},{"name":"function_name","external_name":"function_name","restriction":"String"},{"name":"callback","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"on","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"args_string":"(table_name : TableName, name : String, function_name : String, callback : Symbol = :before, on : Array(Symbol) = [:update])","args_html":"(table_name : TableName, name : String, function_name : String, callback : Symbol = :before, on : Array(Symbol) = [:update])","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L87"},"def":{"name":"create_trigger","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"},{"name":"function_name","external_name":"function_name","restriction":"String"},{"name":"callback","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"on","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"visibility":"Public","body":"drop_trigger(table_name, name)\nprepared_statements << (Avram::Migrator::CreateTriggerStatement.new(table_name, name, function_name, callback, on)).build\n"}},{"html_id":"disable_extension(name:String)-instance-method","name":"disable_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L59"},"def":{"name":"disable_extension","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropExtensionStatement.new(name)).build"}},{"html_id":"drop(table_name)-instance-method","name":"drop","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L17"},"def":{"name":"drop","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropTableStatement.new(table_name)).build"}},{"html_id":"drop_foreign_key(from:TableName,references:TableName,column:Symbol|Nil)-instance-method","name":"drop_foreign_key","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"}],"args_string":"(from : TableName, references : TableName, column : Symbol | Nil)","args_html":"(from : TableName, references : TableName, column : Symbol | Nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L35"},"def":{"name":"drop_foreign_key","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (DropForeignKeyStatement.new(from, references, column)).build"}},{"html_id":"drop_function(name:String)-instance-method","name":"drop_function","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L71"},"def":{"name":"drop_function","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropFunctionStatement.new(name)).build"}},{"html_id":"drop_index(table_name:TableName,columns:Columns|Nil=nil,if_exists=false,on_delete=:do_nothing,name:String|Nil|Symbol|Nil=nil)-instance-method","name":"drop_index","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":""},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table_name : TableName, columns : Columns | Nil = nil, if_exists = false, on_delete = :do_nothing, name : String | Nil | Symbol | Nil = nil)","args_html":"(table_name : TableName, columns : Columns | Nil = nil, if_exists = false, on_delete = :do_nothing, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L43"},"def":{"name":"drop_index","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":""},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropIndexStatement.new(table_name, columns, if_exists, on_delete, name)).build"}},{"html_id":"drop_trigger(table_name:TableName,name:String)-instance-method","name":"drop_trigger","doc":"Drop the tigger `name` for the table `table_name`","summary":"

Drop the tigger name for the table table_name

","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(table_name : TableName, name : String)","args_html":"(table_name : TableName, name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":93,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L93"},"def":{"name":"drop_trigger","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropTriggerStatement.new(table_name, name)).build"}},{"html_id":"enable_extension(name:String)-instance-method","name":"enable_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L55"},"def":{"name":"enable_extension","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::CreateExtensionStatement.new(name)).build"}},{"html_id":"make_optional(table:TableName,column:Symbol)-instance-method","name":"make_optional","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(table : TableName, column : Symbol)","args_html":"(table : TableName, column : Symbol)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L51"},"def":{"name":"make_optional","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::ChangeNullStatement.new(table, column, required: false)).build"}},{"html_id":"make_required(table:TableName,column:Symbol)-instance-method","name":"make_required","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(table : TableName, column : Symbol)","args_html":"(table : TableName, column : Symbol)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L47"},"def":{"name":"make_required","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::ChangeNullStatement.new(table, column, required: true)).build"}},{"html_id":"update_extension(name:String,to:String|Nil=nil)-instance-method","name":"update_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"args_string":"(name : String, to : String | Nil = nil)","args_html":"(name : String, to : String | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L63"},"def":{"name":"update_extension","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::AlterExtensionStatement.new(name, to: to)).build"}}],"macros":[{"html_id":"alter(table_name)-macro","name":"alter","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L21"},"def":{"name":"alter","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":" statements = Avram::Migrator::AlterTableStatement.new(\n{{ table_name }}\n).build do\n \n{{ yield }}\n\n \nend.statements\n\n statements.each do |statement|\n prepared_statements << statement\n \nend\n \n"}},{"html_id":"create(table_name)-macro","name":"create","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L7"},"def":{"name":"create","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":" statements = Avram::Migrator::CreateTableStatement.new(\n{{ table_name }}\n).build do\n \n{{ yield }}\n\n \nend.statements\n\n statements.each do |statement|\n prepared_statements << statement\n \nend\n \n"}}]}]},{"html_id":"avram/Avram/MissingRequiredAssociationError","path":"Avram/MissingRequiredAssociationError.html","kind":"class","full_name":"Avram::MissingRequiredAssociationError","name":"MissingRequiredAssociationError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(model:Avram::Model.class,association:Avram::Model.class)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"Avram::Model.class"},{"name":"association","external_name":"association","restriction":"Avram::Model.class"}],"args_string":"(model : Avram::Model.class, association : Avram::Model.class)","args_html":"(model : Avram::Model.class, association : Avram::Model.class)","location":{"filename":"src/avram/errors.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L44"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"Avram::Model.class"},{"name":"association","external_name":"association","restriction":"Avram::Model.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, association)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"association:Avram::Model.class-instance-method","name":"association","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L42"},"def":{"name":"association","return_type":"Avram::Model.class","visibility":"Public","body":"@association"}},{"html_id":"model:Avram::Model.class-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L41"},"def":{"name":"model","return_type":"Avram::Model.class","visibility":"Public","body":"@model"}}]},{"html_id":"avram/Avram/Model","path":"Avram/Model.html","kind":"class","full_name":"Avram::Model","name":"Model","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},{"html_id":"avram/Avram/Polymorphic","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic"},{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/model.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},{"html_id":"avram/Avram/Polymorphic","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic"},{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"database_table_info:Avram::Database::TableInfo|Nil-class-method","name":"database_table_info","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L28"},"def":{"name":"database_table_info","return_type":"Avram::Database::TableInfo | ::Nil","visibility":"Public","body":"database.database_info.table(table_name.to_s)"}},{"html_id":"primary_key_name:Symbol|Nil-class-method","name":"primary_key_name","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L24"},"def":{"name":"primary_key_name","return_type":"Symbol | ::Nil","visibility":"Public","body":"nil"}}],"instance_methods":[{"html_id":"delete-instance-method","name":"delete","doc":"Refer to `PrimaryKeyMethods#delete`","summary":"

Refer to PrimaryKeyMethods#delete

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L52"},"def":{"name":"delete","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#delete on #{@type.name} because it does not have a primary key. Add a primary key or define your own `delete` method.\") %}"}},{"html_id":"model_name:String-instance-method","name":"model_name","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L32"},"def":{"name":"model_name","return_type":"String","visibility":"Public","body":"self.class.name"}},{"html_id":"reload:self-instance-method","name":"reload","doc":"Refer to `PrimaryKeyMethods#reload`","summary":"

Refer to PrimaryKeyMethods#reload

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L37"},"def":{"name":"reload","return_type":"self","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#reload on #{@type.name} because it does not have a primary key. Add a primary key or define your own `reload` method.\") %}"}},{"html_id":"reload(&):self-instance-method","name":"reload","doc":"Refer to `PrimaryKeyMethods#reload`","summary":"

Refer to PrimaryKeyMethods#reload

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L42"},"def":{"name":"reload","yields":0,"block_arity":0,"return_type":"self","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#reload on #{@type.name} because it does not have a primary key. Add a primary key or define your own `reload` method.\") %}"}},{"html_id":"to_param:String-instance-method","name":"to_param","doc":"Refer to `PrimaryKeyMethods#to_param`","summary":"

Refer to PrimaryKeyMethods#to_param

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L47"},"def":{"name":"to_param","return_type":"String","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#to_param on #{@type.name} because it does not have a primary key. Add a primary key or define your own `to_param` method.\") %}"}}],"macros":[{"html_id":"association(assoc_name,type,relationship_type,foreign_key=nil,through=nil)-macro","name":"association","abstract":false,"args":[{"name":"assoc_name","external_name":"assoc_name","restriction":""},{"name":"type","external_name":"type","restriction":""},{"name":"relationship_type","external_name":"relationship_type","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""}],"args_string":"(assoc_name, type, relationship_type, foreign_key = nil, through = nil)","args_html":"(assoc_name, type, relationship_type, foreign_key = nil, through = nil)","location":{"filename":"src/avram/model.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L281"},"def":{"name":"association","args":[{"name":"assoc_name","external_name":"assoc_name","restriction":""},{"name":"type","external_name":"type","restriction":""},{"name":"relationship_type","external_name":"relationship_type","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""}],"visibility":"Public","body":" \n{% ASSOCIATIONS << {type: type, assoc_name: assoc_name.id, foreign_key: foreign_key, relationship_type: relationship_type, through: through} %}\n\n \n"}},{"html_id":"column(type_declaration,autogenerated=false,serializeis_serialized=false,allow_blank=false)-macro","name":"column","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"autogenerated","default_value":"false","external_name":"autogenerated","restriction":""},{"name":"is_serialized","default_value":"false","external_name":"serialize","restriction":""},{"name":"allow_blank","default_value":"false","external_name":"allow_blank","restriction":""}],"args_string":"(type_declaration, autogenerated = false, serialize is_serialized = false, allow_blank = false)","args_html":"(type_declaration, autogenerated = false, serialize is_serialized = false, allow_blank = false)","location":{"filename":"src/avram/model.cr","line_number":246,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L246"},"def":{"name":"column","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"autogenerated","default_value":"false","external_name":"autogenerated","restriction":""},{"name":"is_serialized","default_value":"false","external_name":"serialize","restriction":""},{"name":"allow_blank","default_value":"false","external_name":"allow_blank","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.type.is_a?(Union) %}\n {% data_type = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% data_type = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n \n{% if type_declaration.value || (type_declaration.value == false) %}\n {% value = type_declaration.value %}\n {% else %}\n {% value = nil %}\n {% end %}\n\n\n \n{% COLUMNS << {name: type_declaration.var, type: data_type, nilable: nilable.id, autogenerated: autogenerated, value: value, serialized: is_serialized, allow_blank: allow_blank} %}\n\n \n"}},{"html_id":"default_columns-macro","name":"default_columns","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L137"},"def":{"name":"default_columns","visibility":"Public","body":" primary_key id : Int64\n timestamps\n "}},{"html_id":"primary_key(type_declaration)-macro","name":"primary_key","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/model.cr","line_number":100,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L100"},"def":{"name":"primary_key","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" PRIMARY_KEY_TYPE = \n{{ type_declaration.type }}\n\n PRIMARY_KEY_NAME = \n{{ type_declaration.var.symbolize }}\n\n column \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n, autogenerated: true\n alias PrimaryKeyType = \n{{ type_declaration.type }}\n\n\n def self.primary_key_name : Symbol?\n :\n{{ type_declaration.var.stringify }}\n\n \nend\n\n include Avram::PrimaryKeyMethods\n\n \n# If not using default 'id' primary key\n\n \n{% if type_declaration.var.id != \"id\".id %}\n # Then point 'id' to the primary key\n def id\n {{ type_declaration.var.id }}\n end\n {% end %}\n\n \n"}},{"html_id":"setup(step)-macro","name":"setup","abstract":false,"args":[{"name":"step","external_name":"step","restriction":""}],"args_string":"(step)","args_html":"(step)","location":{"filename":"src/avram/model.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L152"},"def":{"name":"setup","args":[{"name":"step","external_name":"step","restriction":""}],"visibility":"Public","body":" \n{{ step.id }}\n(\n type: \n{{ @type }}\n,\n columns: \n{{ COLUMNS }}\n,\n associations: \n{{ ASSOCIATIONS }}\n\n )\n \n"}},{"html_id":"setup_association_queries(associations,*args,**named_args)-macro","name":"setup_association_queries","abstract":false,"args":[{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(associations, *args, **named_args)","args_html":"(associations, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":209,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L209"},"def":{"name":"setup_association_queries","args":[{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% for assoc in associations %}\n def {{ assoc[:assoc_name] }}_query\n {% if assoc[:relationship_type] == (:has_many) %}\n {{ assoc[:type] }}::BaseQuery.new.{{ assoc[:foreign_key].id }}(id)\n {% else %}{% if assoc[:relationship_type] == (:belongs_to) %}\n {{ assoc[:type] }}::BaseQuery.new.id({{ assoc[:foreign_key].id }})\n {% else %}\n {{ assoc[:type] }}::BaseQuery.new\n {% end %}{% end %}\n end\n {% end %}\n\n \n"}},{"html_id":"setup_column_info_methods(columns,*args,**named_args)-macro","name":"setup_column_info_methods","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L263"},"def":{"name":"setup_column_info_methods","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" def self.column_names : Array(Symbol)\n columns.map \n{ |column| column[:name] }\n \nend\n\n def self.columns : Array(\n{name: Symbol, nilable: Bool, type: String})\n [\n \n{% for column in columns %}\n {\n name: {{ column[:name].id.symbolize }},\n nilable: {{ column[:nilable] }},\n type: {{ column[:type].id }}.name\n },\n {% end %}\n\n ]\n \nend\n \n"}},{"html_id":"setup_db_mapping(columns,*args,**named_args)-macro","name":"setup_db_mapping","doc":"Setup [database mapping](http://crystal-lang.github.io/crystal-db/api/latest/DB.html) for the model's columns.\n\nNOTE: Avram::Migrator saves `Float` columns as numeric which are converted\nin the avram/charms/float64_extensions.cr file","summary":"

Setup database mapping for the model's columns.

","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":189,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L189"},"def":{"name":"setup_db_mapping","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" DB.mapping(\n{\n \n{% for column in columns %}\n {{ column[:name] }}: {\n {% if column[:type].id == Array(Float64).id %}\n type: Array(PG::Numeric),\n {% else %}{% if column[:type].is_a?(Generic) || column[:serialized] %}\n type: {{ column[:type] }},\n {% else %}\n type: {{ column[:type] }}::Lucky::ColumnType,\n {% end %}{% end %}\n nilable: {{ column[:nilable] }},\n {% if column[:serialized] %}\n converter: JSONConverter({{ column[:type] }}),\n {% end %}\n },\n {% end %}\n\n })\n \n"}},{"html_id":"setup_getters(columns,*args,**named_args)-macro","name":"setup_getters","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":233,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L233"},"def":{"name":"setup_getters","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% for column in columns %}\n def {{ column[:name] }} : {{ column[:type] }}{{ (column[:nilable] ? \"?\" : \"\").id }}\n {{ column[:type] }}.adapter.from_db!(@{{ column[:name] }})\n end\n {% if column[:type].id == Bool.id %}\n def {{ column[:name] }}? : Bool\n !!{{ column[:name] }}\n end\n {% end %}\n {% end %}\n\n \n"}},{"html_id":"setup_initialize(columns,*args,**named_args)-macro","name":"setup_initialize","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":176,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L176"},"def":{"name":"setup_initialize","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" def initialize(\n \n{% for column in columns %}\n @{{ column[:name] }},\n {% end %}\n\n )\n \nend\n \n"}},{"html_id":"setup_table_schema_enforcer_validations(type,*args,**named_args)-macro","name":"setup_table_schema_enforcer_validations","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":223,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L223"},"def":{"name":"setup_table_schema_enforcer_validations","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" schema_enforcer_validations << EnsureExistingTable.new(model_class: \n{{ type.id }}\n)\n schema_enforcer_validations << EnsureMatchingColumns.new(model_class: \n{{ type.id }}\n)\n \n"}},{"html_id":"setup_view_schema_enforcer_validations(type,*args,**named_args)-macro","name":"setup_view_schema_enforcer_validations","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":228,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L228"},"def":{"name":"setup_view_schema_enforcer_validations","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" schema_enforcer_validations << EnsureExistingTable.new(model_class: \n{{ type.id }}\n)\n schema_enforcer_validations << EnsureMatchingColumns.new(model_class: \n{{ type.id }}\n, check_required: false)\n \n"}},{"html_id":"skip_default_columns-macro","name":"skip_default_columns","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L142"},"def":{"name":"skip_default_columns","visibility":"Public","body":" macro default_columns\n \nend\n \n"}},{"html_id":"table(table_name=nil)-macro","name":"table","abstract":false,"args":[{"name":"table_name","default_value":"nil","external_name":"table_name","restriction":""}],"args_string":"(table_name = nil)","args_html":"(table_name = nil)","location":{"filename":"src/avram/model.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L56"},"def":{"name":"table","args":[{"name":"table_name","default_value":"nil","external_name":"table_name","restriction":""}],"visibility":"Public","body":" default_columns\n\n \n{{ yield }}\n\n\n validate_columns(\"table\")\n validate_primary_key\n\n \n{% if table_name %}\n class_getter table_name : String = {{ table_name.id.stringify }}\n {% else %}\n class_getter table_name : String = Avram::TableFor.table_for({{ @type.id }})\n {% end %}\n\n setup(Avram::Model.setup_initialize)\n setup(Avram::Model.setup_db_mapping)\n setup(Avram::Model.setup_getters)\n setup(Avram::Model.setup_column_info_methods)\n setup(Avram::Model.setup_association_queries)\n setup(Avram::Model.setup_table_schema_enforcer_validations)\n setup(Avram::BaseQueryTemplate.setup)\n setup(Avram::SaveOperationTemplate.setup)\n setup(Avram::DeleteOperationTemplate.setup)\n setup(Avram::SchemaEnforcer.setup)\n \n"}},{"html_id":"timestamps-macro","name":"timestamps","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L147"},"def":{"name":"timestamps","visibility":"Public","body":" column created_at : Time, autogenerated: true\n column updated_at : Time, autogenerated: true\n "}},{"html_id":"validate_columns(model_type)-macro","name":"validate_columns","abstract":false,"args":[{"name":"model_type","external_name":"model_type","restriction":""}],"args_string":"(model_type)","args_html":"(model_type)","location":{"filename":"src/avram/model.cr","line_number":160,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L160"},"def":{"name":"validate_columns","args":[{"name":"model_type","external_name":"model_type","restriction":""}],"visibility":"Public","body":" \n{% if COLUMNS.empty? %}\n {% raise(\"#{@type} must define at least one column.\\n\\nExample:\\n\\n #{model_type.id} do\\n primary_key id : Int64\\n ...\\n end\") %}\n {% end %}\n\n \n"}},{"html_id":"validate_primary_key-macro","name":"validate_primary_key","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":121,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L121"},"def":{"name":"validate_primary_key","visibility":"Public","body":" \n{% if !(@type.has_constant?(\"PRIMARY_KEY_TYPE\")) %}\n \\{% raise <<-ERROR\n No primary key was specified.\n\n Example:\n\n table do\n primary_key id : Int64\n ...\n end\n ERROR\n %}\n {% end %}\n\n \n"}},{"html_id":"view(view_name=nil)-macro","name":"view","abstract":false,"args":[{"name":"view_name","default_value":"nil","external_name":"view_name","restriction":""}],"args_string":"(view_name = nil)","args_html":"(view_name = nil)","location":{"filename":"src/avram/model.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L81"},"def":{"name":"view","args":[{"name":"view_name","default_value":"nil","external_name":"view_name","restriction":""}],"visibility":"Public","body":" \n{{ yield }}\n\n\n validate_columns(\"view\")\n \n{% if view_name %}\n class_getter table_name : String = {{ view_name.id.stringify }}\n {% else %}\n class_getter table_name : String = Avram::TableFor.table_for({{ @type.id }})\n {% end %}\n\n setup(Avram::Model.setup_initialize)\n setup(Avram::Model.setup_db_mapping)\n setup(Avram::Model.setup_getters)\n setup(Avram::Model.setup_column_info_methods)\n setup(Avram::Model.setup_association_queries)\n setup(Avram::Model.setup_view_schema_enforcer_validations)\n setup(Avram::BaseQueryTemplate.setup)\n setup(Avram::SchemaEnforcer.setup)\n \n"}}],"types":[{"html_id":"avram/Avram/Model/JSONConverter","path":"Avram/Model/JSONConverter.html","kind":"module","full_name":"Avram::Model::JSONConverter(T)","name":"JSONConverter","abstract":false,"locations":[{"filename":"src/avram/model.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L11"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"},"class_methods":[{"html_id":"from_rs(rs:DB::ResultSet)-class-method","name":"from_rs","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/model.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L12"},"def":{"name":"from_rs","args":[{"name":"rs","external_name":"rs","restriction":"DB::ResultSet"}],"visibility":"Public","body":"value = rs.read(::Union(JSON::PullParser, ::Nil))\nif value\n T.new(value)\nend\n"}}]}]},{"html_id":"avram/Avram/NeedyInitializer","path":"Avram/NeedyInitializer.html","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer","abstract":false,"locations":[{"filename":"src/avram/needy_initializer.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L68"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializers-macro","name":"generate_initializers","abstract":false,"location":{"filename":"src/avram/needy_initializer.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L37"},"def":{"name":"generate_initializers","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L15"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# This is called at the end so @type will be of the subclass,\n\n \n# and not the parent abstract class.\n\n generate_initializers\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n property \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n \n"}}]},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","path":"Avram/NeedyInitializerAndDeleteMethods.html","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods","abstract":false,"locations":[{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_delete(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_delete","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":94,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L94"},"def":{"name":"generate_delete","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.delete\n{% if with_bang %}!{% end %}\n(\n record : T,\n params : Hash,\n **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:delete\n{% if with_bang %}!{% end %}\n, additional_args: \"record, \")\n \nend\n\n def self.delete\n{% if with_bang %}!{% end %}\n(\n record : T,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n record,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.delete!\n {% else %}\n operation.delete\n yield operation, operation.record\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_delete_methods(attribute_method_args,attribute_params)-macro","name":"generate_delete_methods","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L133"},"def":{"name":"generate_delete_methods","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n \n"}},{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L140"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @record : T,\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @record : T,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \nextract_changes_from_params\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n unless {{ attribute[:name] }}.is_a? Avram::Nothing\n self.{{ attribute[:name] }}.value = {{ attribute[:name] }}\n end\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer_and_delete_methods-macro","name":"generate_initializer_and_delete_methods","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L37"},"def":{"name":"generate_initializer_and_delete_methods","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# These method arguments can be used in macros for generating delete/new\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute[:name]} : #{attribute[:type]} | Avram::Nothing\" %}\n {% if attribute[:nilable] %}{% attribute_method_args = attribute_method_args + \" | Nil\" %}{% end %}\n {% attribute_method_args = attribute_method_args + \" = Avram::Nothing.new,\\n\" %}\n\n {% attribute_params = attribute_params + \"#{attribute[:name]}: #{attribute[:name]},\\n\" %}\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n generate_delete_methods(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"hash_is_not_allowed_helpful_error(method,additional_args=nil)-macro","name":"hash_is_not_allowed_helpful_error","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"args_string":"(method, additional_args = nil)","args_html":"(method, additional_args = nil)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L81"},"def":{"name":"hash_is_not_allowed_helpful_error","args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"visibility":"Public","body":" \n{% raise(\"You can't pass a Hash directly to #{method.id}. Instead pass named arguments, or convert the hash to params.\\n\\nTry this...\\n\\n * Use named arguments (recommended) - #{@type}.#{method.id}(#{if additional_args\n additional_args.id\nend}title: \\\"My Title\\\")\\n * Convert hash to params (not as safe) - Avram::Params.new({\\\"title\\\" => \\\"My Title\\\"})\\n\") %}\n\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L15"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# This is called at the end so @type will be of the subclass,\n\n \n# and not the parent abstract class.\n\n generate_initializer_and_delete_methods\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n property \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n \n"}}]},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","path":"Avram/NeedyInitializerAndSaveMethods.html","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods","abstract":false,"locations":[{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_create(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_create","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":96,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L96"},"def":{"name":"generate_create","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.create\n{% if with_bang %}!{% end %}\n(\n params : Hash, **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:create\n{% if with_bang %}!{% end %}\n)\n \nend\n\n def self.create\n{% if with_bang %}!{% end %}\n(\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.save!\n {% else %}\n if operation.save\n yield operation, operation.record\n else\n yield operation, nil\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":185,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L185"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @record : T,\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @record = nil\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @record : T,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @record = nil\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \nextract_changes_from_params\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n unless {{ attribute[:name] }}.is_a? Avram::Nothing\n self.{{ attribute[:name] }}.value = {{ attribute[:name] }}\n end\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer_and_save_methods-macro","name":"generate_initializer_and_save_methods","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L39"},"def":{"name":"generate_initializer_and_save_methods","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# These method arguments can be used in macros fro generating create/update/new\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute[:name]} : #{attribute[:type]} | Avram::Nothing\" %}\n {% if attribute[:nilable] %}{% attribute_method_args = attribute_method_args + \" | Nil\" %}{% end %}\n {% attribute_method_args = attribute_method_args + \" = Avram::Nothing.new,\\n\" %}\n\n {% attribute_params = attribute_params + \"#{attribute[:name]}: #{attribute[:name]},\\n\" %}\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n generate_save_methods(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"generate_save_methods(attribute_method_args,attribute_params)-macro","name":"generate_save_methods","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":173,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L173"},"def":{"name":"generate_save_methods","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n \n"}},{"html_id":"generate_update(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_update","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":134,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L134"},"def":{"name":"generate_update","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.update\n{% if with_bang %}!{% end %}\n(\n record : T,\n params : Hash,\n **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:update\n{% if with_bang %}!{% end %}\n, additional_args: \"record, \")\n \nend\n\n def self.update\n{% if with_bang %}!{% end %}\n(\n record : T,\n \n{% if with_params %}with params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n record,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.update!\n {% else %}\n operation.save\n yield operation, operation.record.not_nil!\n {% end %}\n\n \nend\n \n"}},{"html_id":"hash_is_not_allowed_helpful_error(method,additional_args=nil)-macro","name":"hash_is_not_allowed_helpful_error","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"args_string":"(method, additional_args = nil)","args_html":"(method, additional_args = nil)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":83,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L83"},"def":{"name":"hash_is_not_allowed_helpful_error","args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"visibility":"Public","body":" \n{% raise(\"You can't pass a Hash directly to #{method.id}. Instead pass named arguments, or convert the hash to params.\\n\\nTry this...\\n\\n * Use named arguments (recommended) - #{@type}.#{method.id}(#{if additional_args\n additional_args.id\nend}title: \\\"My Title\\\")\\n * Convert hash to params (not as safe) - Avram::Params.new({\\\"title\\\" => [\\\"My Title\\\"]})\\n\") %}\n\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L16"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# @type is not correct in this method, but is in the macro we call below\n\n \n# That is why this extrac macro was extracted. We need @type to get the\n\n \n# attributes for this SaveOperation\n\n generate_initializer_and_save_methods\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n @\n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n property \n{{ type_declaration.var }}\n\n \n"}}]},{"html_id":"avram/Avram/NestedSaveOperation","path":"Avram/NestedSaveOperation.html","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation","abstract":false,"locations":[{"filename":"src/avram/nested_save_operation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nested_save_operation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"mark_nested_save_operations_as_failed-instance-method","name":"mark_nested_save_operations_as_failed","abstract":false,"location":{"filename":"src/avram/nested_save_operation.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nested_save_operation.cr#L49"},"def":{"name":"mark_nested_save_operations_as_failed","visibility":"Public","body":"nested_save_operations.each do |operation|\n (operation.as(Avram::MarkAsFailed)).mark_as_failed\nend"}},{"html_id":"nested_save_operations-instance-method","name":"nested_save_operations","abstract":false,"location":{"filename":"src/avram/nested_save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nested_save_operation.cr#L55"},"def":{"name":"nested_save_operations","visibility":"Public","body":"[] of Avram::MarkAsFailed"}}],"macros":[{"html_id":"has_one(type_declaration)-macro","name":"has_one","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/nested_save_operation.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nested_save_operation.cr#L2"},"def":{"name":"has_one","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% name = type_declaration.var %}\n\n \n{% type = type_declaration.type.resolve %}\n\n\n \n{% model_type = type.ancestors.find do |t|\n t.stringify.starts_with?(\"Avram::SaveOperation(\")\nend.type_vars.first %}\n\n\n \n{% assoc = (T.constant(:ASSOCIATIONS)).find do |assoc|\n (assoc[:relationship_type] == (:has_one)) && (assoc[:type].resolve.name == model_type.name)\nend %}\n\n\n \n{% if assoc %}{% else %}\n {% raise(\"#{T} must have a has_one association with #{model_type}\") %}\n {% end %}\n\n\n @_\n{{ name }}\n : \n{{ type }}\n | Nil\n\n after_save save_\n{{ name }}\n\n\n def save_\n{{ name }}\n(saved_record)\n \n{{ name }}\n.\n{{ (@type.constant(:FOREIGN_KEY)).id }}\n.value = saved_record.id\n\n unless \n{{ name }}\n.save\n add_error(:\n{{ name }}\n, \"failed\")\n mark_nested_save_operations_as_failed\n database.rollback\n \nend\n \nend\n\n def \n{{ name }}\n\n @_\n{{ name }}\n ||= if new_record?\n \n{{ type }}\n.new(params)\n \nelse\n \n{{ type }}\n.new(record.not_nil!.\n{{ assoc[:assoc_name].id }}\n!, params)\n \nend\n \nend\n\n def nested_save_operations\n \n{% if @type.methods.map(&.name).includes?((:nested_save_operations).id) %}\n previous_def +\n {% end %}\n\n [\n{{ name }}\n]\n \nend\n \n"}}]},{"html_id":"avram/Avram/Nothing","path":"Avram/Nothing.html","kind":"class","full_name":"Avram::Nothing","name":"Nothing","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/nothing.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nothing.cr#L5"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"This class is used in various places\nwhere the question of \"Did I not pass in anything or did I pass in nil?\"\nneeds to be answered.\n:nodoc:","summary":"

This class is used in various places where the question of "Did I not pass in anything or did I pass in nil?" needs to be answered.

"},{"html_id":"avram/Avram/Operation","path":"Avram/Operation.html","kind":"class","full_name":"Avram::Operation","name":"Operation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializer","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/operation.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializer","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L104"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"name.underscore"}},{"html_id":"run(params:Avram::Paramable,*args,**named_args,&)-class-method","name":"run","doc":"Yields the instance of the operation, and the return value from\nthe `run` instance method.\n\n```\nMyOperation.run(params) do |operation, value|\n # operation is complete\nend\n```","summary":"

Yields the instance of the operation, and the return value from the #run instance method.

","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"args_string":"(params : Avram::Paramable, *args, **named_args, &)","args_html":"(params : Avram::Paramable, *args, **named_args, &)","location":{"filename":"src/avram/operation.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L52"},"def":{"name":"run","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":2,"block_arity":2,"visibility":"Public","body":"operation = self.new(params, *args, **named_args)\nvalue = nil\noperation.before_run\nif operation.valid?\n value = operation.run\n operation.after_run(value)\nend\nyield operation, value\n"}},{"html_id":"run(*args,**named_args,&)-class-method","name":"run","doc":"Yields the instance of the operation, and the return value from\nthe `run` instance method.\n\n```\nMyOperation.run do |operation, value|\n # operation is complete\nend\n```","summary":"

Yields the instance of the operation, and the return value from the #run instance method.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args, &)","args_html":"(*args, **named_args, &)","location":{"filename":"src/avram/operation.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L26"},"def":{"name":"run","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"yields":2,"block_arity":2,"visibility":"Public","body":"params = Avram::Params.new\nrun(params, *args, **named_args) do |operation, value|\n yield operation, value\nend\n"}},{"html_id":"run!(params:Avram::Paramable,*args,**named_args)-class-method","name":"run!","doc":"Returns the value from the `run` instance method.\nor raise `Avram::FailedOperation` if the operation fails.\n\n```\nvalue = MyOperation.run!(params)\n```","summary":"

Returns the value from the #run instance method.

","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"args_string":"(params : Avram::Paramable, *args, **named_args)","args_html":"(params : Avram::Paramable, *args, **named_args)","location":{"filename":"src/avram/operation.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L72"},"def":{"name":"run!","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"run(params, *args, **named_args) do |_operation, value|\n if value\n else\n raise(Avram::FailedOperation.new(\"The operation failed to return a value\"))\n end\n value\nend"}},{"html_id":"run!(*args,**named_args)-class-method","name":"run!","doc":"Returns the value from the `run` instance method.\nor raise `Avram::FailedOperation` if the operation fails.\n\n```\nvalue = MyOperation.run!\n```","summary":"

Returns the value from the #run instance method.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/operation.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L39"},"def":{"name":"run!","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"params = Avram::Params.new\nrun!(params, *args, **named_args)\n"}}],"constructors":[{"html_id":"new(params:Avram::Paramable)-class-method","name":"new","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/operation.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L87"},"def":{"name":"new","args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"visibility":"Public","body":"_ = allocate\n_.initialize(params)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L90"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"after_run(_value)-instance-method","name":"after_run","abstract":false,"args":[{"name":"_value","external_name":"_value","restriction":""}],"args_string":"(_value)","args_html":"(_value)","location":{"filename":"src/avram/operation.cr","line_number":84,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L84"},"def":{"name":"after_run","args":[{"name":"_value","external_name":"_value","restriction":""}],"visibility":"Public","body":""}},{"html_id":"before_run-instance-method","name":"before_run","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L79"},"def":{"name":"before_run","visibility":"Public","body":""}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"params:Avram::Paramable-instance-method","name":"params","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L16"},"def":{"name":"params","return_type":"Avram::Paramable","visibility":"Public","body":"@params"}},{"html_id":"run-instance-method","name":"run","abstract":true,"location":{"filename":"src/avram/operation.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L82"},"def":{"name":"run","visibility":"Public","body":""}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":99,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L99"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/OperationErrors","path":"Avram/OperationErrors.html","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors","abstract":false,"locations":[{"filename":"src/avram/operation_errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation_errors.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"add_error(key:Symbol,message:String):Nil-instance-method","name":"add_error","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"Symbol"},{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(key : Symbol, message : String) : Nil","args_html":"(key : Symbol, message : String) : Nil","location":{"filename":"src/avram/operation_errors.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation_errors.cr#L19"},"def":{"name":"add_error","args":[{"name":"key","external_name":"key","restriction":"Symbol"},{"name":"message","external_name":"message","restriction":"String"}],"return_type":"Nil","visibility":"Public","body":"__temp_89 = key\n@custom_errors[__temp_89]? || (@custom_errors[__temp_89] = [] of String)\n@custom_errors[key].push(message)\n"}},{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/operation_errors.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation_errors.cr#L6"},"def":{"name":"errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"attr_errors = attributes.reduce({} of Symbol => Array(String)) do |errors_hash, attribute|\n if attribute.errors.empty?\n errors_hash\n else\n errors_hash[attribute.name] = attribute.errors\n errors_hash\n end\nend\nattr_errors.merge(@custom_errors)\n"}}]},{"html_id":"avram/Avram/OrderBy","path":"Avram/OrderBy.html","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy","abstract":false,"superclass":{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},"ancestors":[{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(column:String|Symbol,direction:Direction,nulls:NullSorting=:default)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"String | Symbol"},{"name":"direction","external_name":"direction","restriction":"Direction"},{"name":"nulls","default_value":":default","external_name":"nulls","restriction":"NullSorting"}],"args_string":"(column : String | Symbol, direction : Direction, nulls : NullSorting = :default)","args_html":"(column : String | Symbol, direction : Direction, nulls : NullSorting = :default)","location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L24"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":"String | Symbol"},{"name":"direction","external_name":"direction","restriction":"Direction"},{"name":"nulls","default_value":":default","external_name":"nulls","restriction":"NullSorting"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column, direction, nulls)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L18"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L20"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":"@column"}},{"html_id":"direction:Avram::OrderBy::Direction-instance-method","name":"direction","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L21"},"def":{"name":"direction","visibility":"Public","body":"@direction"}},{"html_id":"nulls:Avram::OrderBy::NullSorting-instance-method","name":"nulls","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L22"},"def":{"name":"nulls","visibility":"Public","body":"@nulls"}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L31"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":"String.build do |str|\n str << \"#{column} #{direction}\"\n if nulls.default?\n else\n str << \" #{nulls}\"\n end\nend"}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L38"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":"@direction = @direction.asc? ? Direction::DESC : Direction::ASC\nself\n"}}],"types":[{"html_id":"avram/Avram/OrderBy/Direction","path":"Avram/OrderBy/Direction.html","kind":"enum","full_name":"Avram::OrderBy::Direction","name":"Direction","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L13"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"ASC","name":"ASC","value":"0"},{"id":"DESC","name":"DESC","value":"1"}],"namespace":{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},"instance_methods":[{"html_id":"asc?-instance-method","name":"asc?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L14"},"def":{"name":"asc?","visibility":"Public","body":"self == ASC"}},{"html_id":"desc?-instance-method","name":"desc?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L15"},"def":{"name":"desc?","visibility":"Public","body":"self == DESC"}}]},{"html_id":"avram/Avram/OrderBy/NullSorting","path":"Avram/OrderBy/NullSorting.html","kind":"enum","full_name":"Avram::OrderBy::NullSorting","name":"NullSorting","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L3"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"DEFAULT","name":"DEFAULT","value":"0"},{"id":"NULLS_FIRST","name":"NULLS_FIRST","value":"1"},{"id":"NULLS_LAST","name":"NULLS_LAST","value":"2"}],"namespace":{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},"instance_methods":[{"html_id":"default?-instance-method","name":"default?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L4"},"def":{"name":"default?","visibility":"Public","body":"self == DEFAULT"}},{"html_id":"nulls_first?-instance-method","name":"nulls_first?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L5"},"def":{"name":"nulls_first?","visibility":"Public","body":"self == NULLS_FIRST"}},{"html_id":"nulls_last?-instance-method","name":"nulls_last?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L6"},"def":{"name":"nulls_last?","visibility":"Public","body":"self == NULLS_LAST"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"Returns a `String` representation of this enum member.\nIn the case of regular enums, this is just the name of the member.\nIn the case of flag enums, it's the names joined by vertical bars, or \"None\",\nif the value is zero.\n\nIf an enum's value doesn't match a member's value, the raw value\nis returned as a string.\n\n```\nColor::Red.to_s # => \"Red\"\nIOMode::None.to_s # => \"None\"\n(IOMode::Read | IOMode::Write).to_s # => \"Read | Write\"\n\nColor.new(10).to_s # => \"10\"\n```","summary":"

Returns a String representation of this enum member.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L8"},"def":{"name":"to_s","visibility":"Public","body":"super().gsub(\"_\", \" \")"}}]}]},{"html_id":"avram/Avram/OrderByClause","path":"Avram/OrderByClause.html","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},{"html_id":"avram/Avram/OrderByRandom","kind":"class","full_name":"Avram::OrderByRandom","name":"OrderByRandom"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L3"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":""}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L4"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":""}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L5"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/OrderByRandom","path":"Avram/OrderByRandom.html","kind":"class","full_name":"Avram::OrderByRandom","name":"OrderByRandom","abstract":false,"superclass":{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},"ancestors":[{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L3"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L5"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":"@column"}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L7"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":"\"RANDOM ()\""}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L11"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":"self"}}]},{"html_id":"avram/Avram/Paramable","path":"Avram/Paramable.html","kind":"module","full_name":"Avram::Paramable","name":"Paramable","abstract":false,"locations":[{"filename":"src/avram/paramable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Params","kind":"class","full_name":"Avram::Params","name":"Params"},{"html_id":"avram/Lucky/Params","kind":"class","full_name":"Lucky::Params","name":"Params"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"get(key:String)-instance-method","name":"get","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L9"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get?(key:String)-instance-method","name":"get?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L8"},"def":{"name":"get?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get_all(key:String)-instance-method","name":"get_all","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L11"},"def":{"name":"get_all","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get_all?(key:String)-instance-method","name":"get_all?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L10"},"def":{"name":"get_all?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"has_key_for?(operation:Avram::Operation.class|Avram::SaveOperation.class):Bool-instance-method","name":"has_key_for?","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":"Avram::Operation.class | Avram::SaveOperation.class"}],"args_string":"(operation : Avram::Operation.class | Avram::SaveOperation.class) : Bool","args_html":"(operation : Avram::Operation.class | Avram::SaveOperation.class) : Bool","location":{"filename":"src/avram/paramable.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L13"},"def":{"name":"has_key_for?","args":[{"name":"operation","external_name":"operation","restriction":"Avram::Operation.class | Avram::SaveOperation.class"}],"return_type":"Bool","visibility":"Public","body":"!(nested?(operation.param_key)).empty?"}},{"html_id":"many_nested(key:String):Array(Hash(String,String))-instance-method","name":"many_nested","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/paramable.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L7"},"def":{"name":"many_nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":""}},{"html_id":"many_nested?(key:String):Array(Hash(String,String))-instance-method","name":"many_nested?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/paramable.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L6"},"def":{"name":"many_nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":""}},{"html_id":"nested(key:String):Hash(String,String)-instance-method","name":"nested","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/paramable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L3"},"def":{"name":"nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":""}},{"html_id":"nested?(key:String):Hash(String,String)-instance-method","name":"nested?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/paramable.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L2"},"def":{"name":"nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":""}},{"html_id":"nested_arrays(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/paramable.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L5"},"def":{"name":"nested_arrays","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":""}},{"html_id":"nested_arrays?(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/paramable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L4"},"def":{"name":"nested_arrays?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/ParamKeyOverride","path":"Avram/ParamKeyOverride.html","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride","abstract":false,"locations":[{"filename":"src/avram/param_key_override.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/param_key_override.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"define_param_key_override-macro","name":"define_param_key_override","abstract":false,"location":{"filename":"src/avram/param_key_override.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/param_key_override.cr#L10"},"def":{"name":"define_param_key_override","visibility":"Public","body":" macro param_key(key)\n def self.param_key : String\n \n\\{\n{ key.id.stringify }}\n \nend\n \nend\n \n"}}]},{"html_id":"avram/Avram/Params","path":"Avram/Params.html","kind":"class","full_name":"Avram::Params","name":"Params","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Paramable","kind":"module","full_name":"Avram::Paramable","name":"Paramable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/params.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Paramable","kind":"module","full_name":"Avram::Paramable","name":"Paramable"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(hash:Hash(String,Array(String)|String)|Hash(String,Array(String))|Hash(String,String))-class-method","name":"new","abstract":false,"args":[{"name":"hash","external_name":"hash","restriction":"::Hash(::String, ::Array(::String) | ::String) | ::Hash(::String, ::Array(::String)) | ::Hash(::String, ::String)"}],"args_string":"(hash : Hash(String, Array(String) | String) | Hash(String, Array(String)) | Hash(String, String))","args_html":"(hash : Hash(String, Array(String) | String) | Hash(String, Array(String)) | Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L12"},"def":{"name":"new","args":[{"name":"hash","external_name":"hash","restriction":"::Hash(::String, ::Array(::String) | ::String) | ::Hash(::String, ::Array(::String)) | ::Hash(::String, ::String)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(hash)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/params.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L8"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"get(key:String)-instance-method","name":"get","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L51"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"(get?(key)).not_nil!"}},{"html_id":"get?(key:String)-instance-method","name":"get?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L47"},"def":{"name":"get?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"@hash[key]?.try do |value|\n if value.is_a?(String)\n value\n end\nend"}},{"html_id":"get_all(key:String)-instance-method","name":"get_all","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L59"},"def":{"name":"get_all","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"(get_all?(key)).not_nil!"}},{"html_id":"get_all?(key:String)-instance-method","name":"get_all?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L55"},"def":{"name":"get_all?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"@hash[key]?.try do |value|\n if value.is_a?(Array)\n value\n end\nend"}},{"html_id":"get_all_files(key:String)-instance-method","name":"get_all_files","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L71"},"def":{"name":"get_all_files","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"get_all(key)"}},{"html_id":"many_nested(key:String):Array(Hash(String,String))-instance-method","name":"many_nested","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L43"},"def":{"name":"many_nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":"[nested(key)]"}},{"html_id":"many_nested?(key:String):Array(Hash(String,String))-instance-method","name":"many_nested?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L39"},"def":{"name":"many_nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":"many_nested(key)"}},{"html_id":"nested(key:String):Hash(String,String)-instance-method","name":"nested","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L19"},"def":{"name":"nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"Hash(String, String).new.tap do |params|\n @hash.each do |_key, _value|\n if _value.is_a?(String)\n params[_key] = _value\n end\n end\nend"}},{"html_id":"nested?(key:String):Hash(String,String)-instance-method","name":"nested?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L15"},"def":{"name":"nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested(key)"}},{"html_id":"nested_arrays(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/params.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L31"},"def":{"name":"nested_arrays","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":"Hash(String, Array(String)).new.tap do |params|\n @hash.each do |_key, _value|\n if _value.is_a?(Array)\n params[_key] = _value\n end\n end\nend"}},{"html_id":"nested_arrays?(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/params.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L27"},"def":{"name":"nested_arrays?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":"nested_arrays(key)"}},{"html_id":"nested_file(key:String):Hash(String,String)-instance-method","name":"nested_file","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L67"},"def":{"name":"nested_file","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested(key)"}},{"html_id":"nested_file?(key:String):Hash(String,String)-instance-method","name":"nested_file?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L63"},"def":{"name":"nested_file?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested?(key)"}}]},{"html_id":"avram/Avram/PermittedAttribute","path":"Avram/PermittedAttribute.html","kind":"class","full_name":"Avram::PermittedAttribute(T)","name":"PermittedAttribute","abstract":false,"superclass":{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute","name":"Attribute"},"ancestors":[{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute","name":"Attribute"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/permitted_attribute.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/permitted_attribute.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(name,value:T|Nil,param_key,param=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":""},{"name":"param","default_value":"nil","external_name":"param","restriction":""}],"args_string":"(name, value : T | Nil, param_key, param = nil)","args_html":"(name, value : T | Nil, param_key, param = nil)","location":{"filename":"src/avram/attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":""},{"name":"param","default_value":"nil","external_name":"param","restriction":""}],"visibility":"Public","body":"_ = PermittedAttribute(T).allocate\n_.initialize(name, value, param_key, param)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/PGClientNotInstalledError","path":"Avram/PGClientNotInstalledError.html","kind":"class","full_name":"Avram::PGClientNotInstalledError","name":"PGClientNotInstalledError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L105"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(original_message:String)-class-method","name":"new","abstract":false,"args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"args_string":"(original_message : String)","args_html":"(original_message : String)","location":{"filename":"src/avram/errors.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L106"},"def":{"name":"new","args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(original_message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/PGNotRunningError","path":"Avram/PGNotRunningError.html","kind":"class","full_name":"Avram::PGNotRunningError","name":"PGNotRunningError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L131"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(original_message:String)-class-method","name":"new","abstract":false,"args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"args_string":"(original_message : String)","args_html":"(original_message : String)","location":{"filename":"src/avram/errors.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L132"},"def":{"name":"new","args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(original_message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Polymorphic","path":"Avram/Polymorphic.html","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic","abstract":false,"locations":[{"filename":"src/avram/polymorphic.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/polymorphic.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Helpers for defining polymorphic associations","summary":"

Helpers for defining polymorphic associations

","macros":[{"html_id":"polymorphic(polymorphic_name,associations,optional=false)-macro","name":"polymorphic","doc":"# Save a comment for this video\nvideo = VideoQuery.first\nComment::SaveOperation.create!(video_id: video.id)\n```","summary":"

\n \n \nSave a comment for this video video = VideoQuery.first Comment::SaveOperation.create!(video_id: video.id) ```

","abstract":false,"args":[{"name":"polymorphic_name","external_name":"polymorphic_name","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"optional","default_value":"false","external_name":"optional","restriction":""}],"args_string":"(polymorphic_name, associations, optional = false)","args_html":"(polymorphic_name, associations, optional = false)","location":{"filename":"src/avram/polymorphic.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/polymorphic.cr#L104"},"def":{"name":"polymorphic","args":[{"name":"polymorphic_name","external_name":"polymorphic_name","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"optional","default_value":"false","external_name":"optional","restriction":""}],"visibility":"Public","body":" \n{% polymorphic_name = polymorphic_name.id %}\n\n def \n{{ polymorphic_name }}\n\n \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable!\n\n \n# Generates something like: post || video\n\n \n{{ (associations.map(&.id).join(\" || \")).id }}\n{% if !optional %} || Avram::Polymorphic.raise_missing_polymorphic(:{{ polymorphic_name }}, self){% end %}\n\n \nend\n\n def \n{{ polymorphic_name }}\n!\n \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable!\n\n \n# Generates something like: post! || video!\n\n \n{% associations_with_a_bang = associations.map(&.id).map do |assoc|\n \"#{assoc}!\"\nend %}\n\n \n{{ (associations_with_a_bang.join(\" || \")).id }}\n{% if !optional %} || Avram::Polymorphic.raise_missing_polymorphic(:{{ polymorphic_name }}, self){% end %}\n\n \nend\n\n private def \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable! : Nil\n if should_check_polymorphism_at_runtime?\n \n{% associations_to_check = associations.map(&.id).map do |assoc|\n \"#{assoc}.as(Nil)\"\nend %}\n\n \n{{ (associations_to_check.join(\" || \")).id }}\n \n# Ensure polymorphic associations are nilable\n\n \nend\n \nend\n\n \n# This is a bit of a hack to get around Crystal's smart compiler :)\n\n \n# In the ensure_\n{assoc}_belongs_to_are_nilable! we need to check that the\n\n \n# compiler *can* cast to nil, but we don't want to *actually* check it at\n\n \n# runtime. The problem is that we can't do `if false` because Crystal realizes\n\n \n# That will never match and so doesn't even check the `as(Nil)`\n\n \n# We have to trick it by extracting the false to a method. That way\n\n \n# Crystal doesn't realize it is always 'false' and will still check\n\n \n# That the types can be cast to Nil at compile, without actually casting it\n\n \n# at runtime.\n\n private def should_check_polymorphism_at_runtime? : Bool\n false\n \nend\n\n macro finished\n class SaveOperation\n \n# These validations must be run after all of the `before_save`\n\n \n# in case anyone sets their polymorphic association in a callback.\n\n \n# These are ran in the SaveOperation#valid? method\n\n default_validations do\n \n{% list_of_foreign_keys = associations.map(&.id).map do |assoc|\n \"#{assoc.id}_id\".id\nend %}\n\n\n \n# TODO: Needs to actually get the foreign key from the ASSOCIATIONS constant\n\n \n{% if optional %}\n validate_at_most_one_filled {{ (list_of_foreign_keys.map(&.id).join(\", \")).id }}\n {% else %}\n validate_exactly_one_filled {{ (list_of_foreign_keys.map(&.id).join(\", \")).id }},\n message: \"at least one '{{ polymorphic_name.id }}' must be filled\"\n {% end %}\n\n \nend\n \nend\n\n class BaseQuery\n def preload_\n{{ polymorphic_name.id }}\n\n \n{% for association in associations %}\n preload_{{ association.id }}\n {% end %}\n\n \nend\n \nend\n \nend\n \n"}}]},{"html_id":"avram/Avram/PrimaryKeyMethods","path":"Avram/PrimaryKeyMethods.html","kind":"module","full_name":"Avram::PrimaryKeyMethods","name":"PrimaryKeyMethods","abstract":false,"locations":[{"filename":"src/avram/primary_key_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/avram/primary_key_methods.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L2"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if id == other.id\nelse\n return false\nend\nif model_name == other.model_name\nelse\n return false\nend\ntrue\n"}},{"html_id":"delete-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L75"},"def":{"name":"delete","visibility":"Public","body":"self.class.database.exec(\"DELETE FROM #{@@table_name} WHERE #{primary_key_name} = #{escape_primary_key(id)}\")"}},{"html_id":"primary_key_name:Symbol|Nil-instance-method","name":"primary_key_name","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L4"},"def":{"name":"primary_key_name","return_type":"Symbol | ::Nil","visibility":"Public","body":"self.class.primary_key_name"}},{"html_id":"reload:self-instance-method","name":"reload","doc":"Reload the model with the latest information from the database\n\nThis method will return a new model instance with the\nlatest data from the database. Note that this does\n**not** change the original instance, so you may need to\nassign the result to a variable or work directly with the return value.\n\nExample:\n\n```\nuser = SaveUser.create!(name: \"Original\")\nSaveUser.update!(user, name: \"Updated\")\n\n# Will be \"Original\"\nuser.name\n# Will return \"Updated\"\nuser.reload.name # Will be \"Updated\"\n# Will still be \"Original\" since the 'user' is the same model instance.\nuser.name\n\nInstead re-assign the variable. Now 'name' will return \"Updated\" since\n'user' references the reloaded model.\nuser = user.reload\nuser.name\n```","summary":"

Reload the model with the latest information from the database

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L33"},"def":{"name":"reload","return_type":"self","visibility":"Public","body":"base_query_class.find(id)"}},{"html_id":"reload(&):self-instance-method","name":"reload","doc":"Same as `reload` but allows passing a block to customize the query.\n\nThis is almost always used to preload additional relationships.\n\nExample:\n\n```\nuser = SaveUser.create(params)\n\n# We want to display the list of articles the user has commented on, so let's #\n# preload them to avoid N+1 performance issues\nuser = user.reload(&.preload_comments(CommentQuery.new.preload_article))\n\n# Now we can safely get all the comment authors\nuser.comments.map(&.article)\n```\n\nNote that the yielded query is the `BaseQuery` so it will not have any\nmethods defined on your customized query. This is usually fine since\ntypically reload only uses preloads.\n\nIf you do need to do something more custom you can manually reload:\n\n```\nuser = SaveUser.create!(name: \"Helen\")\nUserQuery.new.some_custom_preload_method.find(user.id)\n```","summary":"

Same as #reload but allows passing a block to customize the query.

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L64"},"def":{"name":"reload","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"query = yield base_query_class.new\nquery.find(id)\n"}},{"html_id":"to_param:String-instance-method","name":"to_param","doc":"For integration with Lucky\nThis allows an `Avram::Model` to be passed into a Lucky::Action to create a url/path","summary":"

For integration with Lucky This allows an Avram::Model to be passed into a Lucky::Action to create a url/path

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L71"},"def":{"name":"to_param","return_type":"String","visibility":"Public","body":"id.to_s"}}]},{"html_id":"avram/Avram/PrimaryKeyQueryable","path":"Avram/PrimaryKeyQueryable.html","kind":"module","full_name":"Avram::PrimaryKeyQueryable(T)","name":"PrimaryKeyQueryable","abstract":false,"locations":[{"filename":"src/avram/primary_key_queryable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_queryable.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/PrimaryKeyType","path":"Avram/PrimaryKeyType.html","kind":"enum","full_name":"Avram::PrimaryKeyType","name":"PrimaryKeyType","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/primary_key_type.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_type.cr#L1"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Serial","name":"Serial","value":"0"},{"id":"UUID","name":"UUID","value":"1"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"serial?-instance-method","name":"serial?","abstract":false,"location":{"filename":"src/avram/primary_key_type.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_type.cr#L2"},"def":{"name":"serial?","visibility":"Public","body":"self == Serial"}},{"html_id":"uuid?-instance-method","name":"uuid?","abstract":false,"location":{"filename":"src/avram/primary_key_type.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_type.cr#L3"},"def":{"name":"uuid?","visibility":"Public","body":"self == UUID"}}]},{"html_id":"avram/Avram/Queryable","path":"Avram/Queryable.html","kind":"module","full_name":"Avram::Queryable(T)","name":"Queryable","abstract":false,"ancestors":[{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"}],"locations":[{"filename":"src/avram/queryable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"add_preload(&block:Array(T)->Nil)-instance-method","name":"add_preload","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":273,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L273"},"def":{"name":"add_preload","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(Array(T) -> Nil)"},"visibility":"Public","body":"@preloads << block"}},{"html_id":"any?:Bool-instance-method","name":"any?","doc":"Returns `true` if at least one of the collection's members is truthy.\n\n```\n[nil, true, 99].any? # => true\n[nil, false].any? # => false\n```","summary":"

Returns true if at least one of the collection's members is truthy.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":223,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L223"},"def":{"name":"any?","return_type":"Bool","visibility":"Public","body":"cache_store.fetch(cache_key(:\"any?\"), as: Bool) do\n queryable = clone\n new_query = (queryable.query.limit(1)).select(\"1 AS one\")\n results = database.query_one?(new_query.statement, args: new_query.args, queryable: schema_class.name, as: ( Int32 | Int64))\n !results.nil?\nend"}},{"html_id":"cache_key(operation:Symbol):String-instance-method","name":"cache_key","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":"Symbol"}],"args_string":"(operation : Symbol) : String","args_html":"(operation : Symbol) : String","location":{"filename":"src/avram/queryable.cr","line_number":285,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L285"},"def":{"name":"cache_key","args":[{"name":"operation","external_name":"operation","restriction":"Symbol"}],"return_type":"String","visibility":"Public","body":"[cache_key, operation].join(':')"}},{"html_id":"cache_key:String-instance-method","name":"cache_key","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L281"},"def":{"name":"cache_key","return_type":"String","visibility":"Public","body":"[query.statement, query.args].join(':')"}},{"html_id":"cache_store-instance-method","name":"cache_store","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":277,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L277"},"def":{"name":"cache_store","visibility":"Public","body":"Fiber.current.query_cache"}},{"html_id":"database(*args,**options)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.database(*args, **options)"}},{"html_id":"database(*args,**options,&)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.database(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"delete:Int64-instance-method","name":"delete","doc":"Delete the records using the query's where clauses, or all records if no wheres are added.\n\nReturns the number of deleted records as `Int64`.\n\n```\n# DELETE FROM users WHERE age < 21\nUserQuery.new.age.lt(21).delete\n```","summary":"

Delete the records using the query's where clauses, or all records if no wheres are added.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L104"},"def":{"name":"delete","return_type":"Int64","visibility":"Public","body":"clone.delete!"}},{"html_id":"distinct:self-instance-method","name":"distinct","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L70"},"def":{"name":"distinct","return_type":"self","visibility":"Public","body":"clone.tap do |__arg0|\n __arg0.query.distinct\nend"}},{"html_id":"distinct_on(&):self-instance-method","name":"distinct_on","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L86"},"def":{"name":"distinct_on","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_distinct_on\n"}},{"html_id":"each(&)-instance-method","name":"each","doc":"Must yield this collection's elements to the block.","summary":"

Must yield this collection's elements to the block.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":265,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L265"},"def":{"name":"each","yields":1,"block_arity":1,"visibility":"Public","body":"results.each do |result|\n yield result\nend"}},{"html_id":"exec_scalar(&)-instance-method","name":"exec_scalar","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":303,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L303"},"def":{"name":"exec_scalar","yields":1,"block_arity":1,"visibility":"Public","body":"new_query = yield query.clone\ndatabase.scalar(new_query.statement, args: new_query.args, queryable: schema_class.name)\n"}},{"html_id":"first:T-instance-method","name":"first","doc":"Returns the first element in the collection. Raises `Enumerable::EmptyError`\nif the collection is empty.\n\n```\n([1, 2, 3]).first # => 1\n([] of Int32).first # raises Enumerable::EmptyError\n```","summary":"

Returns the first element in the collection.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":206,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L206"},"def":{"name":"first","return_type":"T","visibility":"Public","body":"first? || (raise(RecordNotFoundError.new(model: table_name, query: :first)))"}},{"html_id":"first?:T|Nil-instance-method","name":"first?","doc":"Returns the first element in the collection.\nWhen the collection is empty, returns `nil`.\n\n```\n([1, 2, 3]).first? # => 1\n([] of Int32).first? # => nil\n```","summary":"

Returns the first element in the collection.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":199,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L199"},"def":{"name":"first?","return_type":"T | ::Nil","visibility":"Public","body":"(with_ordered_query.limit(1)).results.first?"}},{"html_id":"group(&):self-instance-method","name":"group","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":182,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L182"},"def":{"name":"group","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_group\n"}},{"html_id":"group_count:Hash(Array(PGValue),Int64)-instance-method","name":"group_count","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":252,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L252"},"def":{"name":"group_count","return_type":"Hash(Array(PGValue), Int64)","visibility":"Public","body":"(database.query_all((query.select_direct(query.groups + [\"COUNT(*)\"])).statement, args: query.args, queryable: schema_class.name) do |rs|\n {query.groups.map do\n rs.read(PGValue)\n end, rs.read(Int64)}\nend).to_h"}},{"html_id":"join(join_clause:Avram::Join::SqlClause):self-instance-method","name":"join","abstract":false,"args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"args_string":"(join_clause : Avram::Join::SqlClause) : self","args_html":"(join_clause : Avram::Join::SqlClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":123,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L123"},"def":{"name":"join","args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg4|\n __arg4.query.join(join_clause)\nend"}},{"html_id":"last:T-instance-method","name":"last","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":219,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L219"},"def":{"name":"last","return_type":"T","visibility":"Public","body":"last? || (raise(RecordNotFoundError.new(model: table_name, query: :last)))"}},{"html_id":"last?:T|Nil-instance-method","name":"last?","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":210,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L210"},"def":{"name":"last?","return_type":"T | ::Nil","visibility":"Public","body":"(with_ordered_query.clone.tap() do |__arg19|\n __arg19.query.reverse_order\nend.limit(1)).results.first?"}},{"html_id":"limit(amount):self-instance-method","name":"limit","abstract":false,"args":[{"name":"amount","external_name":"amount","restriction":""}],"args_string":"(amount) : self","args_html":"(amount) : self","location":{"filename":"src/avram/queryable.cr","line_number":191,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L191"},"def":{"name":"limit","args":[{"name":"amount","external_name":"amount","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg17|\n __arg17.query.limit(amount)\nend"}},{"html_id":"merge_query(query_to_merge:Avram::QueryBuilder):self-instance-method","name":"merge_query","abstract":false,"args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"args_string":"(query_to_merge : Avram::QueryBuilder) : self","args_html":"(query_to_merge : Avram::QueryBuilder) : self","location":{"filename":"src/avram/queryable.cr","line_number":156,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L156"},"def":{"name":"merge_query","args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg12|\n __arg12.query.merge(query_to_merge)\nend"}},{"html_id":"none:self-instance-method","name":"none","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":187,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L187"},"def":{"name":"none","return_type":"self","visibility":"Public","body":"clone.tap do |__arg16|\n __arg16.query.where(Avram::Where::Equal.new(\"1\", \"0\"))\nend"}},{"html_id":"none?:Bool-instance-method","name":"none?","doc":"Returns `true` if all of the elements of the collection are falsey.\n\n```\n[nil, false].none? # => true\n[nil, false, true].none? # => false\n```\n\nIt's the opposite of `all?`.","summary":"

Returns true if all of the elements of the collection are falsey.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":232,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L232"},"def":{"name":"none?","return_type":"Bool","visibility":"Public","body":"!any?"}},{"html_id":"offset(amount):self-instance-method","name":"offset","abstract":false,"args":[{"name":"amount","external_name":"amount","restriction":""}],"args_string":"(amount) : self","args_html":"(amount) : self","location":{"filename":"src/avram/queryable.cr","line_number":195,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L195"},"def":{"name":"offset","args":[{"name":"amount","external_name":"amount","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg18|\n __arg18.query.offset(amount)\nend"}},{"html_id":"or(&):self-instance-method","name":"or","doc":"Run the `or` block first to grab the last WHERE clause and set its\nconjunction to OR. Then call yield to set the next set of ORs","summary":"

Run the #or block first to grab the last WHERE clause and set its conjunction to OR.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L162"},"def":{"name":"or","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"query.or(&.itself)\nyield self\n"}},{"html_id":"order_by(column,direction):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"column","external_name":"column","restriction":""},{"name":"direction","external_name":"direction","restriction":""}],"args_string":"(column, direction) : self","args_html":"(column, direction) : self","location":{"filename":"src/avram/queryable.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L167"},"def":{"name":"order_by","args":[{"name":"column","external_name":"column","restriction":""},{"name":"direction","external_name":"direction","restriction":""}],"return_type":"self","visibility":"Public","body":"begin\n direction = Avram::OrderBy::Direction.parse(direction.to_s)\n order_by(Avram::OrderBy.new(column, direction))\nrescue e : ArgumentError\n raise(\"#{e.message}. Accepted values are: :asc, :desc\")\nend"}},{"html_id":"order_by(order:Avram::OrderByClause):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"order","external_name":"order","restriction":"Avram::OrderByClause"}],"args_string":"(order : Avram::OrderByClause) : self","args_html":"(order : Avram::OrderByClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":174,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L174"},"def":{"name":"order_by","args":[{"name":"order","external_name":"order","restriction":"Avram::OrderByClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg14|\n __arg14.query.order_by(order)\nend"}},{"html_id":"preloads-instance-method","name":"preloads","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":271,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L271"},"def":{"name":"preloads","visibility":"Public","body":"@preloads"}},{"html_id":"primary_key_name(*args,**options)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.primary_key_name(*args, **options)"}},{"html_id":"primary_key_name(*args,**options,&)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.primary_key_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query:Avram::QueryBuilder-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L4"},"def":{"name":"query","return_type":"Avram::QueryBuilder","visibility":"Public","body":"if (value = @query).nil?\n @query = (Avram::QueryBuilder.new(table: table_name).select(schema_class.column_names))\nelse\n value\nend"}},{"html_id":"query=(query:Avram::QueryBuilder)-instance-method","name":"query=","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"Avram::QueryBuilder"}],"args_string":"(query : Avram::QueryBuilder)","args_html":"(query : Avram::QueryBuilder)","location":{"filename":"src/avram/queryable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L4"},"def":{"name":"query=","args":[{"name":"query","external_name":"query","restriction":"Avram::QueryBuilder"}],"visibility":"Public","body":"@query = query"}},{"html_id":"random_order:self-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":178,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L178"},"def":{"name":"random_order","return_type":"self","visibility":"Public","body":"clone.tap do |__arg15|\n __arg15.query.random_order\nend"}},{"html_id":"reset_limit:self-instance-method","name":"reset_limit","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L78"},"def":{"name":"reset_limit","return_type":"self","visibility":"Public","body":"clone.tap do |__arg2|\n __arg2.query.limit(nil)\nend"}},{"html_id":"reset_offset:self-instance-method","name":"reset_offset","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L82"},"def":{"name":"reset_offset","return_type":"self","visibility":"Public","body":"clone.tap do |__arg3|\n __arg3.query.offset(nil)\nend"}},{"html_id":"reset_order:self-instance-method","name":"reset_order","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L74"},"def":{"name":"reset_order","return_type":"self","visibility":"Public","body":"clone.tap do |__arg1|\n __arg1.query.reset_order\nend"}},{"html_id":"reset_where(&):self-instance-method","name":"reset_where","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":91,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L91"},"def":{"name":"reset_where","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_reset_where\n"}},{"html_id":"results:Array(T)-instance-method","name":"results","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":289,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L289"},"def":{"name":"results","return_type":"Array(T)","visibility":"Public","body":"cache_store.fetch(cache_key, as: Array(T)) do\n exec_query.tap do |records|\n preloads.each(&.call(records))\n end\nend"}},{"html_id":"schema_class:T.class-instance-method","name":"schema_class","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L66"},"def":{"name":"schema_class","return_type":"T.class","visibility":"Public","body":"T"}},{"html_id":"select_count:Int64-instance-method","name":"select_count","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":236,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L236"},"def":{"name":"select_count","return_type":"Int64","visibility":"Public","body":"cache_store.fetch(cache_key(:select_count), as: Int64) do\n begin\n table = \"(#{query.statement}) AS temp\"\n new_query = (Avram::QueryBuilder.new(table)).select_count\n result = database.scalar(new_query.statement, args: query.args, queryable: schema_class.name)\n result.as(Int64)\n rescue e : DB::NoResultsError\n 0_i64\n end\nend"}},{"html_id":"table_name(*args,**options)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.table_name(*args, **options)"}},{"html_id":"table_name(*args,**options,&)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.table_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"to_prepared_sql-instance-method","name":"to_prepared_sql","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":340,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L340"},"def":{"name":"to_prepared_sql","visibility":"Public","body":"query.to_prepared_sql"}},{"html_id":"to_sql-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":336,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L336"},"def":{"name":"to_sql","visibility":"Public","body":"query.to_sql"}},{"html_id":"update:Int64-instance-method","name":"update","doc":"Update the records using the query's where clauses, or all records if no wheres are added.\n\nReturns the number of records updated as `Int64`.\n\n```\n# Update all comments with the word \"spam\" as spam\nCommentQuery.new.body.ilike(\"spam\").update(spam: true)\n```","summary":"

Update the records using the query's where clauses, or all records if no wheres are added.

","abstract":true,"location":{"filename":"src/avram/queryable.cr","line_number":121,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L121"},"def":{"name":"update","return_type":"Int64","visibility":"Public","body":""}},{"html_id":"where(column:Symbol,value):self-instance-method","name":"where","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"value","external_name":"value","restriction":""}],"args_string":"(column : Symbol, value) : self","args_html":"(column : Symbol, value) : self","location":{"filename":"src/avram/queryable.cr","line_number":127,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L127"},"def":{"name":"where","args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"value","external_name":"value","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg5|\n __arg5.query.where(Avram::Where::Equal.new(column, value.to_s))\nend"}},{"html_id":"where(sql_clause:Avram::Where::SqlClause):self-instance-method","name":"where","abstract":false,"args":[{"name":"sql_clause","external_name":"sql_clause","restriction":"Avram::Where::SqlClause"}],"args_string":"(sql_clause : Avram::Where::SqlClause) : self","args_html":"(sql_clause : Avram::Where::SqlClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":139,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L139"},"def":{"name":"where","args":[{"name":"sql_clause","external_name":"sql_clause","restriction":"Avram::Where::SqlClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg7|\n __arg7.query.where(sql_clause)\nend"}},{"html_id":"where(statement:String,*bind_vars):self-instance-method","name":"where","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"args_string":"(statement : String, *bind_vars) : self","args_html":"(statement : String, *bind_vars) : self","location":{"filename":"src/avram/queryable.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L131"},"def":{"name":"where","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"splat_index":1,"return_type":"self","visibility":"Public","body":"where(statement, args: bind_vars.to_a)"}},{"html_id":"where(statement:String,*,argsbind_vars:Array):self-instance-method","name":"where","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"args_string":"(statement : String, *, args bind_vars : Array) : self","args_html":"(statement : String, *, args bind_vars : Array) : self","location":{"filename":"src/avram/queryable.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L135"},"def":{"name":"where","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"splat_index":1,"return_type":"self","visibility":"Public","body":"clone.tap do |__arg6|\n __arg6.query.where(Avram::Where::Raw.new(statement, args: bind_vars))\nend"}},{"html_id":"where(&):self-instance-method","name":"where","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L143"},"def":{"name":"where","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"cloned = clone.tap do |__arg8|\n __arg8.query.where(Avram::Where::PrecedenceStart.new)\nend\nresult = yield cloned\nif result.query.wheres.last.is_a?(Avram::Where::PrecedenceStart)\n result.clone.tap do |__arg9|\n __arg9.query.remove_last_where\n end\nelse\n cloned = result.clone.tap do |__arg10|\n __arg10.query.clear_conjunction\n end\n cloned.clone.tap do |__arg11|\n __arg11.query.where(Avram::Where::PrecedenceEnd.new)\n end\nend\n"}}],"types":[{"html_id":"avram/Avram/Queryable/PGValue","path":"Avram/Queryable/PGValue.html","kind":"alias","full_name":"Avram::Queryable::PGValue","name":"PGValue","abstract":false,"locations":[{"filename":"src/avram/queryable.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L250"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Bool | Float32 | Float64 | Int16 | Int32 | Int64 | PG::Numeric | String | Time | UUID | Nil)","aliased_html":"Bool | Float32 | Float64 | Int16 | Int32 | Int64 | PG::Numeric | String | Time | UUID | Nil","const":false,"namespace":{"html_id":"avram/Avram/Queryable","kind":"module","full_name":"Avram::Queryable(T)","name":"Queryable"},"doc":"Remove when PG::PGValue matches rs.read possibilities","summary":"

Remove when PG::PGValue matches rs.read possibilities

"}]},{"html_id":"avram/Avram/QueryBuilder","path":"Avram/QueryBuilder.html","kind":"class","full_name":"Avram::QueryBuilder","name":"QueryBuilder","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/query_builder.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(table:String|Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"::String | ::Symbol"}],"args_string":"(table : String | Symbol)","args_html":"(table : String | Symbol)","location":{"filename":"src/avram/query_builder.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L18"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"::String | ::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:Array(String|Array(String)|Array(Int32))-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L106"},"def":{"name":"args","return_type":"Array(String | Array(String) | Array(Int32))","visibility":"Public","body":"prepared_statement_values"}},{"html_id":"args_for_update(params)-instance-method","name":"args_for_update","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""}],"args_string":"(params)","args_html":"(params)","location":{"filename":"src/avram/query_builder.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L77"},"def":{"name":"args_for_update","args":[{"name":"params","external_name":"params","restriction":""}],"visibility":"Public","body":"(param_values(params)) + prepared_statement_values"}},{"html_id":"clear_conjunction-instance-method","name":"clear_conjunction","doc":"Clears the last conjunction\ne.g. users.age = $1 AND -> users.age = $1","summary":"

Clears the last conjunction e.g.

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":334,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L334"},"def":{"name":"clear_conjunction","visibility":"Public","body":"if @wheres.empty?\nelse\n @wheres.last.conjunction = Avram::Where::Conjunction::None\nend"}},{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L2"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"delete:self-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":114,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L114"},"def":{"name":"delete","return_type":"self","visibility":"Public","body":"@delete = true\nself\n"}},{"html_id":"distinct:self-instance-method","name":"distinct","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":119,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L119"},"def":{"name":"distinct","return_type":"self","visibility":"Public","body":"@distinct = true\nself\n"}},{"html_id":"distinct?:Bool-instance-method","name":"distinct?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":129,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L129"},"def":{"name":"distinct?","return_type":"Bool","visibility":"Public","body":"@distinct || has_distinct_on?"}},{"html_id":"distinct_on(column:ColumnName):self-instance-method","name":"distinct_on","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":124,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L124"},"def":{"name":"distinct_on","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@distinct_on = column\nself\n"}},{"html_id":"distinct_on:ColumnName|Nil-instance-method","name":"distinct_on","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L6"},"def":{"name":"distinct_on","return_type":"ColumnName | Nil","visibility":"Public","body":"@distinct_on"}},{"html_id":"group_by(column:ColumnName):self-instance-method","name":"group_by","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":189,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L189"},"def":{"name":"group_by","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@groups << column\nself\n"}},{"html_id":"group_sql:String|Nil-instance-method","name":"group_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":194,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L194"},"def":{"name":"group_sql","return_type":"String | ::Nil","visibility":"Public","body":"if grouped?\n \"GROUP BY \" + (groups.join(\", \"))\nend"}},{"html_id":"grouped?:Bool-instance-method","name":"grouped?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":204,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L204"},"def":{"name":"grouped?","return_type":"Bool","visibility":"Public","body":"!@groups.empty?"}},{"html_id":"groups:Array(ColumnName)-instance-method","name":"groups","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":200,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L200"},"def":{"name":"groups","return_type":"Array(ColumnName)","visibility":"Public","body":"@groups"}},{"html_id":"has_distinct_on?:Bool-instance-method","name":"has_distinct_on?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L133"},"def":{"name":"has_distinct_on?","return_type":"Bool","visibility":"Public","body":"!(!@distinct_on)"}},{"html_id":"join(join_clause:Avram::Join::SqlClause):self-instance-method","name":"join","abstract":false,"args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"args_string":"(join_clause : Avram::Join::SqlClause) : self","args_html":"(join_clause : Avram::Join::SqlClause) : self","location":{"filename":"src/avram/query_builder.cr","line_number":302,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L302"},"def":{"name":"join","args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"return_type":"self","visibility":"Public","body":"if (join_clause.to != table) && @joins.none? do |join|\n join.to == join_clause.to\nend\n @joins << join_clause\nend\nself\n"}},{"html_id":"joins:Array(Avram::Join::SqlClause)-instance-method","name":"joins","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":309,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L309"},"def":{"name":"joins","return_type":"Array(Avram::Join::SqlClause)","visibility":"Public","body":"@joins.uniq(&.to_sql)"}},{"html_id":"limit(limit:Int32|Nil):self-instance-method","name":"limit","abstract":false,"args":[{"name":"limit","external_name":"limit","restriction":"Int32 | ::Nil"}],"args_string":"(limit : Int32 | Nil) : self","args_html":"(limit : Int32 | Nil) : self","location":{"filename":"src/avram/query_builder.cr","line_number":141,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L141"},"def":{"name":"limit","args":[{"name":"limit","external_name":"limit","restriction":"Int32 | ::Nil"}],"return_type":"self","visibility":"Public","body":"@limit = limit\nself\n"}},{"html_id":"limit:Int32|Nil-instance-method","name":"limit","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L137"},"def":{"name":"limit","return_type":"Int32 | ::Nil","visibility":"Public","body":"@limit"}},{"html_id":"merge(query_to_merge:Avram::QueryBuilder)-instance-method","name":"merge","doc":"Merges the wheres, joins, and orders from the passed in query","summary":"

Merges the wheres, joins, and orders from the passed in query

","abstract":false,"args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"args_string":"(query_to_merge : Avram::QueryBuilder)","args_html":"(query_to_merge : Avram::QueryBuilder)","location":{"filename":"src/avram/query_builder.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L39"},"def":{"name":"merge","args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"visibility":"Public","body":"query_to_merge.wheres.each do |where|\n where(where)\nend\nquery_to_merge.joins.each do |join|\n join(join)\nend\nquery_to_merge.orders.each do |order|\n order_by(order)\nend\nquery_to_merge.groups.each do |group|\n group_by(group)\nend\n"}},{"html_id":"offset(offset:Int32|Nil):self-instance-method","name":"offset","abstract":false,"args":[{"name":"offset","external_name":"offset","restriction":"Int32 | ::Nil"}],"args_string":"(offset : Int32 | Nil) : self","args_html":"(offset : Int32 | Nil) : self","location":{"filename":"src/avram/query_builder.cr","line_number":149,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L149"},"def":{"name":"offset","args":[{"name":"offset","external_name":"offset","restriction":"Int32 | ::Nil"}],"return_type":"self","visibility":"Public","body":"@offset = offset\nself\n"}},{"html_id":"offset:Int32|Nil-instance-method","name":"offset","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":145,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L145"},"def":{"name":"offset","return_type":"Int32 | ::Nil","visibility":"Public","body":"@offset"}},{"html_id":"or(&block:Avram::QueryBuilder->Avram::QueryBuilder):self-instance-method","name":"or","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":322,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L322"},"def":{"name":"or","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(Avram::QueryBuilder -> Avram::QueryBuilder)"},"return_type":"self","visibility":"Public","body":"if @wheres.empty?\n raise(Avram::InvalidQueryError.new(\"Cannot call `or` before calling a `where`\"))\nend\n@wheres.last.conjunction = Avram::Where::Conjunction::Or\nblock.call(self)\n"}},{"html_id":"order_by(order:OrderByClause):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"order","external_name":"order","restriction":"OrderByClause"}],"args_string":"(order : OrderByClause) : self","args_html":"(order : OrderByClause) : self","location":{"filename":"src/avram/query_builder.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L153"},"def":{"name":"order_by","args":[{"name":"order","external_name":"order","restriction":"OrderByClause"}],"return_type":"self","visibility":"Public","body":"if ordered_randomly?\n reset_order\nend\n@orders << order\nself\n"}},{"html_id":"order_sql:String|Nil-instance-method","name":"order_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":179,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L179"},"def":{"name":"order_sql","return_type":"String | ::Nil","visibility":"Public","body":"if ordered?\n \"ORDER BY \" + (orders.join(\", \", &.prepare))\nend"}},{"html_id":"ordered?:Bool-instance-method","name":"ordered?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":271,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L271"},"def":{"name":"ordered?","return_type":"Bool","visibility":"Public","body":"!@orders.empty?"}},{"html_id":"ordered_randomly?:Bool-instance-method","name":"ordered_randomly?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":275,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L275"},"def":{"name":"ordered_randomly?","return_type":"Bool","visibility":"Public","body":"ordered? && @orders.first.is_a?(Avram::OrderByRandom)"}},{"html_id":"orders:Array(Avram::OrderByClause)-instance-method","name":"orders","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":185,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L185"},"def":{"name":"orders","return_type":"Array(Avram::OrderByClause)","visibility":"Public","body":"@orders.uniq!(&.column)"}},{"html_id":"random_order:self-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":159,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L159"},"def":{"name":"random_order","return_type":"self","visibility":"Public","body":"reset_order\n@orders << Avram::OrderByRandom.new\nself\n"}},{"html_id":"remove_last_where-instance-method","name":"remove_last_where","doc":"Removes the last `Avram::Where` to be added","summary":"

Removes the last Avram::Where to be added

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":339,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L339"},"def":{"name":"remove_last_where","visibility":"Public","body":"@wheres.pop"}},{"html_id":"reset_order:Array(Avram::OrderByClause)-instance-method","name":"reset_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":170,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L170"},"def":{"name":"reset_order","return_type":"Array(Avram::OrderByClause)","visibility":"Public","body":"@orders.clear"}},{"html_id":"reset_where(column:ColumnName):self-instance-method","name":"reset_where","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":165,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L165"},"def":{"name":"reset_where","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@wheres.reject! do |clause|\n clause.is_a?(Avram::Where::SqlClause) && (clause.column.to_s == column.to_s)\nend\nself\n"}},{"html_id":"reverse_order:self-instance-method","name":"reverse_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":174,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L174"},"def":{"name":"reverse_order","return_type":"self","visibility":"Public","body":"if ordered_randomly?\nelse\n @orders = @orders.map(&.reversed).reverse!\nend\nself\n"}},{"html_id":"select(selection:Array(ColumnName)):self-instance-method","name":"select","abstract":false,"args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"args_string":"(selection : Array(ColumnName)) : self","args_html":"(selection : Array(ColumnName)) : self","location":{"filename":"src/avram/query_builder.cr","line_number":262,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L262"},"def":{"name":"select","args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"return_type":"self","visibility":"Public","body":"@selections = selection.join(\", \") do |column|\n \"#{@table}.#{column}\"\nend\nself\n"}},{"html_id":"select(selections:String):self-instance-method","name":"select","abstract":false,"args":[{"name":"selections","external_name":"selections","restriction":"String"}],"args_string":"(selections : String) : self","args_html":"(selections : String) : self","location":{"filename":"src/avram/query_builder.cr","line_number":267,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L267"},"def":{"name":"select","args":[{"name":"selections","external_name":"selections","restriction":"String"}],"return_type":"self","visibility":"Public","body":"@selections = selections\nself\n"}},{"html_id":"select_average(column:ColumnName):self-instance-method","name":"select_average","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":220,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L220"},"def":{"name":"select_average","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"AVG(#{column})\")"}},{"html_id":"select_count:self-instance-method","name":"select_count","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":208,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L208"},"def":{"name":"select_count","return_type":"self","visibility":"Public","body":"add_aggregate(\"COUNT(*)\")"}},{"html_id":"select_direct(selection:Array(ColumnName)):self-instance-method","name":"select_direct","abstract":false,"args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"args_string":"(selection : Array(ColumnName)) : self","args_html":"(selection : Array(ColumnName)) : self","location":{"filename":"src/avram/query_builder.cr","line_number":257,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L257"},"def":{"name":"select_direct","args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"return_type":"self","visibility":"Public","body":"@selections = selection.join(\", \")\nself\n"}},{"html_id":"select_max(column:ColumnName):self-instance-method","name":"select_max","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":216,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L216"},"def":{"name":"select_max","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"MAX(#{column})\")"}},{"html_id":"select_min(column:ColumnName):self-instance-method","name":"select_min","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":212,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L212"},"def":{"name":"select_min","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"MIN(#{column})\")"}},{"html_id":"select_sum(column:ColumnName):self-instance-method","name":"select_sum","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":224,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L224"},"def":{"name":"select_sum","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"SUM(#{column})\")"}},{"html_id":"selects:Array(String)-instance-method","name":"selects","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":251,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L251"},"def":{"name":"selects","return_type":"Array(String)","visibility":"Public","body":"(@selections.split(\", \")).map() do |__arg3|\n (__arg3.split('.')).last\nend"}},{"html_id":"statement:String-instance-method","name":"statement","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L57"},"def":{"name":"statement","return_type":"String","visibility":"Public","body":"clone.statement!"}},{"html_id":"statement!:String-instance-method","name":"statement!","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L61"},"def":{"name":"statement!","return_type":"String","visibility":"Public","body":"join_sql([@delete ? delete_sql : select_sql] + sql_condition_clauses)"}},{"html_id":"statement_for_update(params,return_columnsreturning?:Bool=true)-instance-method","name":"statement_for_update","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"args_string":"(params, return_columns returning? : Bool = true)","args_html":"(params, return_columns returning? : Bool = true)","location":{"filename":"src/avram/query_builder.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L65"},"def":{"name":"statement_for_update","args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"visibility":"Public","body":"clone.statement_for_update!(params, returning?)"}},{"html_id":"statement_for_update!(params,return_columnsreturning?:Bool=true)-instance-method","name":"statement_for_update!","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"args_string":"(params, return_columns returning? : Bool = true)","args_html":"(params, return_columns returning? : Bool = true)","location":{"filename":"src/avram/query_builder.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L69"},"def":{"name":"statement_for_update!","args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"visibility":"Public","body":"sql = [\"UPDATE #{table}\", set_sql_clause(params)]\nsql = sql + sql_condition_clauses\nif returning?\n sql = sql + [\"RETURNING #{@selections}\"]\nend\njoin_sql(sql)\n"}},{"html_id":"table:TableName-instance-method","name":"table","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L5"},"def":{"name":"table","return_type":"TableName","visibility":"Public","body":"@table"}},{"html_id":"to_prepared_sql:String-instance-method","name":"to_prepared_sql","doc":"Prepares the SQL statement by combining the `args` and `statement`\nin to a single `String`","summary":"

Prepares the SQL statement by combining the #args and #statement in to a single String

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L27"},"def":{"name":"to_prepared_sql","return_type":"String","visibility":"Public","body":"params = args.map do |arg|\n \"'#{String.new((PQ::Param.encode(arg)).slice)}'\"\nend\ni = 0\nsql = statement\nsql.scan(/\\$\\d+/) do |match|\n sql = sql.sub(match[0], params[i])\n i = i + 1\nend\nsql\n"}},{"html_id":"to_sql:Array(Array(Int32)|Array(String)|String)-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L21"},"def":{"name":"to_sql","return_type":"Array(Array(Int32) | Array(String) | String)","visibility":"Public","body":"[statement] + args"}},{"html_id":"where(where_clause:Avram::Where::Condition):self-instance-method","name":"where","abstract":false,"args":[{"name":"where_clause","external_name":"where_clause","restriction":"Avram::Where::Condition"}],"args_string":"(where_clause : Avram::Where::Condition) : self","args_html":"(where_clause : Avram::Where::Condition) : self","location":{"filename":"src/avram/query_builder.cr","line_number":317,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L317"},"def":{"name":"where","args":[{"name":"where_clause","external_name":"where_clause","restriction":"Avram::Where::Condition"}],"return_type":"self","visibility":"Public","body":"@wheres << where_clause\nself\n"}},{"html_id":"wheres:Array(Avram::Where::Condition)-instance-method","name":"wheres","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":361,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L361"},"def":{"name":"wheres","return_type":"Array(Avram::Where::Condition)","visibility":"Public","body":"@wheres"}}],"types":[{"html_id":"avram/Avram/QueryBuilder/ColumnName","path":"Avram/QueryBuilder/ColumnName.html","kind":"alias","full_name":"Avram::QueryBuilder::ColumnName","name":"ColumnName","abstract":false,"locations":[{"filename":"src/avram/query_builder.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(String | Symbol)","aliased_html":"String | Symbol","const":false,"namespace":{"html_id":"avram/Avram/QueryBuilder","kind":"class","full_name":"Avram::QueryBuilder","name":"QueryBuilder"}}]},{"html_id":"avram/Avram/RecordNotFoundError","path":"Avram/RecordNotFoundError.html","kind":"class","full_name":"Avram::RecordNotFoundError","name":"RecordNotFoundError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when Avram cannot find a record by given id","summary":"

Raised when Avram cannot find a record by given id

","constructors":[{"html_id":"new(model:TableName,id:String)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"id","external_name":"id","restriction":"String"}],"args_string":"(model : TableName, id : String)","args_html":"(model : TableName, id : String)","location":{"filename":"src/avram/errors.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L31"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"id","external_name":"id","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, id)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(model:TableName,query:Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"query","external_name":"query","restriction":"Symbol"}],"args_string":"(model : TableName, query : Symbol)","args_html":"(model : TableName, query : Symbol)","location":{"filename":"src/avram/errors.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L35"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"query","external_name":"query","restriction":"Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, query)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"id:String|Nil-instance-method","name":"id","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L28"},"def":{"name":"id","return_type":"String | ::Nil","visibility":"Public","body":"@id"}},{"html_id":"model:TableName-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L27"},"def":{"name":"model","return_type":"TableName","visibility":"Public","body":"@model"}},{"html_id":"query:Symbol|Nil-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L29"},"def":{"name":"query","return_type":"Symbol | ::Nil","visibility":"Public","body":"@query"}}]},{"html_id":"avram/Avram/Rollback","path":"Avram/Rollback.html","kind":"class","full_name":"Avram::Rollback","name":"Rollback","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raise to rollback a transaction.","summary":"

Raise to rollback a transaction.

"},{"html_id":"avram/Avram/SaveOperation","path":"Avram/SaveOperation.html","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Upsert","kind":"module","full_name":"Avram::Upsert","name":"Upsert"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/MarkAsFailed","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed"},{"html_id":"avram/Avram/NestedSaveOperation","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation"},{"html_id":"avram/Avram/DatabaseValidations","kind":"module","full_name":"Avram::DatabaseValidations","name":"DatabaseValidations"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L13"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DatabaseValidations","kind":"module","full_name":"Avram::DatabaseValidations","name":"DatabaseValidations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/MarkAsFailed","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed"},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods"},{"html_id":"avram/Avram/NestedSaveOperation","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Upsert","kind":"module","full_name":"Avram::Upsert","name":"Upsert"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L44"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"T.name.underscore"}},{"html_id":"upsert(*args,**named_args)-class-method","name":"upsert","doc":"Performs a create or update depending on if there is a conflicting row in the database.\n\nSee `Avram::Upsert.upsert_lookup_columns` for full documentation and examples.","summary":"

Performs a create or update depending on if there is a conflicting row in the database.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/save_operation.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L24"},"def":{"name":"upsert","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"{% raise(\"Please use the 'upsert_lookup_columns' macro in #{@type} before using 'upsert'\") %}"}},{"html_id":"upsert!(*args,**named_args)-class-method","name":"upsert!","doc":"Performs a create or update depending on if there is a conflicting row in the database.\n\nSee `Avram::Upsert.upsert_lookup_columns` for full documentation and examples.","summary":"

Performs a create or update depending on if there is a conflicting row in the database.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/save_operation.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L24"},"def":{"name":"upsert!","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"{% raise(\"Please use the 'upsert_lookup_columns' macro in #{@type} before using 'upsert!'\") %}"}}],"constructors":[{"html_id":"new(params:Avram::Paramable)-class-method","name":"new","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/save_operation.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L48"},"def":{"name":"new","args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"visibility":"Public","body":"_ = SaveOperation(T).allocate\n_.initialize(params)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L51"},"def":{"name":"new","visibility":"Public","body":"_ = SaveOperation(T).allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"after_commit(_record:T)-instance-method","name":"after_commit","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/save_operation.cr","line_number":283,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L283"},"def":{"name":"after_commit","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"after_save(_record:T)-instance-method","name":"after_save","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/save_operation.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L281"},"def":{"name":"after_save","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"attributes-instance-method","name":"attributes","abstract":true,"location":{"filename":"src/avram/save_operation.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L42"},"def":{"name":"attributes","visibility":"Public","body":""}},{"html_id":"before_save-instance-method","name":"before_save","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":279,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L279"},"def":{"name":"before_save","visibility":"Public","body":""}},{"html_id":"changes:Hash(Symbol,String|Nil)-instance-method","name":"changes","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L193"},"def":{"name":"changes","return_type":"Hash(Symbol, String | ::Nil)","visibility":"Public","body":"attributes_to_hash(column_attributes.select(&.changed?))"}},{"html_id":"created?:Bool-instance-method","name":"created?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L133"},"def":{"name":"created?","return_type":"Bool","visibility":"Public","body":"saved? && new_record?"}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"database(*args,**options)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.database(*args, **options)"}},{"html_id":"database(*args,**options,&)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.database(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"generic_attributes:Array(Avram::GenericAttribute)-instance-method","name":"generic_attributes","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L64"},"def":{"name":"generic_attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"attributes.map do |attr|\n Avram::GenericAttribute.new(name: attr.name, param: attr.param.try(&.to_s), value: attr.value.try(&.to_s), original_value: attr.original_value.try(&.to_s), param_key: attr.param_key, errors: attr.errors)\nend"}},{"html_id":"new_record?:Bool-instance-method","name":"new_record?","doc":"`#persisted?` always returns `true` in `after_*` hooks, whether\na new record was created, or an existing one was updated.\n\nThis method should always return `true` for a create or `false`\nfor an update, independent of the stage we are at in the operation.","summary":"

#persisted? always returns true in after_* hooks, whether a new record was created, or an existing one was updated.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L263"},"def":{"name":"new_record?","return_type":"Bool","visibility":"Public","body":"({{ (T.constant(:PRIMARY_KEY_NAME)).id }}).value.nil?"}},{"html_id":"params:Avram::Paramable-instance-method","name":"params","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L39"},"def":{"name":"params","return_type":"Avram::Paramable","visibility":"Public","body":"@params"}},{"html_id":"persisted?:Bool-instance-method","name":"persisted?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":254,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L254"},"def":{"name":"persisted?","return_type":"Bool","visibility":"Public","body":"!(!record_id)"}},{"html_id":"primary_key_name(*args,**options)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.primary_key_name(*args, **options)"}},{"html_id":"primary_key_name(*args,**options,&)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.primary_key_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"run_default_validations:Nil-instance-method","name":"run_default_validations","doc":"Runs all required validations for required types\nas well as any additional valitaions the type needs to run\ne.g. polymorphic validations","summary":"

Runs all required validations for required types as well as any additional valitaions the type needs to run e.g.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":100,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L100"},"def":{"name":"run_default_validations","return_type":"Nil","visibility":"Public","body":"validate_required(*required_attributes)\ndefault_validations\n"}},{"html_id":"save:Bool-instance-method","name":"save","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":212,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L212"},"def":{"name":"save","return_type":"Bool","visibility":"Public","body":"before_save\nif valid?\n transaction_committed = database.transaction do\n if (!changes.empty?) || (!persisted?)\n insert_or_update\n end\n after_save(record.as(T))\n true\n end\n if transaction_committed\n self.save_status = OperationStatus::Saved\n after_commit(record.as(T))\n Avram::Events::SaveSuccessEvent.publish(operation_class: self.class.name, attributes: generic_attributes)\n true\n else\n mark_as_failed\n publish_save_failed_event\n false\n end\nelse\n mark_as_failed\n publish_save_failed_event\n false\nend\n"}},{"html_id":"save!:T-instance-method","name":"save!","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":242,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L242"},"def":{"name":"save!","return_type":"T","visibility":"Public","body":"if save\n record.as(T)\nelse\n raise(Avram::InvalidOperationError.new(operation: self))\nend"}},{"html_id":"save_failed?:Bool-instance-method","name":"save_failed?","doc":"Return true if the operation has run and the record failed to save","summary":"

Return true if the operation has run and the record failed to save

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L142"},"def":{"name":"save_failed?","return_type":"Bool","visibility":"Public","body":"save_status == OperationStatus::SaveFailed"}},{"html_id":"save_status:OperationStatus-instance-method","name":"save_status","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L40"},"def":{"name":"save_status","return_type":"OperationStatus","visibility":"Public","body":"@save_status"}},{"html_id":"save_status=(save_status:OperationStatus)-instance-method","name":"save_status=","abstract":false,"args":[{"name":"save_status","external_name":"save_status","restriction":"OperationStatus"}],"args_string":"(save_status : OperationStatus)","args_html":"(save_status : OperationStatus)","location":{"filename":"src/avram/save_operation.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L40"},"def":{"name":"save_status=","args":[{"name":"save_status","external_name":"save_status","restriction":"OperationStatus"}],"visibility":"Public","body":"@save_status = save_status"}},{"html_id":"saved?:Bool-instance-method","name":"saved?","doc":"Returns true if the operation has run and saved the record successfully","summary":"

Returns true if the operation has run and saved the record successfully

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":129,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L129"},"def":{"name":"saved?","return_type":"Bool","visibility":"Public","body":"save_status == OperationStatus::Saved"}},{"html_id":"table_name(*args,**options)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.table_name(*args, **options)"}},{"html_id":"table_name(*args,**options,&)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.table_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"update!:T-instance-method","name":"update!","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L250"},"def":{"name":"update!","return_type":"T","visibility":"Public","body":"save!"}},{"html_id":"updated?:Bool-instance-method","name":"updated?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L137"},"def":{"name":"updated?","return_type":"Bool","visibility":"Public","body":"saved? && (!new_record?)"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Runs required validation,\nthen returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Runs required validation, then returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":120,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L120"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"run_default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"add_cast_value_methods(columns)-macro","name":"add_cast_value_methods","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""}],"args_string":"(columns)","args_html":"(columns)","location":{"filename":"src/avram/save_operation.cr","line_number":197,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L197"},"def":{"name":"add_cast_value_methods","args":[{"name":"columns","external_name":"columns","restriction":""}],"visibility":"Public","body":" private def cast_value(value : Nil)\n nil\n \nend\n\n \n{% for column in columns %}\n # pass `value` to it's `Lucky.to_db` for parsing.\n # In most cases, that's just calling `to_s`, but in the case of an Array,\n # `value` is passed to `PQ::Param` to properly encode `[true]` to `{t}`, etc...\n private def cast_value(value : {{ column[:type] }})\n value.class.adapter.to_db(value.as({{ column[:type] }}))\n end\n {% end %}\n\n \n"}},{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}},{"html_id":"permit_columns(*attribute_names)-macro","name":"permit_columns","abstract":false,"args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"args_string":"(*attribute_names)","args_html":"(*attribute_names)","location":{"filename":"src/avram/save_operation.cr","line_number":146,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L146"},"def":{"name":"permit_columns","args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"splat_index":0,"visibility":"Public","body":" \n{% for attribute_name in attribute_names %}\n {% if attribute_name.is_a?(TypeDeclaration) %}\n {% raise(\"Must use a Symbol or a bare word in 'permit_columns'. Instead, got: #{attribute_name}\\n\\nTry this...\\n\\n ▸ permit_columns #{attribute_name.var}\\n\") %}\n {% end %}\n {% if attribute_name.is_a?(SymbolLiteral) || attribute_name.is_a?(Call) %}{% else %}\n {% raise(\"Must use a Symbol or a bare word in 'permit_columns'. Instead, got: #{attribute_name}\\n\\nTry this...\\n\\n ▸ Use a bare word (recommended): 'permit_columns name'\\n ▸ Use a Symbol: 'permit_columns :name'\\n\") %}\n {% end %}\n {% if COLUMN_ATTRIBUTES.any? do |attribute|\n attribute[:name].id == attribute_name.id\nend %}\n def {{ attribute_name.id }}\n _{{ attribute_name.id }}.permitted\n end\n\n @@permitted_param_keys << \"{{ attribute_name.id }}\"\n {% else %}\n {% raise(\"Can't permit '#{attribute_name}' because the column has not been defined on the model for #{@type}.\\n\\nTry this...\\n\\n ▸ Make sure you spelled the column correctly.\\n ▸ Add the column to the model if it doesn't exist.\\n ▸ Use 'attribute' if you want an attribute that is not saved to the database.\\n\") %}\n {% end %}\n {% end %}\n\n \n"}},{"html_id":"skip_default_validations-macro","name":"skip_default_validations","doc":"This allows you to skip the default validations\nwhich may be used as an escape hatch when you want\nto allow storing an empty string value.","summary":"

This allows you to skip the default validations which may be used as an escape hatch when you want to allow storing an empty string value.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":112,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L112"},"def":{"name":"skip_default_validations","visibility":"Public","body":" def run_default_validations\n \nend\n \n"}}],"types":[{"html_id":"avram/Avram/SaveOperation/OperationStatus","path":"Avram/SaveOperation/OperationStatus.html","kind":"enum","full_name":"Avram::SaveOperation::OperationStatus","name":"OperationStatus","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L27"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Saved","name":"Saved","value":"0"},{"id":"SaveFailed","name":"SaveFailed","value":"1"},{"id":"Unperformed","name":"Unperformed","value":"2"}],"namespace":{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"},"instance_methods":[{"html_id":"save_failed?-instance-method","name":"save_failed?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L29"},"def":{"name":"save_failed?","visibility":"Public","body":"self == SaveFailed"}},{"html_id":"saved?-instance-method","name":"saved?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L28"},"def":{"name":"saved?","visibility":"Public","body":"self == Saved"}},{"html_id":"unperformed?-instance-method","name":"unperformed?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L30"},"def":{"name":"unperformed?","visibility":"Public","body":"self == Unperformed"}}]}]},{"html_id":"avram/Avram/SaveOperationTemplate","path":"Avram/SaveOperationTemplate.html","kind":"class","full_name":"Avram::SaveOperationTemplate","name":"SaveOperationTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, *args, **named_args)","args_html":"(type, columns, *args, **named_args)","location":{"filename":"src/avram/save_operation_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":2,"visibility":"Public","body":" \n# This makes it easy for plugins and extensions to use the base SaveOperation\n\n def base_query_class : ::\n{{ type }}\n::BaseQuery.class\n ::\n{{ type }}\n::BaseQuery\n \nend\n\n def save_operation_class : ::\n{{ type }}\n::SaveOperation.class\n ::\n{{ type }}\n::SaveOperation\n \nend\n\n class ::\n{{ type }}\n::SaveOperation < Avram::SaveOperation(\n{{ type }}\n)\n \n{% primary_key_type = type.resolve.constant(\"PRIMARY_KEY_TYPE\") %}\n\n\n macro inherited\n FOREIGN_KEY = \"\n{{ type.stringify.underscore.id }}\n_id\"\n \nend\n\n add_column_attributes(\n{{ columns }}\n)\n add_cast_value_methods(\n{{ columns }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/SchemaEnforcer","path":"Avram/SchemaEnforcer.html","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer","abstract":false,"locations":[{"filename":"src/avram/schema_enforcer.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer.cr#L4"},{"filename":"src/avram/schema_enforcer/validation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/validation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ALL_MODELS","name":"ALL_MODELS","value":"[] of Avram::Model.class"},{"id":"MODELS_TO_SKIP","name":"MODELS_TO_SKIP","value":"[] of String"}],"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"ensure_correct_column_mappings!-class-method","name":"ensure_correct_column_mappings!","abstract":false,"location":{"filename":"src/avram/schema_enforcer.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer.cr#L22"},"def":{"name":"ensure_correct_column_mappings!","visibility":"Public","body":"{% if !ALL_MODELS.empty? %}\n ALL_MODELS.each do |model|\n model.ensure_correct_column_mappings!\n end\n {% end %}"}}],"macros":[{"html_id":"setup(type,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/schema_enforcer.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer.cr#L8"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" class_getter schema_enforcer_validations = [] of Avram::SchemaEnforcer::Validation\n\n def self.ensure_correct_column_mappings!\n return if Avram::SchemaEnforcer::MODELS_TO_SKIP.includes?(self.name)\n\n schema_enforcer_validations.each(&.validate!)\n \nend\n\n \n{% if !type.resolve.abstract? %}\n {% Avram::SchemaEnforcer::ALL_MODELS << type %}\n {% end %}\n\n \n"}},{"html_id":"skip_schema_enforcer-macro","name":"skip_schema_enforcer","abstract":false,"location":{"filename":"src/avram/schema_enforcer.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer.cr#L30"},"def":{"name":"skip_schema_enforcer","visibility":"Public","body":" \n{% Avram::SchemaEnforcer::MODELS_TO_SKIP << @type.stringify %}\n\n \n"}}],"types":[{"html_id":"avram/Avram/SchemaEnforcer/EnsureExistingTable","path":"Avram/SchemaEnforcer/EnsureExistingTable.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureExistingTable","name":"EnsureExistingTable","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_existing_table.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_existing_table.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_existing_table.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_existing_table.cr#L2"},"def":{"name":"validate!","visibility":"Public","body":"if table_missing?\n best_match = Levenshtein::Finder.find(table_name, database_info.table_names, tolerance: 2)\n message = String.build do |string|\n string << \"#{model_class.name.colorize.bold} wants to use the '#{table_name.colorize.bold}' table but it is missing.\\n\"\n if best_match\n string << \"\\nIf you meant for #{model_class.name.colorize.bold} to use the '#{best_match.colorize.yellow.bold}' table, try this...\\n\\n ▸ Change the table name in #{model_class.name.colorize.bold}:\\n\\n table :#{best_match.colorize.bold} do\\n # ..columns\\n end\\n\"\n end\n string << \"\\nIf you need to create the '#{table_name}' table...\\n\\n ▸ Generate a migration:\\n\\n lucky gen.migration Create#{Wordsmith::Inflector.pluralize(model_class.name)}\\n\\n ▸ Create the table in the migration:\\n\\n create table_for(#{model_class.name}) do/end\\n\"\n string << \"\\nOr, you can skip schema checks for this model:\\n\\n class #{model_class.name} < BaseModel\\n # Great for models used in migrations, or for legacy schemas\\n skip_schema_enforcer\\n end\\n\\n\"\n end\n raise(Avram::SchemaMismatchError.new(message))\nend"}}]},{"html_id":"avram/Avram/SchemaEnforcer/EnsureMatchingColumns","path":"Avram/SchemaEnforcer/EnsureMatchingColumns.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureMatchingColumns","name":"EnsureMatchingColumns","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_matching_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"constructors":[{"html_id":"new(model_class,check_required:Bool)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":""},{"name":"check_required","external_name":"check_required","restriction":"::Bool"}],"args_string":"(model_class, check_required : Bool)","args_html":"(model_class, check_required : Bool)","location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_matching_columns.cr#L11"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":""},{"name":"check_required","external_name":"check_required","restriction":"::Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class, check_required)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(model_class)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":""}],"args_string":"(model_class)","args_html":"(model_class)","location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_matching_columns.cr#L7"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_matching_columns.cr#L14"},"def":{"name":"validate!","visibility":"Public","body":"model_class.columns.each do |attribute|\n check_column_matches(attribute)\nend\nif matching_error?\n message = (@missing_columns + @optional_attribute_errors) + @required_attribute_errors\n raise(Avram::SchemaMismatchError.new(message.join(\"\\n\\n\")))\nend\n"}}]},{"html_id":"avram/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault","path":"Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureUUIDPrimaryKeyHasDefault","name":"EnsureUUIDPrimaryKeyHasDefault","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"instance_methods":[{"html_id":"has_primary_key?:Bool-instance-method","name":"has_primary_key?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L25"},"def":{"name":"has_primary_key?","return_type":"Bool","visibility":"Public","body":"!model_class.primary_key_name.nil?"}},{"html_id":"missing_column_default?:Bool-instance-method","name":"missing_column_default?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L33"},"def":{"name":"missing_column_default?","return_type":"Bool","visibility":"Public","body":"primary_key_info.column_default.nil?"}},{"html_id":"primary_key_info:Avram::Database::ColumnInfo-instance-method","name":"primary_key_info","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L37"},"def":{"name":"primary_key_info","return_type":"Avram::Database::ColumnInfo","visibility":"Public","body":"pkey_name = model_class.primary_key_name.to_s\n(table_info.column(pkey_name)).as(Avram::Database::ColumnInfo)\n"}},{"html_id":"uuid_primary_key?:Bool-instance-method","name":"uuid_primary_key?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L29"},"def":{"name":"uuid_primary_key?","return_type":"Bool","visibility":"Public","body":"primary_key_info.data_type == \"uuid\""}},{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L2"},"def":{"name":"validate!","visibility":"Public","body":"if (has_primary_key? && uuid_primary_key?) && missing_column_default?\nelse\n return\nend\nmessage = \"Primary key on the '#{table_name.colorize.bold}' table has the type set as uuid but does not have a default value.\\n\\nTo add a default value...\\n\\n ▸ Generate a migration:\\n\\n lucky gen.migration AddDefaultTo#{Wordsmith::Inflector.pluralize(model_class.name)}PrimaryKey\\n\\n ▸ Enable a Postgres extension to generate uuids if one is not already available in the migration:\\n\\n enable_extension \\\"pgcrypto\\\" # https://www.postgresql.org/docs/current/pgcrypto.html\\n\\n ▸ Update the primary key column to have a default value in the migration:\\n\\n execute(\\\"ALTER TABLE #{table_name.colorize.bold} ALTER COLUMN #{primary_key_info.column_name.colorize.bold} SET DEFAULT gen_random_uuid();\\\")\"\nraise(Avram::SchemaMismatchError.new(message))\n"}}]},{"html_id":"avram/Avram/SchemaEnforcer/Validation","path":"Avram/SchemaEnforcer/Validation.html","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/validation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/validation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/SchemaEnforcer/EnsureExistingTable","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureExistingTable","name":"EnsureExistingTable"},{"html_id":"avram/Avram/SchemaEnforcer/EnsureMatchingColumns","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureMatchingColumns","name":"EnsureMatchingColumns"},{"html_id":"avram/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureUUIDPrimaryKeyHasDefault","name":"EnsureUUIDPrimaryKeyHasDefault"}],"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"constructors":[{"html_id":"new(model_class:::Avram::Model.class)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":"::Avram::Model.class"}],"args_string":"(model_class : ::Avram::Model.class)","args_html":"(model_class : ::Avram::Model.class)","location":{"filename":"src/avram/schema_enforcer/validation.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/validation.cr#L4"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":"::Avram::Model.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":true,"location":{"filename":"src/avram/schema_enforcer/validation.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/validation.cr#L7"},"def":{"name":"validate!","visibility":"Public","body":""}}]}]},{"html_id":"avram/Avram/SchemaMismatchError","path":"Avram/SchemaMismatchError.html","kind":"class","full_name":"Avram::SchemaMismatchError","name":"SchemaMismatchError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L11"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised by Avram::SchemaEnforcer when columns or tables don't match the database.","summary":"

Raised by Avram::SchemaEnforcer when columns or tables don't match the database.

"},{"html_id":"avram/Avram/Slugify","path":"Avram/Slugify.html","kind":"module","full_name":"Avram::Slugify","name":"Slugify","abstract":false,"locations":[{"filename":"src/avram/slugify.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"extended_modules":[{"html_id":"avram/Avram/Slugify","kind":"module","full_name":"Avram::Slugify","name":"Slugify"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Converts a column value to a URL safe String that\ncan be used as a parameter for finding records. A\n`slug` is a `String` column you define on your model\nthat will be passed through the URL instead of an `id`.\n\ne.g. /articles/1 -> /articles/how-to-slugify\n\nUse this module in your `SaveOperation#before_save`.\n\n```\nclass Article < BaseModel\n table do\n column title : String\n column slug : String\n end\nend\n\nclass SaveArticle < Article::SaveOperation\n before_save do\n Avram::Slugify.set slug,\n using: title,\n query: ArticleQuery.new\n end\nend\n```\n\nThe `set` method will use `query` to determine if that `slug` has already\nbeen used, and fall back to appending a random UUID to the end. If the `slug`\nvalue has already been set, then no new slug will be generated. If you just need\nthe value to set on your own, you can use the `generate` method as an escape hatch.\nThis method returns the String value used in the `set` method.\n\n```\nclass SaveArticle < Article::SaveOperation\n before_save do\n if title.changed?\n slug_value = Avram::Slugify.generate(slug,\n using: title,\n query: ArticleQuery.new)\n slug.value = slug_value\n end\n end\nend\n```","summary":"

Converts a column value to a URL safe String that can be used as a parameter for finding records.

","instance_methods":[{"html_id":"generate(slug:Avram::Attribute(String),usingslug_candidate:Avram::Attribute(String)|String,query:Avram::Queryable):String|Nil-instance-method","name":"generate","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : String | Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : String | Nil","location":{"filename":"src/avram/slugify.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L62"},"def":{"name":"generate","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"String | ::Nil","visibility":"Public","body":"generate(slug, [slug_candidate], query)"}},{"html_id":"generate(slug:Avram::Attribute(String),usingslug_candidates:Array(String|Avram::Attribute(String)|Array(Avram::Attribute(String))),query:Avram::Queryable):String|Nil-instance-method","name":"generate","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : String | Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : String | Nil","location":{"filename":"src/avram/slugify.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L68"},"def":{"name":"generate","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"String | ::Nil","visibility":"Public","body":"slug_candidates = format_candidates(slug_candidates)\nresult = slug_candidates.find do |candidate|\n (query.where(slug.name, candidate)).none?\nend\nif result\n result\nelse\n if candidate = slug_candidates.first?\n \"#{candidate}-#{UUID.random}\"\n end\nend\n"}},{"html_id":"set(slug:Avram::Attribute(String),usingslug_candidate:Avram::Attribute(String)|String,query:Avram::Queryable):Nil-instance-method","name":"set","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : Nil","location":{"filename":"src/avram/slugify.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L48"},"def":{"name":"set","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"Nil","visibility":"Public","body":"set(slug, [slug_candidate], query)"}},{"html_id":"set(slug:Avram::Attribute(String),usingslug_candidates:Array(String|Avram::Attribute(String)|Array(Avram::Attribute(String))),query:Avram::Queryable):Nil-instance-method","name":"set","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : Nil","location":{"filename":"src/avram/slugify.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L54"},"def":{"name":"set","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"Nil","visibility":"Public","body":"if slug.value.blank?\n slug.value = generate(slug, slug_candidates, query)\nend"}}]},{"html_id":"avram/Avram/SoftDelete","path":"Avram/SoftDelete.html","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete","abstract":false,"locations":[{"filename":"src/avram/soft_delete/model.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/SoftDelete/Model","path":"Avram/SoftDelete/Model.html","kind":"module","full_name":"Avram::SoftDelete::Model","name":"Model","abstract":false,"locations":[{"filename":"src/avram/soft_delete/model.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SoftDelete","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete"},"doc":" table do\n column soft_deleted_at : Time?\n end\nend\n```\n\nYou should also add the `Avram::SoftDeleteQuery` to your query\n\n```\nclass ArticleQuery < Article::BaseQuery\n include Avram::SoftDelete::Query\nend\n```","summary":"

table do column soft_deleted_at : Time? end end ```

","instance_methods":[{"html_id":"restore:self-instance-method","name":"restore","doc":"Restore the record\n\nThis will set `soft_deleted_at` to `nil`","summary":"

Restore the record

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L38"},"def":{"name":"restore","return_type":"self","visibility":"Public","body":"save_operation_class.update!(self, soft_deleted_at: nil)"}},{"html_id":"save_operation_class-instance-method","name":"save_operation_class","abstract":true,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L42"},"def":{"name":"save_operation_class","visibility":"Public","body":""}},{"html_id":"soft_delete:self-instance-method","name":"soft_delete","doc":"Soft delete the record\n\nThis will set `soft_deleted_at` to the current time (`Time.utc`)","summary":"

Soft delete the record

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L31"},"def":{"name":"soft_delete","return_type":"self","visibility":"Public","body":"save_operation_class.update!(self, soft_deleted_at: Time.utc)"}},{"html_id":"soft_deleted?:Bool-instance-method","name":"soft_deleted?","doc":"Returns true if soft deleted, otherwise false\n\nIf the `soft_deleted_at` has a time value the record is \"soft deleted\".\nIf `soft_deleted_at` is `nil` the record has not been deleted yet.","summary":"

Returns true if soft deleted, otherwise false

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L48"},"def":{"name":"soft_deleted?","return_type":"Bool","visibility":"Public","body":"soft_deleted_at.present?"}},{"html_id":"soft_deleted_at:Time|Nil-instance-method","name":"soft_deleted_at","abstract":true,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L52"},"def":{"name":"soft_deleted_at","return_type":"Time | ::Nil","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/SoftDelete/Query","path":"Avram/SoftDelete/Query.html","kind":"module","full_name":"Avram::SoftDelete::Query","name":"Query","abstract":false,"locations":[{"filename":"src/avram/soft_delete/query.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L12"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SoftDelete","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete"},"doc":"Add methods for querying/updating soft deleted and kept records.\n\nFirst include the model module in your model: `Avram::SoftDelete::Model`\n\nThen add this module your query\n\n```\nclass ArticleQuery < Article::BaseQuery\n include Avram::SoftDelete::Query\nend\n```","summary":"

Add methods for querying/updating soft deleted and kept records.

","instance_methods":[{"html_id":"only_kept-instance-method","name":"only_kept","doc":"Only return kept records\n\nKept records are considered \"kept/not soft deleted\" if the\n`soft_deleted_at` column is `nil`","summary":"

Only return kept records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L17"},"def":{"name":"only_kept","visibility":"Public","body":"reset_where(&.soft_deleted_at).soft_deleted_at.is_nil"}},{"html_id":"only_soft_deleted-instance-method","name":"only_soft_deleted","doc":"Only return soft deleted records\n\nSoft deleted records are considered \"soft deleted\" if the\n`soft_deleted_at` column has a non-nil value","summary":"

Only return soft deleted records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L25"},"def":{"name":"only_soft_deleted","visibility":"Public","body":"reset_where(&.soft_deleted_at).soft_deleted_at.is_not_nil"}},{"html_id":"restore:Int64-instance-method","name":"restore","doc":"Bulk restore records\n\n## Example\n\nThis will restore `Article` records updated in the last week:\n\n```\nArticleQuery.new.updated_at.gt(1.week.ago).restore\n```","summary":"

Bulk restore records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L60"},"def":{"name":"restore","return_type":"Int64","visibility":"Public","body":"only_soft_deleted.update(soft_deleted_at: nil)"}},{"html_id":"soft_delete-instance-method","name":"soft_delete","doc":"Bulk soft delete records\n\n## Example\n\nThis will soft delete all `Article` record older than 1 year:\n\n```\nArticleQuery.new.created_at.lt(1.year.ago).soft_delete\n```","summary":"

Bulk soft delete records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L47"},"def":{"name":"soft_delete","visibility":"Public","body":"only_kept.update(soft_deleted_at: Time.utc)"}},{"html_id":"soft_deleted_at-instance-method","name":"soft_deleted_at","abstract":true,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L64"},"def":{"name":"soft_deleted_at","visibility":"Public","body":""}},{"html_id":"with_soft_deleted-instance-method","name":"with_soft_deleted","doc":"Returns all records\n\nThis works be removing where clauses for the `soft_deleted_at` column.\nThat means you can do `MyQuery.new.only_kept.with_soft_deleted` and you\nwill get all records, not just the kept ones.","summary":"

Returns all records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L34"},"def":{"name":"with_soft_deleted","visibility":"Public","body":"reset_where(&.soft_deleted_at)"}}]}]},{"html_id":"avram/Avram/SpecHelper","path":"Avram/SpecHelper.html","kind":"module","full_name":"Avram::SpecHelper","name":"SpecHelper","abstract":false,"locations":[{"filename":"src/avram/spec_helper.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/spec_helper.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"NO_CASCADE","name":"NO_CASCADE","value":"\"no_cascade\""},{"id":"NO_RESTART_IDENTITY","name":"NO_RESTART_IDENTITY","value":"\"no_restart_identity\""},{"id":"TRUNCATE","name":"TRUNCATE","value":"\"truncate\""}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"wrap_spec_in_transaction(spec:Spec::Example::Procsy,*databases)-class-method","name":"wrap_spec_in_transaction","abstract":false,"args":[{"name":"spec","external_name":"spec","restriction":"Spec::Example::Procsy"},{"name":"databases","external_name":"databases","restriction":""}],"args_string":"(spec : Spec::Example::Procsy, *databases)","args_html":"(spec : Spec::Example::Procsy, *databases)","location":{"filename":"src/avram/spec_helper.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/spec_helper.cr#L12"},"def":{"name":"wrap_spec_in_transaction","args":[{"name":"spec","external_name":"spec","restriction":"Spec::Example::Procsy"},{"name":"databases","external_name":"databases","restriction":""}],"splat_index":1,"visibility":"Public","body":"if named_args = use_truncation?(spec)\n spec.run\n return databases.each(&.truncate(**named_args))\nend\ntracked_transactions = [] of DB::Transaction\ndatabases.each do |database|\n database.lock_id = Fiber.current.object_id\n database.connections.values.each do |conn|\n tracked_transactions << conn.begin_transaction.tap(&._avram_joinable = false)\n end\n database.setup_connection do |conn|\n tracked_transactions << conn.begin_transaction.tap(&._avram_joinable = false)\n end\nend\nspec.run\ntracked_transactions.each do |transaction|\n if transaction.closed? || transaction.connection.closed?\n next\n end\n transaction.rollback\n transaction.connection.release\nend\ntracked_transactions.clear\ndatabases.each do |database|\n database.connections.clear\n database.setup_connection do\n end\nend\n"}}],"macros":[{"html_id":"use_transactional_specs(*databases)-macro","name":"use_transactional_specs","abstract":false,"args":[{"name":"databases","external_name":"databases","restriction":""}],"args_string":"(*databases)","args_html":"(*databases)","location":{"filename":"src/avram/spec_helper.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/spec_helper.cr#L6"},"def":{"name":"use_transactional_specs","args":[{"name":"databases","external_name":"databases","restriction":""}],"splat_index":0,"visibility":"Public","body":" Spec.around_each do |spec|\n Avram::SpecHelper.wrap_spec_in_transaction(spec, \n{{ databases.splat }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/TableFor","path":"Avram/TableFor.html","kind":"module","full_name":"Avram::TableFor","name":"TableFor","abstract":false,"locations":[{"filename":"src/avram/table_for.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/table_for.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"table_for(model)-macro","name":"table_for","doc":"Returns a `Symbol` representing the table name\nof the `model` passed in.\ne.g. `User` => `:users`","summary":"

Returns a Symbol representing the table name of the model passed in.

","abstract":false,"args":[{"name":"model","external_name":"model","restriction":""}],"args_string":"(model)","args_html":"(model)","location":{"filename":"src/avram/table_for.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/table_for.cr#L5"},"def":{"name":"table_for","args":[{"name":"model","external_name":"model","restriction":""}],"visibility":"Public","body":" Wordsmith::Inflector.pluralize(\n{{ model.stringify }}\n.gsub(\"::\", \"\").underscore)\n \n"}}]},{"html_id":"avram/Avram/TableName","path":"Avram/TableName.html","kind":"alias","full_name":"Avram::TableName","name":"TableName","abstract":false,"locations":[{"filename":"src/avram.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L39"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(String | Symbol)","aliased_html":"String | Symbol","const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Type","path":"Avram/Type.html","kind":"module","full_name":"Avram::Type","name":"Type","abstract":false,"locations":[{"filename":"src/avram/type.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Uploadable/Lucky","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky"},{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"},{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"},{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"},{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"},{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"},{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"},{"html_id":"avram/JSON/Any/Lucky","kind":"module","full_name":"JSON::Any::Lucky","name":"Lucky"},{"html_id":"avram/JSON/Serializable/Lucky","kind":"module","full_name":"JSON::Serializable::Lucky(T)","name":"Lucky"},{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"},{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"},{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"},{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"from_db!(value)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L6"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"parse!(value)"}},{"html_id":"parse(value:Nil)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Nil"}],"args_string":"(value : Nil)","args_html":"(value : Nil)","location":{"filename":"src/avram/type.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L10"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Nil"}],"visibility":"Public","body":"SuccessfulCast(Nil).new(nil)"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/type.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L14"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"casts = values.map do |value|\n parse(value)\nend\nif casts.all?(SuccessfulCast)\n values = casts.map do |c|\n (c.as(SuccessfulCast)).value\n end\n parse(values)\nelse\n FailedCast.new\nend\n"}},{"html_id":"parse!(value)-instance-method","name":"parse!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L24"},"def":{"name":"parse!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"((parse(value)).as(SuccessfulCast)).value"}},{"html_id":"to_db(value:Nil)-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Nil"}],"args_string":"(value : Nil)","args_html":"(value : Nil)","location":{"filename":"src/avram/type.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L28"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Nil"}],"visibility":"Public","body":"nil"}},{"html_id":"to_db!(value)-instance-method","name":"to_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L32"},"def":{"name":"to_db!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"parsed_value = parse!(value)\nto_db(parsed_value)\n"}}],"types":[{"html_id":"avram/Avram/Type/FailedCast","path":"Avram/Type/FailedCast.html","kind":"class","full_name":"Avram::Type::FailedCast","name":"FailedCast","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/type.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L44"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"},"instance_methods":[{"html_id":"value-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/type.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L45"},"def":{"name":"value","visibility":"Public","body":"nil"}}]},{"html_id":"avram/Avram/Type/SuccessfulCast","path":"Avram/Type/SuccessfulCast.html","kind":"class","full_name":"Avram::Type::SuccessfulCast(T)","name":"SuccessfulCast","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/type.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L37"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"},"constructors":[{"html_id":"new(value:T)-class-method","name":"new","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T)","args_html":"(value : T)","location":{"filename":"src/avram/type.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L40"},"def":{"name":"new","args":[{"name":"value","external_name":"value","restriction":"T"}],"visibility":"Public","body":"_ = SuccessfulCast(T).allocate\n_.initialize(value)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"value-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/type.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L38"},"def":{"name":"value","visibility":"Public","body":"@value"}}]}]},{"html_id":"avram/Avram/UnsupportedQueryError","path":"Avram/UnsupportedQueryError.html","kind":"class","full_name":"Avram::UnsupportedQueryError","name":"UnsupportedQueryError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":76,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L76"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when an unimplemented or deprecated query is made.","summary":"

Raised when an unimplemented or deprecated query is made.

","constructors":[{"html_id":"new(message:String)-class-method","name":"new","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(message : String)","args_html":"(message : String)","location":{"filename":"src/avram/errors.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L77"},"def":{"name":"new","args":[{"name":"message","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Uploadable","path":"Avram/Uploadable.html","kind":"module","full_name":"Avram::Uploadable","name":"Uploadable","abstract":false,"locations":[{"filename":"src/avram/uploadable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Lucky/UploadedFile","kind":"class","full_name":"Lucky::UploadedFile","name":"UploadedFile"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/uploadable.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L9"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","doc":"This should test if the filename is a blank string.","summary":"

This should test if the filename is a blank string.

","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L7"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":""}},{"html_id":"filename:String-instance-method","name":"filename","doc":"Typically, this should return the filename as found in the `metadata`.","summary":"

Typically, this should return the filename as found in the #metadata.

","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L5"},"def":{"name":"filename","return_type":"String","visibility":"Public","body":""}},{"html_id":"metadata:HTTP::FormData::FileMetadata-instance-method","name":"metadata","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L3"},"def":{"name":"metadata","return_type":"HTTP::FormData::FileMetadata","visibility":"Public","body":""}},{"html_id":"tempfile:File-instance-method","name":"tempfile","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L2"},"def":{"name":"tempfile","return_type":"File","visibility":"Public","body":""}}],"types":[{"html_id":"avram/Avram/Uploadable/Lucky","path":"Avram/Uploadable/Lucky.html","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/uploadable.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L13"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Avram/Uploadable/Lucky","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Avram/Uploadable","kind":"module","full_name":"Avram::Uploadable","name":"Uploadable"},"instance_methods":[{"html_id":"parse(value:Avram::Uploadable)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::Uploadable"}],"args_string":"(value : Avram::Uploadable)","args_html":"(value : Avram::Uploadable)","location":{"filename":"src/avram/uploadable.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L16"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Avram::Uploadable"}],"visibility":"Public","body":"SuccessfulCast(Avram::Uploadable).new(value)"}},{"html_id":"parse(values:Array(Avram::Uploadable))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Avram::Uploadable)"}],"args_string":"(values : Array(Avram::Uploadable))","args_html":"(values : Array(Avram::Uploadable))","location":{"filename":"src/avram/uploadable.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L20"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Avram::Uploadable)"}],"visibility":"Public","body":"SuccessfulCast.new(values)"}},{"html_id":"parse(value:String|Nil)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String | ::Nil"}],"args_string":"(value : String | Nil)","args_html":"(value : String | Nil)","location":{"filename":"src/avram/uploadable.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String | ::Nil"}],"visibility":"Public","body":"FailedCast.new"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/uploadable.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L28"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"FailedCast.new"}}]}]},{"html_id":"avram/Avram/Upsert","path":"Avram/Upsert.html","kind":"module","full_name":"Avram::Upsert","name":"Upsert","abstract":false,"locations":[{"filename":"src/avram/upsert.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/upsert.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Adds the ability to \"create or update\" (upsert) to `Avram::SaveOperation`\n\nThis is included in SaveOperations by default. See `upsert_lookup_columns` for usage details.","summary":"

Adds the ability to "create or update" (upsert) to Avram::SaveOperation

","macros":[{"html_id":"upsert_lookup_columns(*attribute_names)-macro","name":"upsert_lookup_columns","doc":"Defines the columns Avram should use when performing an `upsert`\n\nAn \"upsert\" is short for \"update or insert\", or in Avram terminology a\n\"create or update\". If the values in an operation conflict with an existing\nrecord in the database, Avram updates that record. If there is no\nconflicting record, then Avram will create new one.\n\nIn Avram, you must define which columns Avram should look at when\ndetermining if a conflicting record exists. This is done using the macro\n`Avram::Upsert.upsert_lookup_columns`\n\n**Note:** In almost _every_ case the `upsert_lookup_columns` should have a **unique index** defined\nin the database to ensure no conflicting records are created, even from outside Avram.\n\n## Full Example\n\n```\nclass User < BaseModel\n table do\n column name : String\n column email : String # This column has a unique index\n end\nend\n\nclass SaveUser < User::SaveOperation\n # Can be one or more columns. In this case we choose just :email\n upsert_lookup_columns :email\nend\n\n# Will create a new row in the database since no row with\n# `email: \"bob@example.com\"` exists yet\nSaveUser.upsert!(name: \"Bobby\", email: \"bob@example.com\")\n\n# Will update the name on the row we just created since the email is\n# the same as one in the database\nSaveUser.upsert!(name: \"Bob\", email: \"bob@example.com\")\n```\n\n## Difference between `upsert` and `upsert!`\n\nThere is an `upsert` and `upsert!` that work similarly to `create` and `create!`.\n`upsert!` will raise an error if the operation is invalid. Whereas `upsert`\nwill yield the operation and the new record if the operation is valid, or\nthe operation and `nil` if it is invalid.\n\n```\n# Will raise because the name is blank\nSaveUser.upsert!(name: \"\", email: \"bob@example.com\")\n\n# Operation is invalid because name is blank\nSaveUser.upsert(name: \"\", email: \"bob@example.com\") do |operation, user|\n # `user` is `nil` because the operation is invalid.\n # If the `name` was valid `user` would be the newly created user\nend\n````","summary":"

Defines the columns Avram should use when performing an upsert

","abstract":false,"args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"args_string":"(*attribute_names)","args_html":"(*attribute_names)","location":{"filename":"src/avram/upsert.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/upsert.cr#L60"},"def":{"name":"upsert_lookup_columns","args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"splat_index":0,"visibility":"Public","body":" def self.upsert!(*args, **named_args) : T\n operation = new(*args, **named_args)\n \nexisting_record = find_existing_unique_record(operation)\n\n if \nexisting_record\n operation = new(\nexisting_record, *args, **named_args)\n \nend\n\n operation.save!\n \nend\n\n def self.upsert(*args, **named_args)\n operation = new(*args, **named_args)\n \nexisting_record = find_existing_unique_record(operation)\n\n if \nexisting_record\n operation = new(\nexisting_record, *args, **named_args)\n \nend\n\n operation.save\n yield operation, operation.record\n \nend\n\n def self.find_existing_unique_record(operation) : T?\n T::BaseQuery.new\n \n{% for attribute in attribute_names %}\n .{{ attribute.id }}.nilable_eq(operation.{{ attribute.id }}.value)\n {% end %}\n\n .first?\n \nend\n \n"}}]},{"html_id":"avram/Avram/Validations","path":"Avram/Validations.html","kind":"module","full_name":"Avram::Validations","name":"Validations","abstract":false,"locations":[{"filename":"src/avram/validations.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"extended_modules":[{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"A number of methods for validating Avram::Attributes\nAll validation methods return `Bool`. `false` if any error is added, otherwise `true`\n\nThis module is included in `Avram::Operation`, `Avram::SaveOperation`, and `Avram::DeleteOperation`","summary":"

A number of methods for validating Avram::Attributes All validation methods return Bool.

","instance_methods":[{"html_id":"validate_acceptance_of(attribute:Avram::Attribute(Bool),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_acceptance_of)):Bool-instance-method","name":"validate_acceptance_of","doc":"Validate whether an attribute was accepted (`true`)\n\nThis validation is only for Boolean Attributes. The attribute will be marked\nas invalid for any value other than `true`.","summary":"

Validate whether an attribute was accepted (true)

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Bool)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_acceptance_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(attribute : Avram::Attribute(Bool), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_acceptance_of)) : Bool","args_html":"(attribute : Avram::Attribute(Bool), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_acceptance_of)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":109,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L109"},"def":{"name":"validate_acceptance_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Bool)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_acceptance_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif attribute.value != true\n attribute.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_at_most_one_filled(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_at_most_one_filled)):Bool-instance-method","name":"validate_at_most_one_filled","doc":"Validates that at most one attribute is filled\n\nIf more than one attribute is filled it will mark all but the first filled\nfield invalid.","summary":"

Validates that at most one attribute is filled

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_at_most_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_at_most_one_filled)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_at_most_one_filled)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L39"},"def":{"name":"validate_at_most_one_filled","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_at_most_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = true\npresent_attributes = attributes.reject() do |__arg1|\n __arg1.value.blank?\nend\nif present_attributes.size > 1\n (present_attributes.skip(1)).each do |attr|\n attr.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_confirmation_of(attribute:Avram::Attribute(T),withconfirmation_attribute:Avram::Attribute(T),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_confirmation_of)):BoolforallT-instance-method","name":"validate_confirmation_of","doc":"Validates that the values of two attributes are the same\n\nTakes two attributes and if the values are different the second attribute\n(`with`/`confirmation_attribute`) will be marked as invalid\n\nExample:\n\n```\nvalidate_confirmation_of password, with: password_confirmation\n```\n\nIf `password_confirmation` does not match, it will be marked invalid.","summary":"

Validates that the values of two attributes are the same

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"confirmation_attribute","external_name":"with","restriction":"Avram::Attribute(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_confirmation_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(attribute : Avram::Attribute(T), with confirmation_attribute : Avram::Attribute(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_confirmation_of)) : Bool forall T","args_html":"(attribute : Avram::Attribute(T), with confirmation_attribute : Avram::Attribute(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_confirmation_of)) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":134,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L134"},"def":{"name":"validate_confirmation_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"confirmation_attribute","external_name":"with","restriction":"Avram::Attribute(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_confirmation_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif attribute.value != confirmation_attribute.value\n confirmation_attribute.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_exactly_one_filled(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_exactly_one_filled)):Bool-instance-method","name":"validate_exactly_one_filled","doc":"Validates that at exactly one attribute is filled\n\nThis validation is used by `Avram::Polymorphic.polymorphic` to ensure\nthat a required polymorphic association is set.\n\nIf more than one attribute is filled it will mark all but the first filled\nfield invalid.\n\nIf no field is filled, the first field will be marked as invalid.","summary":"

Validates that at exactly one attribute is filled

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exactly_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exactly_one_filled)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exactly_one_filled)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L65"},"def":{"name":"validate_exactly_one_filled","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exactly_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = validate_at_most_one_filled(*attributes)\npresent_attributes = attributes.reject() do |__arg2|\n __arg2.value.blank?\nend\nif present_attributes.size.zero?\n attributes.first.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_format_of(attribute:Avram::Attribute(String),withregex:Regex,match:Bool=true,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_format_of),allow_nil:Bool=false):Bool-instance-method","name":"validate_format_of","doc":"Validates that the passed in attributes matches the given regex\n\n```\nvalidate_format_of email, with: /[^@]+@[^\\.]+\\..+/\n```\n\nAlternatively, the `match` argument can be set to `false` to not match the\ngiven regex.","summary":"

Validates that the passed in attributes matches the given regex

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String)"},{"name":"regex","external_name":"with","restriction":"Regex"},{"name":"match","default_value":"true","external_name":"match","restriction":"Bool"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_format_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String), with regex : Regex, match : Bool = true, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_format_of), allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(String), with regex : Regex, match : Bool = true, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_format_of), allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":315,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L315"},"def":{"name":"validate_format_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String)"},{"name":"regex","external_name":"with","restriction":"Regex"},{"name":"match","default_value":"true","external_name":"match","restriction":"Bool"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_format_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"if allow_nil && attribute.value.nil?\nelse\n matching = attribute.value.to_s.match(regex)\n if (match && (!matching)) || ((!match) && matching)\n attribute.add_error(message)\n return false\n end\nend\ntrue\n"}},{"html_id":"validate_inclusion_of(attribute:Avram::Attribute(T),inallowed_values:Enumerable(T),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_inclusion_of),allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_inclusion_of","doc":"Validates that the attribute value is in a list of allowed values\n\n```\nvalidate_inclusion_of state, in: [\"NY\", \"MA\"]\n```\n\nThis will mark `state` as invalid unless the value is `\"NY\"`, or `\"MA\"`.","summary":"

Validates that the attribute value is in a list of allowed values

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"allowed_values","external_name":"in","restriction":"Enumerable(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_inclusion_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(T), in allowed_values : Enumerable(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_inclusion_of), allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(T), in allowed_values : Enumerable(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_inclusion_of), allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L155"},"def":{"name":"validate_inclusion_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"allowed_values","external_name":"in","restriction":"Enumerable(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_inclusion_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif value = attribute.value\n if !(allowed_values.includes?(value))\n attribute.add_error(message)\n no_errors = false\n end\nelse\n if !allow_nil\n attribute.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_numeric(attribute:Avram::Attribute(Number),greater_than=nil,less_than=nil,message=nil,allow_nil:Bool=false):Bool-instance-method","name":"validate_numeric","summary":"

DEPRECATED Use validate_numeric with at_least/no_more_than instead of greater_than/less_than

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"greater_than","default_value":"nil","external_name":"greater_than","restriction":""},{"name":"less_than","default_value":"nil","external_name":"less_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(Number), greater_than = nil, less_than = nil, message = nil, allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(Number), greater_than = nil, less_than = nil, message = nil, allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":246,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L246"},"def":{"name":"validate_numeric","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"greater_than","default_value":"nil","external_name":"greater_than","restriction":""},{"name":"less_than","default_value":"nil","external_name":"less_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"validate_numeric(attribute, at_least: greater_than, no_more_than: less_than, message: message, allow_nil: allow_nil)"}},{"html_id":"validate_numeric(attribute:Avram::Attribute(Number),*,at_least=nil,no_more_than=nil,message=nil,allow_nil:Bool=false):Bool-instance-method","name":"validate_numeric","doc":"Validate a number is `at_least` and/or `no_more_than`\n\n```\nvalidate_numeric age, at_least: 18\nvalidate_numeric count, at_least: 0, no_more_than: 1200\n```\nameba:disable Metrics/CyclomaticComplexity","summary":"

Validate a number is at_least and/or no_more_than

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"","external_name":"","restriction":""},{"name":"at_least","default_value":"nil","external_name":"at_least","restriction":""},{"name":"no_more_than","default_value":"nil","external_name":"no_more_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(Number), *, at_least = nil, no_more_than = nil, message = nil, allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(Number), *, at_least = nil, no_more_than = nil, message = nil, allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L263"},"def":{"name":"validate_numeric","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"","external_name":"","restriction":""},{"name":"at_least","default_value":"nil","external_name":"at_least","restriction":""},{"name":"no_more_than","default_value":"nil","external_name":"no_more_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"splat_index":1,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif (at_least && no_more_than) && at_least > no_more_than\n raise(ImpossibleValidation.new(attribute: attribute.name, message: \"number at least #{at_least} but no more than #{no_more_than}\"))\nend\nnumber = attribute.value\nif number.nil?\n if allow_nil\n else\n attribute.add_error(Avram.settings.i18n_backend.get(:validate_numeric_nil))\n no_errors = false\n end\n return no_errors\nend\nif at_least && number < at_least\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_numeric_min))) % at_least)\n no_errors = false\nend\nif no_more_than && number > no_more_than\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_numeric_max))) % no_more_than)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_required(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_required)):Bool-instance-method","name":"validate_required","doc":"Validates that the passed in attributes have values\n\nYou can pass in one or more attributes at a time. The attribute will be\nmarked as invalid if the value is `nil`, or \"blank\" (empty strings or strings with just whitespace)\n\n`false` is not considered invalid.\n\n```\nvalidate_required name, age, email\n```","summary":"

Validates that the passed in attributes have values

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_required)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_required)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_required)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L90"},"def":{"name":"validate_required","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_required)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nattributes.each do |attribute|\n if attribute.value.blank_for_validates_required? && (!attribute.allow_blank?)\n attribute.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_size_of(attribute:Avram::Attribute(String)|Avram::Attribute(Array(T)),min:Number|Nil=nil,max:Number|Nil=nil,message:Avram::Attribute::ErrorMessage|Nil=nil,allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_size_of","doc":"Validate the size of a `String` or `Array` is within a `min` and/or `max`\n\n```\nvalidate_size_of feedback, min: 18, max: 100\nvalidate_size_of password, min: 12\nvalidate_size_of options, max: 10\n```\nameba:disable Metrics/CyclomaticComplexity","summary":"

Validate the size of a String or Array is within a min and/or max

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"min","default_value":"nil","external_name":"min","restriction":"Number | ::Nil"},{"name":"max","default_value":"nil","external_name":"max","restriction":"Number | ::Nil"},{"name":"message","default_value":"nil","external_name":"message","restriction":"Avram::Attribute::ErrorMessage | ::Nil"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), min : Number | Nil = nil, max : Number | Nil = nil, message : Avram::Attribute::ErrorMessage | Nil = nil, allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), min : Number | Nil = nil, max : Number | Nil = nil, message : Avram::Attribute::ErrorMessage | Nil = nil, allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":210,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L210"},"def":{"name":"validate_size_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"min","default_value":"nil","external_name":"min","restriction":"Number | ::Nil"},{"name":"max","default_value":"nil","external_name":"max","restriction":"Number | ::Nil"},{"name":"message","default_value":"nil","external_name":"message","restriction":"Avram::Attribute::ErrorMessage | ::Nil"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif ((!min.nil?) && (!max.nil?)) && min > max\n raise(ImpossibleValidation.new(attribute: attribute.name, message: \"size greater than #{min} but less than #{max}\"))\nend\nif allow_nil && attribute.value.nil?\nelse\n size = attribute.value.try(&.size) || 0\n if (!min.nil?) && size < min\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_min_size_of))) % min)\n no_errors = false\n end\n if (!max.nil?) && size > max\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_max_size_of))) % max)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_size_of(attribute:Avram::Attribute(String)|Avram::Attribute(Array(T)),*,isexact_size:Number,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_exact_size_of),allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_size_of","doc":"Validate the size of a `String` or `Array` is exactly a certain size\n\n```\nvalidate_size_of api_key, is: 32\nvalidate_size_of theme_colors, is: 4\n```","summary":"

Validate the size of a String or Array is exactly a certain size

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"","external_name":"","restriction":""},{"name":"exact_size","external_name":"is","restriction":"Number"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exact_size_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), *, is exact_size : Number, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exact_size_of), allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), *, is exact_size : Number, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exact_size_of), allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":183,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L183"},"def":{"name":"validate_size_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"","external_name":"","restriction":""},{"name":"exact_size","external_name":"is","restriction":"Number"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exact_size_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"splat_index":1,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nsize = attribute.value.try(&.size) || 0\nif size != exact_size\n if !(allow_nil && attribute.value.nil?)\n attribute.add_error(message % exact_size)\n no_errors = false\n end\nend\nno_errors\n"}}],"macros":[{"html_id":"default_validations-macro","name":"default_validations","doc":"Defines an instance method that gets called\nduring validation of an operation. Define your default\nvalidations inside of the block.\n```\ndefault_validations do\n validate_required some_attribute\nend\n```","summary":"

Defines an instance method that gets called during validation of an operation.

","abstract":false,"location":{"filename":"src/avram/validations.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L22"},"def":{"name":"default_validations","visibility":"Public","body":" \n# :nodoc:\n\n def default_validations\n \n{% if @type.methods.map(&.name).includes?((:default_validations).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/Where","path":"Avram/Where.html","kind":"module","full_name":"Avram::Where","name":"Where","abstract":false,"locations":[{"filename":"src/avram/where.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Where/Condition","path":"Avram/Where/Condition.html","kind":"class","full_name":"Avram::Where::Condition","name":"Condition","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L19"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/PrecedenceEnd","kind":"class","full_name":"Avram::Where::PrecedenceEnd","name":"PrecedenceEnd"},{"html_id":"avram/Avram/Where/PrecedenceStart","kind":"class","full_name":"Avram::Where::PrecedenceStart","name":"PrecedenceStart"},{"html_id":"avram/Avram/Where/Raw","kind":"class","full_name":"Avram::Where::Raw","name":"Raw"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L24"},"def":{"name":"clone","visibility":"Public","body":"self"}},{"html_id":"conjunction:Conjunction-instance-method","name":"conjunction","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L20"},"def":{"name":"conjunction","return_type":"Conjunction","visibility":"Public","body":"@conjunction"}},{"html_id":"conjunction=(conjunction:Conjunction)-instance-method","name":"conjunction=","abstract":false,"args":[{"name":"conjunction","external_name":"conjunction","restriction":"Conjunction"}],"args_string":"(conjunction : Conjunction)","args_html":"(conjunction : Conjunction)","location":{"filename":"src/avram/where.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L20"},"def":{"name":"conjunction=","args":[{"name":"conjunction","external_name":"conjunction","restriction":"Conjunction"}],"visibility":"Public","body":"@conjunction = conjunction"}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":true,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L22"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Where/Conjunction","path":"Avram/Where/Conjunction.html","kind":"enum","full_name":"Avram::Where::Conjunction","name":"Conjunction","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L2"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"And","name":"And","value":"0"},{"id":"Or","name":"Or","value":"1"},{"id":"None","name":"None","value":"2"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"and?-instance-method","name":"and?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L3"},"def":{"name":"and?","visibility":"Public","body":"self == And"}},{"html_id":"none?-instance-method","name":"none?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L5"},"def":{"name":"none?","visibility":"Public","body":"self == None"}},{"html_id":"or?-instance-method","name":"or?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L4"},"def":{"name":"or?","visibility":"Public","body":"self == Or"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"Returns a `String` representation of this enum member.\nIn the case of regular enums, this is just the name of the member.\nIn the case of flag enums, it's the names joined by vertical bars, or \"None\",\nif the value is zero.\n\nIf an enum's value doesn't match a member's value, the raw value\nis returned as a string.\n\n```\nColor::Red.to_s # => \"Red\"\nIOMode::None.to_s # => \"None\"\n(IOMode::Read | IOMode::Write).to_s # => \"Read | Write\"\n\nColor.new(10).to_s # => \"10\"\n```","summary":"

Returns a String representation of this enum member.

","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L7"},"def":{"name":"to_s","visibility":"Public","body":"case self\nwhen .and?\n \"AND\"\nwhen .or?\n \"OR\"\nelse\n \"\"\nend"}}]},{"html_id":"avram/Avram/Where/Equal","path":"Avram/Where/Equal.html","kind":"class","full_name":"Avram::Where::Equal","name":"Equal","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":92,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L92"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotEqual-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L97"},"def":{"name":"negated","return_type":"NotEqual","visibility":"Public","body":"NotEqual.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":93,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L93"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"=\""}}]},{"html_id":"avram/Avram/Where/Excludes","path":"Avram/Where/Excludes.html","kind":"class","full_name":"Avram::Where::Excludes","name":"Excludes","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":234,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L234"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Includes-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":239,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L239"},"def":{"name":"negated","return_type":"Includes","visibility":"Public","body":"Includes.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":235,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L235"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!= ALL\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":243,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L243"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{placeholder_supplier.call} #{operator} (#{column})\""}}]},{"html_id":"avram/Avram/Where/GreaterThan","path":"Avram/Where/GreaterThan.html","kind":"class","full_name":"Avram::Where::GreaterThan","name":"GreaterThan","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":112,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L112"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:LessThanOrEqualTo-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":117,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L117"},"def":{"name":"negated","return_type":"LessThanOrEqualTo","visibility":"Public","body":"LessThanOrEqualTo.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":113,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L113"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\">\""}}]},{"html_id":"avram/Avram/Where/GreaterThanOrEqualTo","path":"Avram/Where/GreaterThanOrEqualTo.html","kind":"class","full_name":"Avram::Where::GreaterThanOrEqualTo","name":"GreaterThanOrEqualTo","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":122,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L122"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:LessThan-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":127,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L127"},"def":{"name":"negated","return_type":"LessThan","visibility":"Public","body":"LessThan.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":123,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L123"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\">=\""}}]},{"html_id":"avram/Avram/Where/Ilike","path":"Avram/Where/Ilike.html","kind":"class","full_name":"Avram::Where::Ilike","name":"Ilike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L162"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotIlike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L167"},"def":{"name":"negated","return_type":"NotIlike","visibility":"Public","body":"NotIlike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":163,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L163"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"ILIKE\""}}]},{"html_id":"avram/Avram/Where/In","path":"Avram/Where/In.html","kind":"class","full_name":"Avram::Where::In","name":"In","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":192,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L192"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotIn-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":197,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L197"},"def":{"name":"negated","return_type":"NotIn","visibility":"Public","body":"NotIn.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L193"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"= ANY\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":201,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L201"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} (#{placeholder_supplier.call})\""}}]},{"html_id":"avram/Avram/Where/Includes","path":"Avram/Where/Includes.html","kind":"class","full_name":"Avram::Where::Includes","name":"Includes","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":220,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L220"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Excludes-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":225,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L225"},"def":{"name":"negated","return_type":"Excludes","visibility":"Public","body":"Excludes.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":221,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L221"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"= ANY\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":229,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L229"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{placeholder_supplier.call} #{operator} (#{column})\""}}]},{"html_id":"avram/Avram/Where/LessThan","path":"Avram/Where/LessThan.html","kind":"class","full_name":"Avram::Where::LessThan","name":"LessThan","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L132"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:GreaterThanOrEqualTo-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L137"},"def":{"name":"negated","return_type":"GreaterThanOrEqualTo","visibility":"Public","body":"GreaterThanOrEqualTo.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L133"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"<\""}}]},{"html_id":"avram/Avram/Where/LessThanOrEqualTo","path":"Avram/Where/LessThanOrEqualTo.html","kind":"class","full_name":"Avram::Where::LessThanOrEqualTo","name":"LessThanOrEqualTo","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L142"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:GreaterThan-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L147"},"def":{"name":"negated","return_type":"GreaterThan","visibility":"Public","body":"GreaterThan.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L143"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"<=\""}}]},{"html_id":"avram/Avram/Where/Like","path":"Avram/Where/Like.html","kind":"class","full_name":"Avram::Where::Like","name":"Like","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L152"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotLike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":157,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L157"},"def":{"name":"negated","return_type":"NotLike","visibility":"Public","body":"NotLike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L153"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"LIKE\""}}]},{"html_id":"avram/Avram/Where/NotEqual","path":"Avram/Where/NotEqual.html","kind":"class","full_name":"Avram::Where::NotEqual","name":"NotEqual","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":102,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L102"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Equal-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":107,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L107"},"def":{"name":"negated","return_type":"Equal","visibility":"Public","body":"Equal.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":103,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L103"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!=\""}}]},{"html_id":"avram/Avram/Where/NotIlike","path":"Avram/Where/NotIlike.html","kind":"class","full_name":"Avram::Where::NotIlike","name":"NotIlike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":182,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L182"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Ilike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":187,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L187"},"def":{"name":"negated","return_type":"Ilike","visibility":"Public","body":"Ilike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":183,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L183"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"NOT ILIKE\""}}]},{"html_id":"avram/Avram/Where/NotIn","path":"Avram/Where/NotIn.html","kind":"class","full_name":"Avram::Where::NotIn","name":"NotIn","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":206,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L206"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:In-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":211,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L211"},"def":{"name":"negated","return_type":"In","visibility":"Public","body":"In.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":207,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L207"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!= ALL\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":215,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L215"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} (#{placeholder_supplier.call})\""}}]},{"html_id":"avram/Avram/Where/NotLike","path":"Avram/Where/NotLike.html","kind":"class","full_name":"Avram::Where::NotLike","name":"NotLike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":172,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L172"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Like-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":177,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L177"},"def":{"name":"negated","return_type":"Like","visibility":"Public","body":"Like.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":173,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L173"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"NOT LIKE\""}}]},{"html_id":"avram/Avram/Where/NotNull","path":"Avram/Where/NotNull.html","kind":"class","full_name":"Avram::Where::NotNull","name":"NotNull","abstract":false,"superclass":{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L82"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Null-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L87"},"def":{"name":"negated","return_type":"Null","visibility":"Public","body":"Null.new(column)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":83,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L83"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"IS NOT\""}}]},{"html_id":"avram/Avram/Where/Null","path":"Avram/Where/Null.html","kind":"class","full_name":"Avram::Where::Null","name":"Null","abstract":false,"superclass":{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L72"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotNull-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L77"},"def":{"name":"negated","return_type":"NotNull","visibility":"Public","body":"NotNull.new(column)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":73,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L73"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"IS\""}}]},{"html_id":"avram/Avram/Where/NullSqlClause","path":"Avram/Where/NullSqlClause.html","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L66"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/NotNull","kind":"class","full_name":"Avram::Where::NotNull","name":"NotNull"},{"html_id":"avram/Avram/Where/Null","kind":"class","full_name":"Avram::Where::Null","name":"Null"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"prepare(_placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"_placeholder_supplier","external_name":"_placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(_placeholder_supplier : Proc(String)) : String","args_html":"(_placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L67"},"def":{"name":"prepare","args":[{"name":"_placeholder_supplier","external_name":"_placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} NULL\""}}]},{"html_id":"avram/Avram/Where/PrecedenceEnd","path":"Avram/Where/PrecedenceEnd.html","kind":"class","full_name":"Avram::Where::PrecedenceEnd","name":"PrecedenceEnd","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L39"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L40"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\")\""}}]},{"html_id":"avram/Avram/Where/PrecedenceStart","path":"Avram/Where/PrecedenceStart.html","kind":"class","full_name":"Avram::Where::PrecedenceStart","name":"PrecedenceStart","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L29"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L30"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L34"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"(\""}}]},{"html_id":"avram/Avram/Where/Raw","path":"Avram/Where/Raw.html","kind":"class","full_name":"Avram::Where::Raw","name":"Raw","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":248,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L248"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(statement:String,*bind_vars)-class-method","name":"new","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"args_string":"(statement : String, *bind_vars)","args_html":"(statement : String, *bind_vars)","location":{"filename":"src/avram/where.cr","line_number":251,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L251"},"def":{"name":"new","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"splat_index":1,"visibility":"Public","body":"new(statement, args: bind_vars.to_a)"}},{"html_id":"new(statement:String,*,argsbind_vars:Array)-class-method","name":"new","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"args_string":"(statement : String, *, args bind_vars : Array)","args_html":"(statement : String, *, args bind_vars : Array)","location":{"filename":"src/avram/where.cr","line_number":255,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L255"},"def":{"name":"new","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(statement, args: bind_vars)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":260,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L260"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"@clause"}}]},{"html_id":"avram/Avram/Where/SqlClause","path":"Avram/Where/SqlClause.html","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(column:String|Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::String | ::Symbol"}],"args_string":"(column : String | Symbol)","args_html":"(column : String | Symbol)","location":{"filename":"src/avram/where.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L48"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":"::String | ::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column:Symbol|String-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L46"},"def":{"name":"column","return_type":"Symbol | String","visibility":"Public","body":"@column"}},{"html_id":"negated:SqlClause-instance-method","name":"negated","abstract":true,"location":{"filename":"src/avram/where.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L52"},"def":{"name":"negated","return_type":"SqlClause","visibility":"Public","body":""}},{"html_id":"operator:String-instance-method","name":"operator","abstract":true,"location":{"filename":"src/avram/where.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L51"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L54"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} #{placeholder_supplier.call}\""}}]},{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","path":"Avram/Where/ValueHoldingSqlClause.html","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L59"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/Equal","kind":"class","full_name":"Avram::Where::Equal","name":"Equal"},{"html_id":"avram/Avram/Where/Excludes","kind":"class","full_name":"Avram::Where::Excludes","name":"Excludes"},{"html_id":"avram/Avram/Where/GreaterThan","kind":"class","full_name":"Avram::Where::GreaterThan","name":"GreaterThan"},{"html_id":"avram/Avram/Where/GreaterThanOrEqualTo","kind":"class","full_name":"Avram::Where::GreaterThanOrEqualTo","name":"GreaterThanOrEqualTo"},{"html_id":"avram/Avram/Where/Ilike","kind":"class","full_name":"Avram::Where::Ilike","name":"Ilike"},{"html_id":"avram/Avram/Where/In","kind":"class","full_name":"Avram::Where::In","name":"In"},{"html_id":"avram/Avram/Where/Includes","kind":"class","full_name":"Avram::Where::Includes","name":"Includes"},{"html_id":"avram/Avram/Where/LessThan","kind":"class","full_name":"Avram::Where::LessThan","name":"LessThan"},{"html_id":"avram/Avram/Where/LessThanOrEqualTo","kind":"class","full_name":"Avram::Where::LessThanOrEqualTo","name":"LessThanOrEqualTo"},{"html_id":"avram/Avram/Where/Like","kind":"class","full_name":"Avram::Where::Like","name":"Like"},{"html_id":"avram/Avram/Where/NotEqual","kind":"class","full_name":"Avram::Where::NotEqual","name":"NotEqual"},{"html_id":"avram/Avram/Where/NotIlike","kind":"class","full_name":"Avram::Where::NotIlike","name":"NotIlike"},{"html_id":"avram/Avram/Where/NotIn","kind":"class","full_name":"Avram::Where::NotIn","name":"NotIn"},{"html_id":"avram/Avram/Where/NotLike","kind":"class","full_name":"Avram::Where::NotLike","name":"NotLike"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(column,value:Array(Int32)|Array(String)|String)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":""},{"name":"value","external_name":"value","restriction":"::Array(::Int32) | ::Array(::String) | ::String"}],"args_string":"(column, value : Array(Int32) | Array(String) | String)","args_html":"(column, value : Array(Int32) | Array(String) | String)","location":{"filename":"src/avram/where.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L62"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":""},{"name":"value","external_name":"value","restriction":"::Array(::Int32) | ::Array(::String) | ::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column, value)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"value:String|Array(String)|Array(Int32)-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L60"},"def":{"name":"value","return_type":"String | Array(String) | Array(Int32)","visibility":"Public","body":"@value"}}]}]}]},{"html_id":"avram/BaseTask","path":"BaseTask.html","kind":"class","full_name":"BaseTask","name":"BaseTask","abstract":true,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"subclasses":[{"html_id":"avram/Db/Create","kind":"class","full_name":"Db::Create","name":"Create"},{"html_id":"avram/Db/Drop","kind":"class","full_name":"Db::Drop","name":"Drop"},{"html_id":"avram/Db/Migrate","kind":"class","full_name":"Db::Migrate","name":"Migrate"},{"html_id":"avram/Db/Migrate/One","kind":"class","full_name":"Db::Migrate::One","name":"One"},{"html_id":"avram/Db/Migrations/Status","kind":"class","full_name":"Db::Migrations::Status","name":"Status"},{"html_id":"avram/Db/Redo","kind":"class","full_name":"Db::Redo","name":"Redo"},{"html_id":"avram/Db/Reset","kind":"class","full_name":"Db::Reset","name":"Reset"},{"html_id":"avram/Db/Rollback","kind":"class","full_name":"Db::Rollback","name":"Rollback"},{"html_id":"avram/Db/RollbackAll","kind":"class","full_name":"Db::RollbackAll","name":"RollbackAll"},{"html_id":"avram/Db/RollbackTo","kind":"class","full_name":"Db::RollbackTo","name":"RollbackTo"},{"html_id":"avram/Db/Schema/Dump","kind":"class","full_name":"Db::Schema::Dump","name":"Dump"},{"html_id":"avram/Db/Schema/Restore","kind":"class","full_name":"Db::Schema::Restore","name":"Restore"},{"html_id":"avram/Db/Setup","kind":"class","full_name":"Db::Setup","name":"Setup"},{"html_id":"avram/Db/VerifyConnection","kind":"class","full_name":"Db::VerifyConnection","name":"VerifyConnection"}],"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"base_task\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L4"},"def":{"name":"call","visibility":"Public","body":"Avram::Migrator.run do\n run_task\nend"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":true,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L2"},"def":{"name":"run_task","visibility":"Public","body":""}}]},{"html_id":"avram/Bool","path":"Bool.html","kind":"struct","full_name":"Bool","name":"Bool","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/bool_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/bool_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L1"},{"filename":"src/avram/charms/bool_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"doc":"Bool has only two possible values: `true` and `false`. They are constructed using these literals:\n\n```\ntrue # A Bool that is true\nfalse # A Bool that is false\n```\n\nSee [`Bool` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/bool.html) in the language reference.","summary":"

Bool has only two possible values: true and false.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L2"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"false"}},{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L27"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"false"}}],"types":[{"html_id":"avram/Bool/Lucky","path":"Bool/Lucky.html","kind":"module","full_name":"Bool::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Bool","kind":"struct","full_name":"Bool","name":"Bool"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Bool).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"if ([\"true\", \"1\"] of ::String).includes?(value)\n SuccessfulCast(Bool).new(true)\nelse\n if ([\"false\", \"0\"] of ::String).includes?(value)\n SuccessfulCast(Bool).new(false)\n else\n FailedCast.new\n end\nend"}},{"html_id":"parse(value:Bool)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"SuccessfulCast(Bool).new(value)"}},{"html_id":"parse(values:Array(Bool))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"args_string":"(values : Array(Bool))","args_html":"(values : Array(Bool))","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L28"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"visibility":"Public","body":"SuccessfulCast(Array(Bool)).new(values)"}},{"html_id":"to_db(value:Bool):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool) : String","args_html":"(value : Bool) : String","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L32"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Bool))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"args_string":"(values : Array(Bool))","args_html":"(values : Array(Bool))","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Bool/Lucky/ColumnType","path":"Bool/Lucky/ColumnType.html","kind":"alias","full_name":"Bool::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Bool","aliased_html":"Bool","const":false,"namespace":{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"}},{"html_id":"avram/Bool/Lucky/Criteria","path":"Bool/Lucky/Criteria.html","kind":"class","full_name":"Bool::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]},{"html_id":"avram/Char","path":"Char.html","kind":"struct","full_name":"Char","name":"Char","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/object.cr#L18"},{"filename":"src/avram/object_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L32"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"}],"doc":"A `Char` represents a [Unicode](http://en.wikipedia.org/wiki/Unicode) [code point](http://en.wikipedia.org/wiki/Code_point).\nIt occupies 32 bits.\n\nIt is created by enclosing an UTF-8 character in single quotes.\n\n```\n'a'\n'z'\n'0'\n'_'\n'あ'\n```\n\nYou can use a backslash to denote some characters:\n\n```\n'\\'' # single quote\n'\\\\' # backslash\n'\\e' # escape\n'\\f' # form feed\n'\\n' # newline\n'\\r' # carriage return\n'\\t' # tab\n'\\v' # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n'\\u0041' # == 'A'\n```\n\nOr you can use curly braces and specify up to four hexadecimal numbers:\n\n```\n'\\u{41}' # == 'A'\n```\n\nSee [`Char` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/char.html) in the language reference.","summary":"

A Char represents a Unicode code point.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L45"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/DB","path":"DB.html","kind":"module","full_name":"DB","name":"DB","abstract":false,"locations":[{"filename":"lib/db/src/db.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db.cr#L78"},{"filename":"lib/db/src/db/begin_transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/begin_transaction.cr#L1"},{"filename":"lib/db/src/db/connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/connection.cr#L1"},{"filename":"lib/db/src/db/connection_builder.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/connection_builder.cr#L1"},{"filename":"lib/db/src/db/connection_context.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/connection_context.cr#L1"},{"filename":"lib/db/src/db/database.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/database.cr#L4"},{"filename":"lib/db/src/db/disposable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/disposable.cr#L1"},{"filename":"lib/db/src/db/driver.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/driver.cr#L1"},{"filename":"lib/db/src/db/enumerable_concat.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/enumerable_concat.cr#L1"},{"filename":"lib/db/src/db/error.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/error.cr#L1"},{"filename":"lib/db/src/db/mapping.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/mapping.cr#L1"},{"filename":"lib/db/src/db/pool.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/pool.cr#L5"},{"filename":"lib/db/src/db/pool_prepared_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/pool_prepared_statement.cr#L1"},{"filename":"lib/db/src/db/pool_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/pool_statement.cr#L1"},{"filename":"lib/db/src/db/pool_unprepared_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/pool_unprepared_statement.cr#L1"},{"filename":"lib/db/src/db/query_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/query_methods.cr#L1"},{"filename":"lib/db/src/db/result_set.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/result_set.cr#L1"},{"filename":"lib/db/src/db/serializable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/serializable.cr#L1"},{"filename":"lib/db/src/db/session_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/session_methods.cr#L1"},{"filename":"lib/db/src/db/statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/statement.cr#L1"},{"filename":"lib/db/src/db/string_key_cache.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/string_key_cache.cr#L1"},{"filename":"lib/db/src/db/transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/transaction.cr#L1"},{"filename":"src/ext/db/connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/connection.cr#L1"},{"filename":"src/ext/db/transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"The DB module is a unified interface for database access.\nIndividual database systems are supported by specific database driver shards.\n\nAvailable drivers include:\n* [crystal-lang/crystal-sqlite3](https://github.com/crystal-lang/crystal-sqlite3) for SQLite\n* [crystal-lang/crystal-mysql](https://github.com/crystal-lang/crystal-mysql) for MySQL and MariaDB\n* [will/crystal-pg](https://github.com/will/crystal-pg) for PostgreSQL\n* [kaukas/crystal-cassandra](https://github.com/kaukas/crystal-cassandra) for Cassandra\n\nFor basic instructions on implementing a new database driver, check `Driver` and the existing drivers.\n\nDB manages a connection pool. The connection pool can be configured by query parameters to the\nconnection `URI` as described in `Database`.\n\n### Usage\n\nAssuming `crystal-sqlite3` is included a SQLite3 database can be opened with `#open`.\n\n```\ndb = DB.open \"sqlite3:./path/to/db/file.db\"\ndb.close\n```\n\nIf a block is given to `#open` the database is closed automatically\n\n```\nDB.open \"sqlite3:./file.db\" do |db|\n # work with db\nend # db is closed\n```\n\nIn the code above `db` is a `Database`. Methods available for querying it are described in `QueryMethods`.\n\nThree kind of statements can be performed:\n1. `Database#exec` waits no response from the database.\n2. `Database#scalar` reads a single value of the response.\n3. `Database#query` returns a ResultSet that allows iteration over the rows in the response and column information.\n\nAll of the above methods allows parametrised query. Either positional or named arguments.\n\nCheck a full working version:\n\nThe following example uses SQLite where `?` indicates the arguments. If PostgreSQL is used `$1`, `$2`, etc. should be used. `crystal-db` does not interpret the statements.\n\n```\nrequire \"db\"\nrequire \"sqlite3\"\n\nDB.open \"sqlite3:./file.db\" do |db|\n # When using the pg driver, use $1, $2, etc. instead of ?\n db.exec \"create table contacts (name text, age integer)\"\n db.exec \"insert into contacts values (?, ?)\", \"John Doe\", 30\n\n args = [] of DB::Any\n args << \"Sarah\"\n args << 33\n db.exec \"insert into contacts values (?, ?)\", args: args\n\n puts \"max age:\"\n puts db.scalar \"select max(age) from contacts\" # => 33\n\n puts \"contacts:\"\n db.query \"select name, age from contacts order by age desc\" do |rs|\n puts \"#{rs.column_name(0)} (#{rs.column_name(1)})\"\n # => name (age)\n rs.each do\n puts \"#{rs.read(String)} (#{rs.read(Int32)})\"\n # => Sarah (33)\n # => John Doe (30)\n end\n end\nend\n```\n","summary":"

The DB module is a unified interface for database access.

","types":[{"html_id":"avram/DB/Connection","path":"DB/Connection.html","kind":"class","full_name":"DB::Connection","name":"Connection","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/SessionMethods","kind":"module","full_name":"DB::SessionMethods","name":"SessionMethods"},{"html_id":"avram/DB/QueryMethods","kind":"module","full_name":"DB::QueryMethods","name":"QueryMethods"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/connection.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/connection.cr#L21"},{"filename":"lib/db/src/db/error.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/error.cr#L2"},{"filename":"src/ext/db/connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/connection.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/DB/SessionMethods","kind":"module","full_name":"DB::SessionMethods","name":"SessionMethods"}],"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"doc":"Database driver implementors must subclass `Connection`.\n\nRepresents one active connection to a database.\n\nUsers should never instantiate a `Connection` manually. Use `DB#open` or `Database#connection`.\n\nRefer to `QueryMethods` for documentation about querying the database through this connection.\n\n### Note to implementors\n\nThe connection must be initialized in `#initialize` and closed in `#do_close`.\n\nOverride `#build_prepared_statement` method in order to return a prepared `Statement` to allow querying.\nOverride `#build_unprepared_statement` method in order to return a unprepared `Statement` to allow querying.\nSee also `Statement` to define how the statements are executed.\n\nIf at any give moment the connection is lost a DB::ConnectionLost should be raised. This will\nallow the connection pool to try to reconnect or use another connection if available.\n","summary":"

Database driver implementors must subclass Connection.

"},{"html_id":"avram/DB/SavePointTransaction","path":"DB/SavePointTransaction.html","kind":"class","full_name":"DB::SavePointTransaction","name":"SavePointTransaction","abstract":false,"superclass":{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},"ancestors":[{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":94,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/transaction.cr#L94"},{"filename":"src/ext/db/transaction.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L20"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"constructors":[{"html_id":"new(parent:Transaction,savepoint_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"parent","external_name":"parent","restriction":"Transaction"},{"name":"savepoint_name","external_name":"savepoint_name","restriction":"String"}],"args_string":"(parent : Transaction, savepoint_name : String)","args_html":"(parent : Transaction, savepoint_name : String)","location":{"filename":"src/ext/db/transaction.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L21"},"def":{"name":"new","args":[{"name":"parent","external_name":"parent","restriction":"Transaction"},{"name":"savepoint_name","external_name":"savepoint_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(parent, savepoint_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/DB/TopLevelTransaction","path":"DB/TopLevelTransaction.html","kind":"class","full_name":"DB::TopLevelTransaction","name":"TopLevelTransaction","abstract":false,"superclass":{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},"ancestors":[{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/transaction.cr#L38"},{"filename":"src/ext/db/transaction.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"constructors":[{"html_id":"new(connection:Connection)-class-method","name":"new","abstract":false,"args":[{"name":"connection","external_name":"connection","restriction":"Connection"}],"args_string":"(connection : Connection)","args_html":"(connection : Connection)","location":{"filename":"src/ext/db/transaction.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L8"},"def":{"name":"new","args":[{"name":"connection","external_name":"connection","restriction":"Connection"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/DB/Transaction","path":"DB/Transaction.html","kind":"class","full_name":"DB::Transaction","name":"Transaction","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/transaction.cr#L14"},{"filename":"src/ext/db/transaction.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"}],"subclasses":[{"html_id":"avram/DB/SavePointTransaction","kind":"class","full_name":"DB::SavePointTransaction","name":"SavePointTransaction"},{"html_id":"avram/DB/TopLevelTransaction","kind":"class","full_name":"DB::TopLevelTransaction","name":"TopLevelTransaction"}],"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"doc":"Transactions should be started from `DB#transaction`, `Connection#transaction`\nor `Connection#begin_transaction`.\n\nUse `Transaction#connection` to submit statements to the database.\n\nUse `Transaction#commit` or `Transaction#rollback` to close the ongoing transaction\nexplicitly. Or refer to `BeginTransaction#transaction` for documentation on how to\nuse `#transaction(&block)` methods in `DB` and `Connection`.\n\nNested transactions are supported by using sql `SAVEPOINT`. To start a nested\ntransaction use `Transaction#transaction` or `Transaction#begin_transaction`.\n","summary":"

Transactions should be started from DB#transaction, Connection#transaction or Connection#begin_transaction.

"}]},{"html_id":"avram/Db","path":"Db.html","kind":"module","full_name":"Db","name":"Db","abstract":false,"locations":[{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Db/Console","path":"Db/Console.html","kind":"class","full_name":"Db::Console","name":"Console","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nEnters the postgres REPL. Check config/database.cr\\nfor database configuration.\\n\\nExamples:\\n\\n lucky db.console\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.console\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Access PostgreSQL console\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L16"},"def":{"name":"call","visibility":"Public","body":"puts(banner_message)\nsystem(\"psql #{Avram::Migrator::Runner.credentials.url_without_query_params}\")\n"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}]},{"html_id":"avram/Db/Create","path":"Db/Create.html","kind":"class","full_name":"Db::Create","name":"Create","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe database name is usually found in config/database.cr\\n\\nExamples:\\n\\n lucky db.create\\n LUCKY_ENV=test lucky db.create # Create the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.create\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L3"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Create the database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/create.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L16"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L19"},"def":{"name":"run_task","visibility":"Public","body":"Migrator::Runner.create_db(@quiet)"}}],"types":[{"html_id":"avram/Db/Create/Migrator","path":"Db/Create/Migrator.html","kind":"alias","full_name":"Db::Create::Migrator","name":"Migrator","abstract":false,"locations":[{"filename":"src/avram/tasks/db/create.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Avram::Migrator","aliased_html":"Avram::Migrator","const":false,"namespace":{"html_id":"avram/Db/Create","kind":"class","full_name":"Db::Create","name":"Create"}}]},{"html_id":"avram/Db/Drop","path":"Db/Drop.html","kind":"class","full_name":"Db::Drop","name":"Drop","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe database name is usually found in config/database.cr\\n\\nExamples:\\n\\n lucky db.drop\\n LUCKY_ENV=test lucky db.drop # Drop the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.drop\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Drop the database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/drop.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L15"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L18"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.drop_db(@quiet)"}}]},{"html_id":"avram/Db/Migrate","path":"Db/Migrate.html","kind":"class","full_name":"Db::Migrate","name":"Migrate","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExamples:\\n\\n lucky db.migrate\\n LUCKY_ENV=test lucky db.migrate # Runs migrations on the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrate\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Run any pending migrations\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L13"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L16"},"def":{"name":"run_task","visibility":"Public","body":"(Avram::Migrator::Runner.new(@quiet)).run_pending_migrations"}}],"types":[{"html_id":"avram/Db/Migrate/One","path":"Db/Migrate/One.html","kind":"class","full_name":"Db::Migrate::One","name":"One","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Migrate","kind":"class","full_name":"Db::Migrate","name":"Migrate"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.migrate.one\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrate.one\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Run just the next pending migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.run_next_migration"}}]}]},{"html_id":"avram/Db/Migrations","path":"Db/Migrations.html","kind":"module","full_name":"Db::Migrations","name":"Migrations","abstract":false,"locations":[{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"types":[{"html_id":"avram/Db/Migrations/Status","path":"Db/Migrations/Status.html","kind":"class","full_name":"Db::Migrations::Status","name":"Status","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Migrations","kind":"module","full_name":"Db::Migrations","name":"Migrations"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L5"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Shows which migrations are pending and which have been run.\\n\\nExamples:\\n\\n lucky db.migrations.status\\n LUCKY_ENV=test lucky db.migrations.status # Show migration status for test db\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L3"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrations.status\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L4"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Print the current status of migrations\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L3"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L15"},"def":{"name":"run_task","visibility":"Public","body":"if migrations.none?\n puts(\"There are no migrations.\".colorize(:green))\nelse\n ensure_migration_tracking_tables_exist\n print_migration_statuses\nend"}}]}]},{"html_id":"avram/Db/Redo","path":"Db/Redo.html","kind":"class","full_name":"Db::Redo","name":"Redo","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.redo\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.redo\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback and run just the last migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Db::Rollback.new.run_task\nDb::Migrate.new.run_task\n"}}]},{"html_id":"avram/Db/Reset","path":"Db/Reset.html","kind":"class","full_name":"Db::Reset","name":"Reset","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.reset\\n\\nTo drop the test database:\\n\\n LUCKY_ENV=test lucky db.reset\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.reset\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Drop, recreate, and run migrations.\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/reset.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L16"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L19"},"def":{"name":"run_task","visibility":"Public","body":"(Db::Drop.new(@quiet)).run_task\n(Db::Create.new(@quiet)).run_task\n(Db::Migrate.new(@quiet)).run_task\n"}}]},{"html_id":"avram/Db/Rollback","path":"Db/Rollback.html","kind":"class","full_name":"Db::Rollback","name":"Rollback","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.rollback\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback the last migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.rollback_one"}}]},{"html_id":"avram/Db/RollbackAll","path":"Db/RollbackAll.html","kind":"class","full_name":"Db::RollbackAll","name":"RollbackAll","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou may also want to look at 'lucky db.drop'.\\n\\nExample:\\n\\n lucky db.rollback_all\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback_all\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback all migrations\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L15"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.rollback_all\nputs(\"Done rolling back all migrations\".colorize(:green))\n"}}]},{"html_id":"avram/Db/RollbackTo","path":"Db/RollbackTo.html","kind":"class","full_name":"Db::RollbackTo","name":"RollbackTo","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou can get the migration version from the filename or by running 'lucky db.migrations.status'\\n\\nExample:\\n\\n lucky db.rollback_to 20180802180356\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback_to\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback to a specific migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L14"},"def":{"name":"run_task","visibility":"Public","body":"version = ARGV.first?\nif version && version.to_i64?\n Avram::Migrator::Runner.new.rollback_to(version.to_i64)\nelse\n raise((\"Migration version is required. Example: lucky db.rollback_to 20180802180356\".colorize(:red)).to_s)\nend\n"}}]},{"html_id":"avram/Db/Schema","path":"Db/Schema.html","kind":"module","full_name":"Db::Schema","name":"Schema","abstract":false,"locations":[{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"types":[{"html_id":"avram/Db/Schema/Dump","path":"Db/Schema/Dump.html","kind":"class","full_name":"Db::Schema::Dump","name":"Dump","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[:dump_to] of Symbol"}],"namespace":{"html_id":"avram/Db/Schema","kind":"module","full_name":"Db::Schema","name":"Schema"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou must specify the path that you want Avram to dump the sql to. Note\\nthat this dumps the schema but does not dump any data.\\n\\nExample:\\n\\n lucky db.schema.dump structure.sql\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.schema.dump\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Export database schema to a sql file\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L17"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"dump_to:String-instance-method","name":"dump_to","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L15"},"def":{"name":"dump_to","return_type":"String","visibility":"Public","body":"if @dump_to.nil?\n raise(\"dump_to is required, but no value was passed.\")\nend\n@dump_to.as(String)\n"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L20"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.dump_db(dump_to, @quiet)"}},{"html_id":"set_opt_for_dump_to(args:Array(String))-instance-method","name":"set_opt_for_dump_to","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L15"},"def":{"name":"set_opt_for_dump_to","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"value = args[@positional_arg_count]?\n@dump_to = value\n@positional_arg_count = @positional_arg_count + 1\n"}}]},{"html_id":"avram/Db/Schema/Restore","path":"Db/Schema/Restore.html","kind":"class","full_name":"Db::Schema::Restore","name":"Restore","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Schema","kind":"module","full_name":"Db::Schema","name":"Schema"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou must specify the path to the sql that you want Avram to restore from.\\n\\nExample:\\n\\n lucky db.schema.restore structure.sql\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.schema.restore\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Restore database from a sql dump file\""}}],"constructors":[{"html_id":"new(import_file_path:String|Nil=nil,quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"import_file_path","default_value":"nil","external_name":"import_file_path","restriction":"String | ::Nil"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(import_file_path : String | Nil = nil, quiet : Bool = false)","args_html":"(import_file_path : String | Nil = nil, quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L14"},"def":{"name":"new","args":[{"name":"import_file_path","default_value":"nil","external_name":"import_file_path","restriction":"String | ::Nil"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(import_file_path, quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L17"},"def":{"name":"run_task","visibility":"Public","body":"import_file_path = (@import_file_path || ARGV.first?) || (raise(\"A path to the import SQL file must be provided\"))\nAvram::Migrator::Runner.restore_db(import_file_path.as(String), @quiet)\n"}}]}]},{"html_id":"avram/Db/Setup","path":"Db/Setup.html","kind":"class","full_name":"Db::Setup","name":"Setup","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThis task will run the following:\\n * db.create - Create the database from config/database.cr\\n * db.migrate - Migrate all pending migrations from db/migrations/\\n\\n\\nExamples:\\n\\n lucky db.setup\\n LUCKY_ENV=test lucky db.setup # Setup test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.setup\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Runs a few tasks for setting up your database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/setup.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L18"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L21"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.create_db(@quiet)\n(Avram::Migrator::Runner.new(@quiet)).run_pending_migrations\n"}}]},{"html_id":"avram/Db/VerifyConnection","path":"Db/VerifyConnection.html","kind":"class","full_name":"Db::VerifyConnection","name":"VerifyConnection","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe connection settings are typically defined in config/database.cr\\n\\nExamples:\\n\\n lucky db.verify_connection\\n LUCKY_ENV=test lucky db.verify_connection # Verify test db connection\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.verify_connection\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Verify connection to postgres\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L17"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"quiet?:Bool-instance-method","name":"quiet?","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L15"},"def":{"name":"quiet?","visibility":"Public","body":"@quiet"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L20"},"def":{"name":"run_task","visibility":"Public","body":"begin\n Avram.settings.database_to_migrate.verify_connection\n if quiet?\n else\n puts(\"✔ Connection verified\")\n end\nrescue Avram::ConnectionError\n raise(\"Unable to connect to Postgres for database '#{Avram.settings.database_to_migrate}'.\\n\\nThis is what we tried to connect to:\\n\\n * host: #{Avram::Migrator::Runner.db_host}\\n * port: #{Avram::Migrator::Runner.db_port}\\n * database: #{Avram::Migrator::Runner.db_name}\\n * username: #{Avram::Migrator::Runner.db_user}\\n * password: check config/database.cr\\n\\nTo fix, try this...\\n\\n ▸ Make sure Postgres is running.\\n ▸ Check connection settings in config/database.cr.\\n ▸ If the database has not been created yet, run 'lucky db.create'\\n ▸ Then run 'lucky db.verify_connection' to make sure it can connect.\\n\")\nend"}}]}]},{"html_id":"avram/Enum","path":"Enum.html","kind":"struct","full_name":"Enum","name":"Enum","abstract":true,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/result_set.cr","line_number":156,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/result_set.cr#L156"},{"filename":"src/avram/charms/enum_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"Enum is the base type of all enums.\n\nAn enum is a set of integer values, where each value has an associated name. For example:\n\n```\nenum Color\n Red # 0\n Green # 1\n Blue # 2\nend\n```\n\nValues start with the value `0` and are incremented by one, but can be overwritten.\n\nTo get the underlying value you invoke value on it:\n\n```\nColor::Green.value # => 1\n```\n\nEach constant (member) in the enum has the type of the enum:\n\n```\ntypeof(Color::Red) # => Color\n```\n\n### Flags enum\n\nAn enum can be marked with the `@[Flags]` annotation. This changes the default values:\n\n```\n@[Flags]\nenum IOMode\n Read # 1\n Write # 2\n Async # 4\nend\n```\n\nAdditionally, some methods change their behaviour.\n\n### Enums from integers\n\nAn enum can be created from an integer:\n\n```\nColor.new(1).to_s # => \"Green\"\n```\n\nValues that don't correspond to enum's constants are allowed: the value\nwill still be of type Color, but when printed you will get the underlying value:\n\n```\nColor.new(10).to_s # => \"10\"\n```\n\nThis method is mainly intended to convert integers from C to enums in Crystal.\n\n### Question methods\n\nAn enum automatically defines question methods for each member, using\n`String#underscore` for the method name.\n* In the case of regular enums, this compares by equality (`==`).\n* In the case of flags enums, this invokes `includes?`.\n\nFor example:\n\n```\ncolor = Color::Blue\ncolor.red? # => false\ncolor.blue? # => true\n\nmode = IOMode::Read | IOMode::Async\nmode.read? # => true\nmode.write? # => false\nmode.async? # => true\n```\n\nThis is very convenient in `case` expressions:\n\n```\ncase color\nwhen .red?\n puts \"Got red\"\nwhen .blue?\n puts \"Got blue\"\nend\n```\n\n### Changing the Base Type\n\nThe type of the underlying enum value is `Int32` by default, but it can be changed to any type in `Int::Primitive`.\n\n```\nenum Color : UInt8\n Red\n Green\n Blue\nend\n\nColor::Red.value # : UInt8\n```","summary":"

Enum is the base type of all enums.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L4"},"def":{"name":"adapter","visibility":"Public","body":"Lucky(self)"}}],"types":[{"html_id":"avram/Enum/Lucky","path":"Enum/Lucky.html","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},"instance_methods":[{"html_id":"criteria(query:V,column)forallV-instance-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"V"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : V, column) forall V","args_html":"(query : V, column) forall V","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L39"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"V"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(V, T).new(query, column)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L12"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"is_int = value.to_i?\nif is_int\n return parse(is_int)\nend\nif result = T.parse?(value)\n SuccessfulCast.new(result)\nelse\n FailedCast.new\nend\n"}},{"html_id":"parse(value:Int)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int"}],"args_string":"(value : Int)","args_html":"(value : Int)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L23"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int"}],"visibility":"Public","body":"if result = T.from_value?(value)\n SuccessfulCast.new(result)\nelse\n FailedCast.new\nend"}},{"html_id":"parse(value:T)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T)","args_html":"(value : T)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L31"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"T"}],"visibility":"Public","body":"SuccessfulCast.new(value)"}},{"html_id":"to_db(value:T):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T) : String","args_html":"(value : T) : String","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L35"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"T"}],"return_type":"String","visibility":"Public","body":"value.value.to_s"}}],"types":[{"html_id":"avram/Enum/Lucky/ColumnType","path":"Enum/Lucky/ColumnType.html","kind":"alias","full_name":"Enum::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L10"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Int32 | Int64)","aliased_html":"Int32 | Int64","const":false,"namespace":{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"}},{"html_id":"avram/Enum/Lucky/Criteria","path":"Enum/Lucky/Criteria.html","kind":"class","full_name":"Enum::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria","name":"Criteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L43"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"select_max:V|Nil-instance-method","name":"select_max","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L50"},"def":{"name":"select_max","return_type":"V | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_max(column)).as(Int32 | ::Nil)).try do |max|\n V.adapter.parse!(max)\nend"}},{"html_id":"select_min:V|Nil-instance-method","name":"select_min","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L44"},"def":{"name":"select_min","return_type":"V | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_min(column)).as(Int32 | ::Nil)).try do |min|\n V.adapter.parse!(min)\nend"}}]}]}]},{"html_id":"avram/Fiber","path":"Fiber.html","kind":"class","full_name":"Fiber","name":"Fiber","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/fiber.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/fiber.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"https://crystal-lang.org/api/latest/Fiber.html","summary":"

https://crystal-lang.org/api/latest/Fiber.html

","instance_methods":[{"html_id":"query_cache:LuckyCache::BaseStore-instance-method","name":"query_cache","doc":"This is stored on Fiber so it's released after each\nHTTP Request.","summary":"

This is stored on Fiber so it's released after each HTTP Request.

","abstract":false,"location":{"filename":"src/avram/charms/fiber.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/fiber.cr#L5"},"def":{"name":"query_cache","return_type":"LuckyCache::BaseStore","visibility":"Public","body":"if (value = @query_cache).nil?\n @query_cache = (if Avram.settings.query_cache_enabled\n LuckyCache::MemoryStore.new\n else\n LuckyCache::NullStore.new\n end)\nelse\n value\nend"}},{"html_id":"query_cache=(query_cache:LuckyCache::BaseStore)-instance-method","name":"query_cache=","doc":"This is stored on Fiber so it's released after each\nHTTP Request.","summary":"

This is stored on Fiber so it's released after each HTTP Request.

","abstract":false,"args":[{"name":"query_cache","external_name":"query_cache","restriction":"LuckyCache::BaseStore"}],"args_string":"(query_cache : LuckyCache::BaseStore)","args_html":"(query_cache : LuckyCache::BaseStore)","location":{"filename":"src/avram/charms/fiber.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/fiber.cr#L5"},"def":{"name":"query_cache=","args":[{"name":"query_cache","external_name":"query_cache","restriction":"LuckyCache::BaseStore"}],"visibility":"Public","body":"@query_cache = query_cache"}}]},{"html_id":"avram/Float64","path":"Float64.html","kind":"struct","full_name":"Float64","name":"Float64","abstract":false,"superclass":{"html_id":"avram/Float","kind":"struct","full_name":"Float","name":"Float"},"ancestors":[{"html_id":"avram/Float","kind":"struct","full_name":"Float","name":"Float"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L31"},{"filename":"src/avram/charms/float64_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L32"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Float64/Lucky","path":"Float64/Lucky.html","kind":"module","full_name":"Float64::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Float64","kind":"struct","full_name":"Float64","name":"Float64"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Float64).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Float64)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64)","args_html":"(value : Float64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"visibility":"Public","body":"value"}},{"html_id":"from_db!(value:PG::Numeric)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"args_string":"(value : PG::Numeric)","args_html":"(value : PG::Numeric)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L18"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"visibility":"Public","body":"value.to_f"}},{"html_id":"parse(value:Float64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64)","args_html":"(value : Float64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value)"}},{"html_id":"parse(values:Array(Float64))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"args_string":"(values : Array(Float64))","args_html":"(values : Array(Float64))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"visibility":"Public","body":"SuccessfulCast(Array(Float64)).new(values)"}},{"html_id":"parse(value:PG::Numeric)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"args_string":"(value : PG::Numeric)","args_html":"(value : PG::Numeric)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L30"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f)"}},{"html_id":"parse(values:Array(PG::Numeric))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(PG::Numeric)"}],"args_string":"(values : Array(PG::Numeric))","args_html":"(values : Array(PG::Numeric))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L34"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(PG::Numeric)"}],"visibility":"Public","body":"SuccessfulCast(Array(Float64)).new(values.map(&.to_f))"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L38"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Float64).new(value.to_f64)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L44"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f64)"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L48"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f64)"}},{"html_id":"to_db(value:Float64):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64) : String","args_html":"(value : Float64) : String","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L52"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Float64))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"args_string":"(values : Array(Float64))","args_html":"(values : Array(Float64))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L56"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Float64/Lucky/ColumnType","path":"Float64/Lucky/ColumnType.html","kind":"alias","full_name":"Float64::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Float64 | PG::Numeric)","aliased_html":"Float64 | PG::Numeric","const":false,"namespace":{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"}},{"html_id":"avram/Float64/Lucky/Criteria","path":"Float64/Lucky/Criteria.html","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L60"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"}],"namespace":{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L61"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"select_sum:Float64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L63"},"def":{"name":"select_sum","return_type":"Float64 | ::Nil","visibility":"Public","body":"if sum = super()\n (sum.as(PG::Numeric)).to_f\nend"}},{"html_id":"select_sum!:Float64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L69"},"def":{"name":"select_sum!","return_type":"Float64","visibility":"Public","body":"select_sum || 0_f64"}}]}]}]},{"html_id":"avram/Gen","path":"Gen.html","kind":"module","full_name":"Gen","name":"Gen","abstract":false,"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Gen/Migration","path":"Gen/Migration.html","kind":"class","full_name":"Gen::Migration","name":"Migration","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"HABITAT_SETTINGS","name":"HABITAT_SETTINGS","value":"[{decl: io : IO = STDOUT, example: nil, validation: nil}] of Nil"},{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"configure(&)-class-method","name":"configure","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"configure","yields":1,"block_arity":1,"visibility":"Public","body":"yield settings"}},{"html_id":"settings-class-method","name":"settings","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}},{"html_id":"silence_output(&)-class-method","name":"silence_output","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L22"},"def":{"name":"silence_output","yields":0,"block_arity":0,"visibility":"Public","body":"temp_config(io: IO::Memory.new) do\n yield\nend"}},{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L5"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Generate a new migration using the passed in migration name.\\n\\nThe migration name must be CamelCase. No other options are available.\\n\\nExamples:\\n\\n lucky gen.migration CreateUsers\\n lucky gen.migration AddAgeToUsers\\n lucky gen.migration MakeUserNameOptional\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L3"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.migration\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L4"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a new migration\""}}],"instance_methods":[{"html_id":"call(name:String|Nil=nil)-instance-method","name":"call","abstract":false,"args":[{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil"}],"args_string":"(name : String | Nil = nil)","args_html":"(name : String | Nil = nil)","location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L28"},"def":{"name":"call","args":[{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil"}],"visibility":"Public","body":"Avram::Migrator.run do\n name = name || ARGV.first?\n if name\n Avram::Migrator::MigrationGenerator.new(name: name).generate\n else\n raise((\"Migration name is required. Example: lucky gen.migration CreateUsers\".colorize(:red)).to_s)\n end\nend"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L3"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"settings-instance-method","name":"settings","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"types":[{"html_id":"avram/Gen/Migration/HabitatSettings","path":"Gen/Migration/HabitatSettings.html","kind":"class","full_name":"Gen::Migration::HabitatSettings","name":"HabitatSettings","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L18"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen/Migration","kind":"class","full_name":"Gen::Migration","name":"Migration"},"class_methods":[{"html_id":"io:IO-class-method","name":"io","abstract":false,"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@@io.not_nil!"}},{"html_id":"io=(value:IO)-class-method","name":"io=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"IO"}],"args_string":"(value : IO)","args_html":"(value : IO)","def":{"name":"io=","args":[{"name":"value","external_name":"value","restriction":"IO"}],"visibility":"Public","body":"@@io = value"}},{"html_id":"io?-class-method","name":"io?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use io in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use io in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"io?","visibility":"Public","body":"@@io"}},{"html_id":"to_h-class-method","name":"to_h","doc":"Generates a hash using the provided values","summary":"

Generates a hash using the provided values

","abstract":false,"def":{"name":"to_h","visibility":"Public","body":"{\"io\" => io}"}}]}]},{"html_id":"avram/Gen/Mixins","path":"Gen/Mixins.html","kind":"module","full_name":"Gen::Mixins","name":"Mixins","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"types":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","path":"Gen/Mixins/MigrationWithColumns.html","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SUPPORTED_TYPES","name":"SUPPORTED_TYPES","value":"{\"Bool\", \"Float64\", \"Int16\", \"Int32\", \"Int64\", \"String\", \"Time\", \"UUID\", \"JSON::Any\"}"}],"including_types":[{"html_id":"avram/Gen/Model","kind":"class","full_name":"Gen::Model","name":"Model"},{"html_id":"avram/Gen/Resource/Browser","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser"}],"namespace":{"html_id":"avram/Gen/Mixins","kind":"module","full_name":"Gen::Mixins","name":"Mixins"},"instance_methods":[{"html_id":"create_migration-instance-method","name":"create_migration","abstract":false,"location":{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L4"},"def":{"name":"create_migration","visibility":"Public","body":"(Avram::Migrator::MigrationGenerator.new(\"Create#{pluralized_name}\", migrate_contents: migrate_contents, rollback_contents: rollback_contents)).generate"}}]}]},{"html_id":"avram/Gen/Model","path":"Gen/Model.html","kind":"class","full_name":"Gen::Model","name":"Model","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"}],"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.model\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L11"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a model, query, and operations (save and delete)\""}}],"instance_methods":[{"html_id":"call(io:IO=STDOUT)-instance-method","name":"call","abstract":false,"args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"args_string":"(io : IO = STDOUT)","args_html":"(io : IO = STDOUT)","location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L14"},"def":{"name":"call","args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"@io = io\nif valid?\n template.render(\"./src/\")\n create_migration\n display_success_messages\nelse\n io.puts(@error.colorize(:red))\nend\n"}},{"html_id":"help_message-instance-method","name":"help_message","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L24"},"def":{"name":"help_message","visibility":"Public","body":"\"#{summary}\\n\\nExample:\\n\\n lucky gen.model Project title:String description:String? completed:Bool priority:Int32\""}},{"html_id":"io:IO-instance-method","name":"io","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L12"},"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@io"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}]},{"html_id":"avram/Gen/Resource","path":"Gen/Resource.html","kind":"module","full_name":"Gen::Resource","name":"Resource","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"types":[{"html_id":"avram/Gen/Resource/Browser","path":"Gen/Resource/Browser.html","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"}],"namespace":{"html_id":"avram/Gen/Resource","kind":"module","full_name":"Gen::Resource","name":"Resource"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.resource.browser\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L11"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a resource (model, operation, query, actions, and pages)\""}}],"instance_methods":[{"html_id":"call(io:IO=STDOUT)-instance-method","name":"call","abstract":false,"args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"args_string":"(io : IO = STDOUT)","args_html":"(io : IO = STDOUT)","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L34"},"def":{"name":"call","args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"begin\n @io = io\n validate!\n generate_resource\n io.puts(\"\\nYou will need to run the #{\"lucky db.migrate\".colorize.green} task next\")\n display_path_to_resource\nrescue e : InvalidOption\n io.puts(e.message.colorize.red)\nend"}},{"html_id":"help_message-instance-method","name":"help_message","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L20"},"def":{"name":"help_message","visibility":"Public","body":"\"#{summary}\\n\\nRequires the name of the resource and list of database columns. Columns\\nare passed as column_name:ColumnType. Where ColumnType are one of the\\nsupported Avram datatypes.\\n\\nExample:\\n\\n lucky gen.resource.browser Project title:String description:String? completed:Bool priority:Int32\""}},{"html_id":"io:IO-instance-method","name":"io","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L12"},"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@io"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}],"types":[{"html_id":"avram/Gen/Resource/Browser/InvalidOption","path":"Gen/Resource/Browser/InvalidOption.html","kind":"class","full_name":"Gen::Resource::Browser::InvalidOption","name":"InvalidOption","abstract":false,"superclass":{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L14"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen/Resource/Browser","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser"},"constructors":[{"html_id":"new(message:String)-class-method","name":"new","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(message : String)","args_html":"(message : String)","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L15"},"def":{"name":"new","args":[{"name":"message","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]}]},{"html_id":"avram/Int16","path":"Int16.html","kind":"struct","full_name":"Int16","name":"Int16","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int16_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/int16_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L13"},{"filename":"src/avram/charms/int16_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L14"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int16/Lucky","path":"Int16/Lucky.html","kind":"module","full_name":"Int16::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int16","kind":"struct","full_name":"Int16","name":"Int16"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int16).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int16)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16)","args_html":"(value : Int16)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:Int16)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16)","args_html":"(value : Int16)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"visibility":"Public","body":"SuccessfulCast(Int16).new(value)"}},{"html_id":"parse(values:Array(Int16))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"args_string":"(values : Array(Int16))","args_html":"(values : Array(Int16))","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int16)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int16).new(value.to_i16)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L32"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int16).new(value.to_i16)\nrescue OverflowError\n FailedCast.new\nend"}},{"html_id":"to_db(value:Int16):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16) : String","args_html":"(value : Int16) : String","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L38"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int16))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"args_string":"(values : Array(Int16))","args_html":"(values : Array(Int16))","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L42"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int16/Lucky/ColumnType","path":"Int16/Lucky/ColumnType.html","kind":"alias","full_name":"Int16::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int16","aliased_html":"Int16","const":false,"namespace":{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"}},{"html_id":"avram/Int16/Lucky/Criteria","path":"Int16/Lucky/Criteria.html","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L46"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"}],"namespace":{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L47"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L49"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L58"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Int32","path":"Int32.html","kind":"struct","full_name":"Int32","name":"Int32","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int32_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/int32_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L19"},{"filename":"src/avram/charms/int32_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L20"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int32/Lucky","path":"Int32/Lucky.html","kind":"module","full_name":"Int32::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int32","kind":"struct","full_name":"Int32","name":"Int32"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int32).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int32)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int32).new(value.to_i)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Int32).new(value)"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L28"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int32).new(value.to_i32)\nrescue OverflowError\n FailedCast.new\nend"}},{"html_id":"parse(values:Array(Int32))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"args_string":"(values : Array(Int32))","args_html":"(values : Array(Int32))","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L34"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int32)).new(values)"}},{"html_id":"to_db(value:Int32):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32) : String","args_html":"(value : Int32) : String","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L38"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int32))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"args_string":"(values : Array(Int32))","args_html":"(values : Array(Int32))","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L42"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int32/Lucky/ColumnType","path":"Int32/Lucky/ColumnType.html","kind":"alias","full_name":"Int32::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int32","aliased_html":"Int32","const":false,"namespace":{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"}},{"html_id":"avram/Int32/Lucky/Criteria","path":"Int32/Lucky/Criteria.html","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L46"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"subclasses":[{"html_id":"avram/Enum/Lucky/Criteria","kind":"class","full_name":"Enum::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L47"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L48"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L50"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L59"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Int64","path":"Int64.html","kind":"struct","full_name":"Int64","name":"Int64","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int64_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/int64_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L25"},{"filename":"src/avram/charms/int64_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L26"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int64/Lucky","path":"Int64/Lucky.html","kind":"module","full_name":"Int64::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int64","kind":"struct","full_name":"Int64","name":"Int64"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int64).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int64)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"SuccessfulCast(Int64).new(value)"}},{"html_id":"parse(values:Array(Int64))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"args_string":"(values : Array(Int64))","args_html":"(values : Array(Int64))","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int64)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int64).new(value.to_i64)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L32"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Int64).new(value.to_i64)"}},{"html_id":"to_db(value:Int64):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64) : String","args_html":"(value : Int64) : String","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int64))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"args_string":"(values : Array(Int64))","args_html":"(values : Array(Int64))","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L40"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int64/Lucky/ColumnType","path":"Int64/Lucky/ColumnType.html","kind":"alias","full_name":"Int64::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int64","aliased_html":"Int64","const":false,"namespace":{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"}},{"html_id":"avram/Int64/Lucky/Criteria","path":"Int64/Lucky/Criteria.html","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L44"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L45"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L46"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L48"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L57"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Nil","path":"Nil.html","kind":"struct","full_name":"Nil","name":"Nil","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/object.cr#L32"},{"filename":"src/avram/blank_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L37"},{"filename":"src/avram/object_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L50"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"The `Nil` type has only one possible value: `nil`.\n\n`nil` is commonly used to represent the absence of a value.\nFor example, `String#index` returns the position of the character or `nil` if it's not\nin the string:\n\n```\nstr = \"Hello world\"\nstr.index 'e' # => 1\nstr.index 'a' # => nil\n```\n\nIn the above example, trying to invoke a method on the returned value will\ngive a compile time error unless both `Int32` and `Nil` define that method:\n\n```\nstr = \"Hello world\"\nidx = str.index 'e'\nidx + 1 # Error: undefined method '+' for Nil\n```\n\nThe language and the standard library provide short, readable, easy ways to deal with `nil`,\nsuch as `Object#try` and `Object#not_nil!`:\n\n```\nstr = \"Hello world\"\n\n# The index of 'e' in str or 0 if not found\nidx1 = str.index('e') || 0\n\nidx2 = str.index('a')\nif idx2\n # Compiles: idx2 can't be nil here\n idx2 + 1\nend\n\n# Tell the compiler that we are sure the returned\n# value is not nil: raises a runtime exception\n# if our assumption doesn't hold.\nidx3 = str.index('o').not_nil!\n```\n\nSee [`Nil` literal](https://crystal-lang.org/reference/syntax_and_semantics/literals/nil.html) in the language reference.","summary":"

The Nil type has only one possible value: nil.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L55"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/Object","path":"Object.html","kind":"class","full_name":"Object","name":"Object","abstract":true,"ancestors":[{"html_id":"avram/Lucky/Memoizable","kind":"module","full_name":"Lucky::Memoizable","name":"Memoizable"},{"html_id":"avram/Lucky/QuickDef","kind":"module","full_name":"Lucky::QuickDef","name":"QuickDef"},{"html_id":"avram/Colorize/ObjectExtensions","kind":"module","full_name":"Colorize::ObjectExtensions","name":"ObjectExtensions"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/object.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Colorize/ObjectExtensions","kind":"module","full_name":"Colorize::ObjectExtensions","name":"ObjectExtensions"},{"html_id":"avram/Lucky/Memoizable","kind":"module","full_name":"Lucky::Memoizable","name":"Memoizable"},{"html_id":"avram/Lucky/QuickDef","kind":"module","full_name":"Lucky::QuickDef","name":"QuickDef"}],"doc":"`Object` is the base type of all Crystal objects.","summary":"

Object is the base type of all Crystal objects.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L14"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/Slice","path":"Slice.html","kind":"struct","full_name":"Slice(T)","name":"Slice","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"},{"html_id":"avram/Indexable","kind":"module","full_name":"Indexable","name":"Indexable"},{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"},{"html_id":"avram/Iterable","kind":"module","full_name":"Iterable","name":"Iterable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L61"},{"filename":"src/avram/charms/slice_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"}],"doc":"A `Slice` is a `Pointer` with an associated size.\n\nWhile a pointer is unsafe because no bound checks are performed when reading from and writing to it,\nreading from and writing to a slice involve bound checks.\nIn this way, a slice is a safe alternative to `Pointer`.\n\nA Slice can be created as read-only: trying to write to it\nwill raise. For example the slice of bytes returned by\n`String#to_slice` is read-only.","summary":"

A Slice is a Pointer with an associated size.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L62"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"empty?"}}],"types":[{"html_id":"avram/Slice/Lucky","path":"Slice/Lucky.html","kind":"module","full_name":"Slice::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Slice","kind":"struct","full_name":"Slice(T)","name":"Slice"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Bytes).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Bytes)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"parse(value.to_slice)"}},{"html_id":"parse(value:Bytes)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"SuccessfulCast(Bytes).new(value)"}},{"html_id":"to_db(value:Bytes)-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L26"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"ssize = (value.size * 2) + 2\nString.new(ssize) do |buffer|\n buffer[0] = '\\\\'.ord.to_u8\n buffer[1] = 'x'.ord.to_u8\n value.hexstring(buffer + 2)\n {ssize, ssize}\nend\n"}},{"html_id":"to_db(value:String):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"value"}}],"types":[{"html_id":"avram/Slice/Lucky/ColumnType","path":"Slice/Lucky/ColumnType.html","kind":"alias","full_name":"Slice::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Slice(UInt8)","aliased_html":"Slice(UInt8)","const":false,"namespace":{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"}},{"html_id":"avram/Slice/Lucky/Criteria","path":"Slice/Lucky/Criteria.html","kind":"class","full_name":"Slice::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]},{"html_id":"avram/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/string_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/string_extensions.cr#L1"},{"filename":"src/avram/charms/string_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nA string might end up being composed of bytes which form an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but every\nbyte that doesn't start a valid UTF-8 byte sequence is interpreted as though\nit encodes the Unicode replacement character (U+FFFD) by itself. For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.\n\nNote that this interpretation only applies to methods inside Crystal; calling\n`#to_slice` or `#to_unsafe`, e.g. when passing a string to a C library, will\nexpose the invalid UTF-8 byte sequences. In particular, `Regex`'s underlying\nengine may reject strings that are not valid UTF-8, or it may invoke undefined\nbehavior on invalid strings. If this is undesired, `#scrub` could be used to\nremove the offending byte sequences first.","summary":"

A String represents an immutable sequence of UTF-8 characters.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"types":[{"html_id":"avram/String/Lucky","path":"String/Lucky.html","kind":"module","full_name":"String::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/String","kind":"class","full_name":"String","name":"String"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, String).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"SuccessfulCast(String).new(value)"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"SuccessfulCast(Array(String)).new(values)"}},{"html_id":"to_db(value:String):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L22"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"value"}},{"html_id":"to_db(values:Array(String))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L26"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/String/Lucky/ColumnType","path":"String/Lucky/ColumnType.html","kind":"alias","full_name":"String::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"String","aliased_html":"String","const":false,"namespace":{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"}},{"html_id":"avram/String/Lucky/Criteria","path":"String/Lucky/Criteria.html","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L30"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"ilike(value:String):T-instance-method","name":"ilike","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : T","args_html":"(value : String) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L37"},"def":{"name":"ilike","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Ilike.new(column, value))"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L31"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"like(value:String):T-instance-method","name":"like","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : T","args_html":"(value : String) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L33"},"def":{"name":"like","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Like.new(column, value))"}},{"html_id":"lower-instance-method","name":"lower","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L42"},"def":{"name":"lower","visibility":"Public","body":"Criteria(T, V).new(rows, \"LOWER(#{column})\")"}},{"html_id":"trim-instance-method","name":"trim","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L43"},"def":{"name":"trim","visibility":"Public","body":"Criteria(T, String).new(rows, \"TRIM(#{column})\")"}},{"html_id":"upper-instance-method","name":"upper","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L41"},"def":{"name":"upper","visibility":"Public","body":"Criteria(T, V).new(rows, \"UPPER(#{column})\")"}}]}]}]},{"html_id":"avram/Time","path":"Time.html","kind":"struct","full_name":"Time","name":"Time","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L7"},{"filename":"src/avram/charms/time_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"}],"doc":"`Time` represents a date-time instant in\n[incremental time](https://www.w3.org/International/articles/definitions-time/#incremental_time)\nobserved in a specific time zone.\n\nThe calendaric calculations are based on the rules of the proleptic Gregorian\ncalendar as specified in [ISO 8601](http://xml.coverpages.org/ISO-FDIS-8601.pdf).\nLeap seconds are ignored.\n\nInternally, the time is stored as an `Int64` representing seconds from epoch\n(`0001-01-01 00:00:00.0 UTC`) and an `Int32` representing\nnanosecond-of-second with value range `0..999_999_999`.\n\nThe supported date range is `0001-01-01 00:00:00.0` to\n`9999-12-31 23:59:59.999_999_999` in any local time zone.\n\n### Telling the Time\n\nThere are several methods to retrieve a `Time` instance representing the\ncurrent time:\n\n```\nTime.utc # returns the current time in UTC\nTime.local Time::Location.load(\"Europe/Berlin\") # returns the current time in time zone Europe/Berlin\nTime.local # returns the current time in current time zone\n```\n\nIt is generally recommended to keep instances in UTC and only apply a\nlocal time zone when formatting for user display, unless the domain logic\nrequires having a specific time zone (for example for calendaric operations).\n\n### Creating a Specific Instant\n\n`Time` instances representing a specific instant can be created by\n`.utc` or `.new` with the date-time specified as individual arguments:\n\n```\ntime = Time.utc(2016, 2, 15, 10, 20, 30)\ntime.to_s # => \"2016-02-15 10:20:30 UTC\"\ntime = Time.local(2016, 2, 15, 10, 20, 30, location: Time::Location.load(\"Europe/Berlin\"))\ntime.to_s # => \"2016-02-15 10:20:30 +01:00\"\n# The time-of-day can be omitted and defaults to midnight (start of day):\ntime = Time.utc(2016, 2, 15)\ntime.to_s # => \"2016-02-15 00:00:00 UTC\"\n```\n\n### Retrieving Time Information\n\nEach `Time` instance allows querying calendar data:\n\n```\ntime = Time.utc(2016, 2, 15, 10, 20, 30)\ntime.year # => 2016\ntime.month # => 2\ntime.day # => 15\ntime.hour # => 10\ntime.minute # => 20\ntime.second # => 30\ntime.millisecond # => 0\ntime.nanosecond # => 0\ntime.day_of_week # => Time::DayOfWeek::Monday\ntime.day_of_year # => 46\ntime.monday? # => true\ntime.time_of_day # => 10:20:30\n```\n\nFor querying if a time is at a specific day of week, `Time` offers named\npredicate methods, delegating to `#day_of_week`:\n\n```\ntime.monday? # => true\n# ...\ntime.sunday? # => false\n```\n\n### Time Zones\n\nEach time is attached to a specific time zone, represented by a `Location`\n(see `#location`).\n`#zone` returns the time zone observed in this location at the current time\n(i.e. the instant represented by this `Time`).\n`#offset` returns the offset of the current zone in seconds.\n\n```\ntime = Time.local(2018, 3, 8, 22, 5, 13, location: Time::Location.load(\"Europe/Berlin\"))\ntime # => 2018-03-08 22:05:13 +01:00 Europe/Berlin\ntime.location # => #\ntime.zone # => #\ntime.offset # => 3600\n```\n\nUsing `.utc`, the location is `Time::Location::UTC`:\n\n```\ntime = Time.utc(2018, 3, 8, 22, 5, 13)\ntime # => 2018-03-08 22:05:13.0 UTC\ntime.location # => #\ntime.zone # => #\ntime.offset # => 0\n```\n\nA `Time` instance can be transformed to a different time zone while retaining\nthe same instant using `#in`:\n\n```\ntime_de = Time.local(2018, 3, 8, 22, 5, 13, location: Time::Location.load(\"Europe/Berlin\"))\ntime_ar = time_de.in Time::Location.load(\"America/Buenos_Aires\")\ntime_de # => 2018-03-08 22:05:13 +01:00 Europe/Berlin\ntime_ar # => 2018-03-08 18:05:13 -03:00 America/Buenos_Aires\n```\n\nBoth `Time` instances show a different local date-time, but they represent\nthe same date-time in the instant time-line, therefore they are considered\nequal:\n\n```\ntime_de.to_utc # => 2018-03-08 21:05:13 UTC\ntime_ar.to_utc # => 2018-03-08 21:05:13 UTC\ntime_de == time_ar # => true\n```\n\nThere are also two special methods for converting to UTC and local time zone:\n\n```\ntime.to_utc # equals time.in(Location::UTC)\ntime.to_local # equals time.in(Location.local)\n```\n\n`#to_local_in` allows changing the time zone while keeping\nthe same local date-time (wall clock) which results in a different instant\non the time line.\n\n### Formatting and Parsing Time\n\nTo make date-time instances exchangeable between different computer systems\nor readable to humans, they are usually converted to and from a string\nrepresentation.\n\nThe method `#to_s` formats the date-time according to a specified pattern.\n\n```\ntime = Time.utc(2015, 10, 12, 10, 30, 0)\ntime.to_s(\"%Y-%m-%d %H:%M:%S %:z\") # => \"2015-10-12 10:30:00 +00:00\"\n```\n\nSimilarly, `Time.parse` and `Time.parse!` are used to construct a `Time` instance from date-time\ninformation in a string, according to a specified pattern:\n\n```\nTime.parse(\"2015-10-12 10:30:00 +00:00\", \"%Y-%m-%d %H:%M:%S %z\", Time::Location::UTC)\nTime.parse!(\"2015-10-12 10:30:00 +00:00\", \"%Y-%m-%d %H:%M:%S %z\")\n```\n\nSee `Time::Format` for all directives.\n\n### Calculations\n\n```\nTime.utc(2015, 10, 10) - 5.days # => 2015-10-05 00:00:00 +00:00\n\nspan = Time.utc(2015, 10, 10) - Time.utc(2015, 9, 10)\nspan.days # => 30\nspan.total_hours # => 720\nspan.total_minutes # => 43200\n```\n\n## Measuring Time\n\nThe typical time representation provided by the operating system is based on\na \"wall clock\" which is subject to changes for clock synchronization.\nThis can result in discontinuous jumps in the time-line making it not\nsuitable for accurately measuring elapsed time.\n\nInstances of `Time` are focused on telling time – using a \"wall clock\".\nWhen `Time.local` is called multiple times, the difference between the\nreturned instances is not guaranteed to equal to the time elapsed between\nmaking the calls; even the order of the returned `Time` instances might\nnot reflect invocation order.\n\n```\nt1 = Time.utc\n# operation that takes 1 minute\nt2 = Time.utc\nt2 - t1 # => ?\n```\n\nThe resulting `Time::Span` could be anything, even negative, if the\ncomputer's wall clock has changed between both calls.\n\nAs an alternative, the operating system also provides a monotonic clock.\nIts time-line has no specified starting point but is strictly linearly\nincreasing.\n\nThis monotonic clock should always be used for measuring elapsed time.\n\nA reading from this clock can be taken using `.monotonic`:\n\n```\nt1 = Time.monotonic\n# operation that takes 1 minute\nt2 = Time.monotonic\nt2 - t1 # => 1.minute (approximately)\n```\n\nThe execution time of a block can be measured using `.measure`:\n\n```\nelapsed_time = Time.measure do\n # operation that takes 20 milliseconds\nend\nelapsed_time # => 20.milliseconds (approximately)\n```","summary":"

Time represents a date-time instant in incremental time observed in a specific time zone.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L8"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Time/Lucky","path":"Time/Lucky.html","kind":"module","full_name":"Time::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"TIME_FORMATS","name":"TIME_FORMATS","value":"[Time::Format::ISO_8601_DATE_TIME, Time::Format::RFC_2822, Time::Format::RFC_3339, Time::Format.new(\"%Y-%m-%dT%H:%M:%S\", Time::Location::UTC), Time::Format.new(\"%Y-%m-%dT%H:%M\", Time::Location::UTC), Time::Format::HTTP_DATE, Time::Format::ISO_8601_DATE, Time::Format::ISO_8601_TIME]"}],"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Time","kind":"struct","full_name":"Time","name":"Time"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L25"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Time).new(query, column)"}},{"html_id":"try_parsing_with_default_formatters(value:String)-class-method","name":"try_parsing_with_default_formatters","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L42"},"def":{"name":"try_parsing_with_default_formatters","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"TIME_FORMATS.find do |format|\n begin\n format.parse(value)\n rescue e : Time::Format::Error\n nil\n end\nend.try do |format|\n SuccessfulCast.new((format.parse(value)).to_utc)\nend"}},{"html_id":"try_parsing_with_string_formats(value)-class-method","name":"try_parsing_with_string_formats","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L54"},"def":{"name":"try_parsing_with_string_formats","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"Avram.settings.time_formats.find do |format|\n begin\n Time.parse(value, format, Time::Location.load(\"UTC\"))\n rescue e : Time::Format::Error\n nil\n end\nend.try do |format|\n SuccessfulCast.new((Time.parse(value, format, Time::Location.load(\"UTC\"))).to_utc)\nend"}}],"instance_methods":[{"html_id":"from_db!(value:Time)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time)","args_html":"(value : Time)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L29"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Time"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String):SuccessfulCast(Time)|FailedCast-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : SuccessfulCast(Time) | FailedCast","args_html":"(value : String) : SuccessfulCast(Time) | FailedCast","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L33"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"SuccessfulCast(Time) | FailedCast","visibility":"Public","body":"((try_parsing_with_string_formats(value)) || (try_parsing_with_default_formatters(value))) || FailedCast.new"}},{"html_id":"parse(value:Time)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time)","args_html":"(value : Time)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L66"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Time"}],"visibility":"Public","body":"SuccessfulCast(Time).new(value)"}},{"html_id":"parse(values:Array(Time))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Time)"}],"args_string":"(values : Array(Time))","args_html":"(values : Array(Time))","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L70"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Time)"}],"visibility":"Public","body":"SuccessfulCast(Array(Time)).new(values)"}},{"html_id":"to_db(value:Time):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time) : String","args_html":"(value : Time) : String","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L74"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Time"}],"return_type":"String","visibility":"Public","body":"value.to_s(\"%F %X.%6N %z\")"}}],"types":[{"html_id":"avram/Time/Lucky/ColumnType","path":"Time/Lucky/ColumnType.html","kind":"alias","full_name":"Time::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Time","aliased_html":"Time","const":false,"namespace":{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"}},{"html_id":"avram/Time/Lucky/Criteria","path":"Time/Lucky/Criteria.html","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/ExtractCriteria","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L78"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/ExtractCriteria","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria"}],"namespace":{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"as_date-instance-method","name":"as_date","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L82"},"def":{"name":"as_date","visibility":"Public","body":"Criteria(T, String).new(rows, \"DATE(#{column})\")"}},{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L79"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"extract(chrono_unit:Avram::ChronoUnits)-instance-method","name":"extract","abstract":false,"args":[{"name":"chrono_unit","external_name":"chrono_unit","restriction":"Avram::ChronoUnits"}],"args_string":"(chrono_unit : Avram::ChronoUnits)","args_html":"(chrono_unit : Avram::ChronoUnits)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract","args":[{"name":"chrono_unit","external_name":"chrono_unit","restriction":"Avram::ChronoUnits"}],"visibility":"Public","body":"chrono_unit_in_sql_format = chrono_unit.to_s.underscore\napplied_operation = \"extract(#{chrono_unit_in_sql_format} from #{@column})\"\ncase chrono_unit\nwhen .julian?, .second?, .milliseconds?, .epoch?\n Criteria(T, Float64).new(rows, applied_operation)\nelse\n Criteria(T, Int32).new(rows, applied_operation)\nend\n"}},{"html_id":"extract(symbol:Symbol)-instance-method","name":"extract","abstract":false,"args":[{"name":"symbol","external_name":"symbol","restriction":"Symbol"}],"args_string":"(symbol : Symbol)","args_html":"(symbol : Symbol)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract","args":[{"name":"symbol","external_name":"symbol","restriction":"Symbol"}],"visibility":"Public","body":"if \"[century, day, decade, dow, doy, epoch, hour, isodow, isoyear, julian, microseconds, millennium, milliseconds, minute, month, quarter, second, timezone, timezone_hour, timezone_minute, week, year]\".includes?(symbol.to_s)\nelse\n raise(ArgumentError.new(\"Illegal value #{symbol} as a chrono unit. Allowed values are [century, day, decade, dow, doy, epoch, hour, isodow, isoyear, julian, microseconds, millennium, milliseconds, minute, month, quarter, second, timezone, timezone_hour, timezone_minute, week, year]\"))\nend\nchrono_unit_enum_member = symbol.to_s.camelcase\nextract(Avram::ChronoUnits.parse(chrono_unit_enum_member))\n"}},{"html_id":"extract_century-instance-method","name":"extract_century","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_century","visibility":"Public","body":"extract(:century)"}},{"html_id":"extract_day-instance-method","name":"extract_day","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_day","visibility":"Public","body":"extract(:day)"}},{"html_id":"extract_decade-instance-method","name":"extract_decade","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_decade","visibility":"Public","body":"extract(:decade)"}},{"html_id":"extract_dow-instance-method","name":"extract_dow","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_dow","visibility":"Public","body":"extract(:dow)"}},{"html_id":"extract_doy-instance-method","name":"extract_doy","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_doy","visibility":"Public","body":"extract(:doy)"}},{"html_id":"extract_epoch-instance-method","name":"extract_epoch","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_epoch","visibility":"Public","body":"extract(:epoch)"}},{"html_id":"extract_hour-instance-method","name":"extract_hour","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_hour","visibility":"Public","body":"extract(:hour)"}},{"html_id":"extract_isodow-instance-method","name":"extract_isodow","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_isodow","visibility":"Public","body":"extract(:isodow)"}},{"html_id":"extract_isoyear-instance-method","name":"extract_isoyear","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_isoyear","visibility":"Public","body":"extract(:isoyear)"}},{"html_id":"extract_julian-instance-method","name":"extract_julian","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_julian","visibility":"Public","body":"extract(:julian)"}},{"html_id":"extract_microseconds-instance-method","name":"extract_microseconds","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_microseconds","visibility":"Public","body":"extract(:microseconds)"}},{"html_id":"extract_millennium-instance-method","name":"extract_millennium","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_millennium","visibility":"Public","body":"extract(:millennium)"}},{"html_id":"extract_milliseconds-instance-method","name":"extract_milliseconds","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_milliseconds","visibility":"Public","body":"extract(:milliseconds)"}},{"html_id":"extract_minute-instance-method","name":"extract_minute","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_minute","visibility":"Public","body":"extract(:minute)"}},{"html_id":"extract_month-instance-method","name":"extract_month","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_month","visibility":"Public","body":"extract(:month)"}},{"html_id":"extract_quarter-instance-method","name":"extract_quarter","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_quarter","visibility":"Public","body":"extract(:quarter)"}},{"html_id":"extract_second-instance-method","name":"extract_second","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_second","visibility":"Public","body":"extract(:second)"}},{"html_id":"extract_timezone-instance-method","name":"extract_timezone","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone","visibility":"Public","body":"extract(:timezone)"}},{"html_id":"extract_timezone_hour-instance-method","name":"extract_timezone_hour","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone_hour","visibility":"Public","body":"extract(:timezone_hour)"}},{"html_id":"extract_timezone_minute-instance-method","name":"extract_timezone_minute","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone_minute","visibility":"Public","body":"extract(:timezone_minute)"}},{"html_id":"extract_week-instance-method","name":"extract_week","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_week","visibility":"Public","body":"extract(:week)"}},{"html_id":"extract_year-instance-method","name":"extract_year","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_year","visibility":"Public","body":"extract(:year)"}}]}]}]},{"html_id":"avram/UUID","path":"UUID.html","kind":"struct","full_name":"UUID","name":"UUID","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/uuid_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/uuid_extensions.cr#L1"},{"filename":"src/avram/blank_extensions.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L49"},{"filename":"src/avram/charms/uuid_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"doc":"Represents a UUID (Universally Unique IDentifier).\n\nNOTE: To use `UUID`, you must explicitly import it with `require \"uuid\"`","summary":"

Represents a UUID (Universally Unique IDentifier).

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L50"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"false"}}],"types":[{"html_id":"avram/UUID/Lucky","path":"UUID/Lucky.html","kind":"module","full_name":"UUID::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/UUID","kind":"struct","full_name":"UUID","name":"UUID"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, UUID).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:UUID)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"UUID"}],"args_string":"(value : UUID)","args_html":"(value : UUID)","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"UUID"}],"visibility":"Public","body":"SuccessfulCast(UUID).new(value)"}},{"html_id":"parse(values:Array(UUID))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"args_string":"(values : Array(UUID))","args_html":"(values : Array(UUID))","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"visibility":"Public","body":"SuccessfulCast(Array(UUID)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(UUID).new(UUID.new(value))\nrescue\n FailedCast.new\nend"}},{"html_id":"to_db(value:UUID):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"UUID"}],"args_string":"(value : UUID) : String","args_html":"(value : UUID) : String","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L28"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"UUID"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(UUID))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"args_string":"(values : Array(UUID))","args_html":"(values : Array(UUID))","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L32"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/UUID/Lucky/ColumnType","path":"UUID/Lucky/ColumnType.html","kind":"alias","full_name":"UUID::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"UUID","aliased_html":"UUID","const":false,"namespace":{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}},{"html_id":"avram/UUID/Lucky/Criteria","path":"UUID/Lucky/Criteria.html","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L36"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L37"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}}]}]}]}]}} \ No newline at end of file diff --git a/search-index.js b/search-index.js index e5102c03f..73a1a1302 100644 --- a/search-index.js +++ b/search-index.js @@ -1 +1 @@ -crystal_doc_search_index_callback({"repository_name":"avram","body":"# Avram\n\n[![API Documentation Website](https://img.shields.io/website?down_color=red&down_message=Offline&label=API%20Documentation&up_message=Online&url=https%3A%2F%2Fluckyframework.github.io%2Favram%2F)](https://luckyframework.github.io/avram)\n\n### Why Avram?\n\nThe name comes from [Henriette Avram](https://en.wikipedia.org/wiki/Henriette_Avram).\n\n> Henriette Davidson Avram (October 7, 1919 – April 22, 2006) was a computer programmer and systems analyst who developed the MARC format (Machine Readable Cataloging), the international data standard for bibliographic and holdings information in libraries.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n avram:\n github: luckyframework/avram\n```\n\n## Usage\n\n```crystal\nrequire \"avram\"\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/luckyframework/avram/fork )\n1. Create your feature branch (git checkout -b my-new-feature)\n1. Install docker and docker-compose: https://docs.docker.com/compose/install/\n1. Run `script/setup`\n1. Make your changes\n1. Run `script/test` to run the specs, build shards, and check formatting\n1. Commit your changes (git commit -am 'Add some feature')\n1. Push to the branch (git push origin my-new-feature)\n1. Create a new Pull Request\n\n## Testing\n\nTo run the tests:\n\n1. Install docker and docker-compose: https://docs.docker.com/compose/install/\n1. Run `script/setup` to set up the docker environment\n1. Run `script/test` to run the specs, build shards, and check formatting\n\nYou can run individual tests like this: `docker-compose run --rm app crystal spec path/to/spec.cr`\n\n> Remember to run `docker-compose down` when you're done. This will stop the\n> Crystal container.\n\n## Contributors\n\n- [paulcsmith](https://github.com/paulcsmith) Paul Smith - creator, maintainer\n- [mikeeus](https://github.com/mikeeus) Mikias Abera - contributor\n","program":{"html_id":"avram/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"avram","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Array","path":"Array.html","kind":"class","full_name":"Array(T)","name":"Array","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"},{"html_id":"avram/Indexable","kind":"module","full_name":"Indexable","name":"Indexable"},{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"},{"html_id":"avram/Iterable","kind":"module","full_name":"Iterable","name":"Iterable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L55"},{"filename":"src/avram/charms/array_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/array_extensions.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L19"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"}],"doc":"An `Array` is an ordered, integer-indexed collection of objects of type T.\n\nArray indexing starts at 0. A negative index is assumed to be\nrelative to the end of the array: -1 indicates the last element,\n-2 is the next to last element, and so on.\n\nAn `Array` can be created using the usual `new` method (several are provided), or with an array literal:\n\n```\nArray(Int32).new # => []\n[1, 2, 3] # Array(Int32)\n[1, \"hello\", 'x'] # Array(Int32 | String | Char)\n```\n\nSee [`Array` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/array.html) in the language reference.\n\nAn `Array` can have mixed types, meaning T will be a union of types, but these are determined\nwhen the array is created, either by specifying T or by using an array literal. In the latter\ncase, T will be set to the union of the array literal elements' types.\n\nWhen creating an empty array you must always specify T:\n\n```\n[] of Int32 # same as Array(Int32)\n[] # syntax error\n```\n\nAn `Array` is implemented using an internal buffer of some capacity\nand is reallocated when elements are pushed to it when more capacity\nis needed. This is normally known as a [dynamic array](http://en.wikipedia.org/wiki/Dynamic_array).\n\nYou can use a special array literal syntax with other types too, as long as they define an argless\n`new` method and a `<<` method. `Set` is one such type:\n\n```\nset = Set{1, 2, 3} # => Set{1, 2, 3}\nset.class # => Set(Int32)\n```\n\nThe above is the same as this:\n\n```\nset = Set(typeof(1, 2, 3)).new\nset << 1\nset << 2\nset << 3\n```","summary":"

An Array is an ordered, integer-indexed collection of objects of type T.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","doc":"Proxy to the `T`'s adapter so we can call methods like\n`Array(String).adapter.to_db([\"test\"])`","summary":"

Proxy to the T's adapter so we can call methods like Array(String).adapter.to_db(["test"])

","abstract":false,"location":{"filename":"src/avram/charms/array_extensions.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/array_extensions.cr#L4"},"def":{"name":"adapter","visibility":"Public","body":"T.adapter"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L56"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"empty?"}},{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","doc":"Arrays of any size should be considered present","summary":"

Arrays of any size should be considered present

","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L21"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"false"}}]},{"html_id":"avram/Avram","path":"Avram.html","kind":"module","full_name":"Avram","name":"Avram","abstract":false,"ancestors":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"locations":[{"filename":"src/avram.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L25"},{"filename":"src/avram/chrono_units.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L1"},{"filename":"src/avram/criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L1"},{"filename":"src/avram/database/column_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L1"},{"filename":"src/avram/database/database_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L1"},{"filename":"src/avram/database/table_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L1"},{"filename":"src/avram/errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L1"},{"filename":"src/avram/order_by_clause.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L1"},{"filename":"src/avram/order_by_clause/order_by.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L1"},{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L1"},{"filename":"src/avram/version.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/version.cr#L1"},{"filename":"src/lucky/ext/avram/errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"FailedQueryLog","name":"FailedQueryLog","value":"Log.for(\"failed_query\")"},{"id":"HABITAT_SETTINGS","name":"HABITAT_SETTINGS","value":"[{decl: lazy_load_enabled : Bool = true, example: nil, validation: nil}, {decl: database_to_migrate : Avram::Database.class, example: \"AppDatabase\", validation: nil}, {decl: time_formats : Array(String) = [] of String, example: nil, validation: nil}, {decl: i18n_backend : Avram::I18nBackend = Avram::I18n.new, example: \"Avram::I18n.new\", validation: nil}, {decl: query_cache_enabled : Bool = false, example: nil, validation: nil}] of Nil"},{"id":"Log","name":"Log","value":"::Log.for(Avram)"},{"id":"QueryLog","name":"QueryLog","value":"Log.for(\"query\")"},{"id":"SaveFailedLog","name":"SaveFailedLog","value":"Log.for(\"save_failed\")"},{"id":"VERSION","name":"VERSION","value":"\"1.1.1\""}],"included_modules":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"class_methods":[{"html_id":"configure(&)-class-method","name":"configure","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L26"},"def":{"name":"configure","yields":1,"block_arity":1,"visibility":"Public","body":"yield settings"}},{"html_id":"initialize_logging-class-method","name":"initialize_logging","doc":"This subscribes to several `Pulsar` events.\nThese events are triggered during query and\noperation events","summary":"

This subscribes to several Pulsar events.

","abstract":false,"location":{"filename":"src/avram.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L44"},"def":{"name":"initialize_logging","visibility":"Public","body":"Avram::Events::QueryEvent.subscribe do |event, duration|\n if event.query.starts_with?(\"TRUNCATE\")\n next\n end\n Avram::QueryLog.dexter.info do\n queryable = event.queryable\n log_data = {query: event.query, args: event.args, duration: Pulsar.elapsed_text(duration)}\n if queryable\n {model: queryable}.merge(log_data)\n else\n log_data\n end\n end\nend\nAvram::Events::FailedQueryEvent.subscribe do |event|\n Avram::FailedQueryLog.dexter.error do\n queryable = event.queryable\n log_data = {error_message: event.error_message, query: event.query, args: \"[FILTERED]\"}\n if queryable\n {model: queryable}.merge(log_data)\n else\n log_data\n end\n end\nend\nAvram::Events::SaveFailedEvent.subscribe do |event|\n Avram::SaveFailedLog.dexter.warn do\n {failed_to_save: event.operation_class, validation_errors: event.error_messages_as_string}\n end\nend\n"}},{"html_id":"settings-class-method","name":"settings","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L26"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"instance_methods":[{"html_id":"settings-instance-method","name":"settings","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L26"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"types":[{"html_id":"avram/Avram/AddColumnAttributes","path":"Avram/AddColumnAttributes.html","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes","abstract":false,"locations":[{"filename":"src/avram/add_column_attributes.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/add_column_attributes.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"This module creates methods for each column in a model that map\nto an `Avram::Attribute` as well as methods that fill those attributes\nwith values that comes from params.","summary":"

This module creates methods for each column in a model that map to an Avram::Attribute as well as methods that fill those attributes with values that comes from params.

"},{"html_id":"avram/Avram/Associations","path":"Avram/Associations.html","kind":"module","full_name":"Avram::Associations","name":"Associations","abstract":false,"ancestors":[{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"}],"locations":[{"filename":"src/avram/associations.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations.cr#L3"},{"filename":"src/avram/associations/belongs_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/belongs_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"}],"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Associations/BelongsTo","path":"Avram/Associations/BelongsTo.html","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo","abstract":false,"locations":[{"filename":"src/avram/associations/belongs_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/belongs_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"belongs_to(type_declaration,foreign_key=nil)-macro","name":"belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, foreign_key = nil)","args_html":"(type_declaration, foreign_key = nil)","location":{"filename":"src/avram/associations/belongs_to.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/belongs_to.cr#L2"},"def":{"name":"belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if type_declaration.type.is_a?(Union) %}\n {% model = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% model = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n\n \n{% if !foreign_key %}\n {% foreign_key = \"#{assoc_name}_id\".id %}\n {% end %}\n\n\n column \n{{ foreign_key.id }}\n : \n{{ model }}\n::PrimaryKeyType\n{% if nilable %}?{% end %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name.id }}\n,\n type: \n{{ model }}\n,\n foreign_key: :\n{{ foreign_key.id }}\n,\n relationship_type: :belongs_to\n\n define_belongs_to_private_assoc_getter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key.id }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_public_preloaded_getters(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_preloaded_setter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n define_belongs_to_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key.id }}\n)\n \n"}}]},{"html_id":"avram/Avram/Associations/HasMany","path":"Avram/Associations/HasMany.html","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany","abstract":false,"locations":[{"filename":"src/avram/associations/has_many.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/has_many.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"has_many(type_declaration,through=nil,foreign_key=nil)-macro","name":"has_many","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, through = nil, foreign_key = nil)","args_html":"(type_declaration, through = nil, foreign_key = nil)","location":{"filename":"src/avram/associations/has_many.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/has_many.cr#L2"},"def":{"name":"has_many","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% if (!through.is_a?(NilLiteral)) && ((!through.is_a?(ArrayLiteral)) || through.any? do |item|\n !item.is_a?(SymbolLiteral)\nend) %}\n {% through.raise(\"'through' on #{@type.name} must be given an Array(Symbol). Instead, got: #{through}\\n\\nExample...\\n has_many comments : Comment\\n has_many related_authors : User, through: [:comments, :author]\\n\\nLearn more about associations: https://luckyframework.org/guides/database/models#model-associations\") %}\n {% end %}\n\n \n{% if (!through.is_a?(NilLiteral)) && through.size < 2 %}\n {% through.raise(\"'through' on #{@type.name} must be given at least two items. Instead, got: #{through}\\n\\nExample...\\n has_many comments : Comment\\n has_many related_authors : User, through: [:comments, :author]\\n\\nLearn more about associations: https://luckyframework.org/guides/database/models#model-associations\") %}\n {% end %}\n\n \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if foreign_key %}{% else %}\n {% foreign_key = \"#{(@type.name.underscore.split(\"::\")).last.id}_id\".id %}\n {% end %}\n\n\n \n{% foreign_key = foreign_key.id %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name }}\n,\n type: \n{{ type_declaration.type }}\n,\n foreign_key: :\n{{ foreign_key }}\n,\n through: \n{{ through }}\n,\n relationship_type: :has_many\n\n \n{% model = type_declaration.type %}\n\n\n define_has_many_lazy_loading(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ through }}\n)\n define_has_many_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ through }}\n)\n \n"}}]},{"html_id":"avram/Avram/Associations/HasOne","path":"Avram/Associations/HasOne.html","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne","abstract":false,"locations":[{"filename":"src/avram/associations/has_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/has_one.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"has_one(type_declaration,foreign_key=nil)-macro","name":"has_one","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, foreign_key = nil)","args_html":"(type_declaration, foreign_key = nil)","location":{"filename":"src/avram/associations/has_one.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/associations/has_one.cr#L2"},"def":{"name":"has_one","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if type_declaration.type.is_a?(Union) %}\n {% model = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% model = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n\n \n{% if foreign_key %}{% else %}\n {% foreign_key = \"#{(@type.name.underscore.split(\"::\")).last.id}_id\".id %}\n {% end %}\n\n\n \n{% foreign_key = foreign_key.id %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name.id }}\n,\n type: \n{{ model }}\n,\n foreign_key: :\n{{ foreign_key.id }}\n,\n relationship_type: :has_one\n\n Avram::Associations.__define_public_preloaded_getters(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_preloaded_setter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n define_has_one_private_assoc_getter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ nilable }}\n)\n define_has_one_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n)\n \n"}}]}]},{"html_id":"avram/Avram/Attribute","path":"Avram/Attribute.html","kind":"class","full_name":"Avram::Attribute(T)","name":"Attribute","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/attribute.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/PermittedAttribute","kind":"class","full_name":"Avram::PermittedAttribute(T)","name":"PermittedAttribute"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(name:Symbol,value:T|Nil,param_key:String,param:Array(String)|Avram::Uploadable|String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::Symbol"},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"::String"},{"name":"param","default_value":"nil","external_name":"param","restriction":"::Array(::String) | ::Avram::Uploadable | ::String | ::Nil"}],"args_string":"(name : Symbol, value : T | Nil, param_key : String, param : Array(String) | Avram::Uploadable | String | Nil = nil)","args_html":"(name : Symbol, value : T | Nil, param_key : String, param : Array(String) | Avram::Uploadable | String | Nil = nil)","location":{"filename":"src/avram/attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::Symbol"},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"::String"},{"name":"param","default_value":"nil","external_name":"param","restriction":"::Array(::String) | ::Avram::Uploadable | ::String | ::Nil"}],"visibility":"Public","body":"_ = Attribute(T).allocate\n_.initialize(name, value, param_key, param)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"[](key)-instance-method","name":"[]","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/attribute.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L167"},"def":{"name":"[]","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":"call_value_instead_error_message(\".[key]\")"}},{"html_id":"[]?(key)-instance-method","name":"[]?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/attribute.cr","line_number":171,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L171"},"def":{"name":"[]?","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":"call_value_instead_error_message(\".[key]?\")"}},{"html_id":"add_error(message:String=\"isinvalid\")-instance-method","name":"add_error","abstract":false,"args":[{"name":"message","default_value":"\"is invalid\"","external_name":"message","restriction":"String"}],"args_string":"(message : String = \"is invalid\")","args_html":"(message : String = "is invalid")","location":{"filename":"src/avram/attribute.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L34"},"def":{"name":"add_error","args":[{"name":"message","default_value":"\"is invalid\"","external_name":"message","restriction":"String"}],"visibility":"Public","body":"@errors << message"}},{"html_id":"add_error(message:Proc|Avram::CallableErrorMessage)-instance-method","name":"add_error","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"Proc | Avram::CallableErrorMessage"}],"args_string":"(message : Proc | Avram::CallableErrorMessage)","args_html":"(message : Proc | Avram::CallableErrorMessage)","location":{"filename":"src/avram/attribute.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L38"},"def":{"name":"add_error","args":[{"name":"message","external_name":"message","restriction":"Proc | Avram::CallableErrorMessage"}],"visibility":"Public","body":"message_string = message.call(@name.to_s, @value.to_s)\nadd_error(message_string)\n"}},{"html_id":"allow_blank=(allow_blank:Bool)-instance-method","name":"allow_blank=","doc":"This can be used as an escape hatch when you\nmay have a blank string that's allowed to be saved.","summary":"

This can be used as an escape hatch when you may have a blank string that's allowed to be saved.

","abstract":false,"args":[{"name":"allow_blank","external_name":"allow_blank","restriction":"Bool"}],"args_string":"(allow_blank : Bool)","args_html":"(allow_blank : Bool)","location":{"filename":"src/avram/attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L11"},"def":{"name":"allow_blank=","args":[{"name":"allow_blank","external_name":"allow_blank","restriction":"Bool"}],"visibility":"Public","body":"@allow_blank = allow_blank"}},{"html_id":"allow_blank?:Bool-instance-method","name":"allow_blank?","doc":"This can be used as an escape hatch when you\nmay have a blank string that's allowed to be saved.","summary":"

This can be used as an escape hatch when you may have a blank string that's allowed to be saved.

","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L11"},"def":{"name":"allow_blank?","return_type":"Bool","visibility":"Public","body":"@allow_blank"}},{"html_id":"changed?(from:T|Nil|Nothing=Nothing.new,to:T|Nil|Nothing=Nothing.new):Bool-instance-method","name":"changed?","abstract":false,"args":[{"name":"from","default_value":"Nothing.new","external_name":"from","restriction":"T | ::Nil | Nothing"},{"name":"to","default_value":"Nothing.new","external_name":"to","restriction":"T | ::Nil | Nothing"}],"args_string":"(from : T | Nil | Nothing = Nothing.new, to : T | Nil | Nothing = Nothing.new) : Bool","args_html":"(from : T | Nil | Nothing = Nothing.new, to : T | Nil | Nothing = Nothing.new) : Bool","location":{"filename":"src/avram/attribute.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L79"},"def":{"name":"changed?","args":[{"name":"from","default_value":"Nothing.new","external_name":"from","restriction":"T | ::Nil | Nothing"},{"name":"to","default_value":"Nothing.new","external_name":"to","restriction":"T | ::Nil | Nothing"}],"return_type":"Bool","visibility":"Public","body":"from = from.is_a?(Nothing) ? true : from == original_value\nto = to.is_a?(Nothing) ? true : to == value\n((value != original_value) && from) && to\n"}},{"html_id":"errors:Array(String)-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L47"},"def":{"name":"errors","return_type":"Array(String)","visibility":"Public","body":"@errors.uniq"}},{"html_id":"extract(params:Avram::Paramable)-instance-method","name":"extract","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/attribute.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L85"},"def":{"name":"extract","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"}],"visibility":"Public","body":"extract(params, type: T)"}},{"html_id":"name:Symbol-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L3"},"def":{"name":"name","return_type":"Symbol","visibility":"Public","body":"@name"}},{"html_id":"original_value:T|Nil-instance-method","name":"original_value","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L59"},"def":{"name":"original_value","return_type":"T | ::Nil","visibility":"Public","body":"if allow_blank?\n @original_value\nelse\n ensure_no_blank(@original_value)\nend"}},{"html_id":"param:Avram::Uploadable|Array(String)|String-instance-method","name":"param","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L30"},"def":{"name":"param","return_type":"Avram::Uploadable | Array(String) | String","visibility":"Public","body":"@param || value.to_s"}},{"html_id":"param_key:String-instance-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L5"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"@param_key"}},{"html_id":"permitted-instance-method","name":"permitted","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L19"},"def":{"name":"permitted","visibility":"Public","body":"@_permitted || (@_permitted = (Avram::PermittedAttribute(T).new(name: @name, param: @param, value: @value, param_key: @param_key).tap do |attribute|\n attribute.allow_blank = allow_blank?\n errors.each do |error|\n attribute.add_error(error)\n end\nend))"}},{"html_id":"reset_errors-instance-method","name":"reset_errors","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L43"},"def":{"name":"reset_errors","visibility":"Public","body":"@errors = [] of String"}},{"html_id":"to_f-instance-method","name":"to_f","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":159,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L159"},"def":{"name":"to_f","visibility":"Public","body":"call_value_instead_error_message(\".to_f\")"}},{"html_id":"to_f64-instance-method","name":"to_f64","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":163,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L163"},"def":{"name":"to_f64","visibility":"Public","body":"call_value_instead_error_message(\".to_f64\")"}},{"html_id":"to_i-instance-method","name":"to_i","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L147"},"def":{"name":"to_i","visibility":"Public","body":"call_value_instead_error_message(\".to_i\")"}},{"html_id":"to_i32-instance-method","name":"to_i32","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":151,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L151"},"def":{"name":"to_i32","visibility":"Public","body":"call_value_instead_error_message(\".to_i32\")"}},{"html_id":"to_i64-instance-method","name":"to_i64","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L155"},"def":{"name":"to_i64","visibility":"Public","body":"call_value_instead_error_message(\".to_i64\")"}},{"html_id":"to_s(time_format:String)-instance-method","name":"to_s","doc":"NOTE: to_s(io : IO) is used when passing an object\nin to string interpolation. Don't override that method.","summary":"

NOTE to_s(io : IO) is used when passing an object in to string interpolation.

","abstract":false,"args":[{"name":"time_format","external_name":"time_format","restriction":"String"}],"args_string":"(time_format : String)","args_html":"(time_format : String)","location":{"filename":"src/avram/attribute.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L143"},"def":{"name":"to_s","args":[{"name":"time_format","external_name":"time_format","restriction":"String"}],"visibility":"Public","body":"call_value_instead_error_message(\".to_s(...)\")"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"These methods may accidentally get called on attributes\ninside of operations. Since these methods don't exist,\nchances are, you meant to call them on the value.\n```\nusername.to_s\n# VS\nusername.value.to_s\n```","summary":"

These methods may accidentally get called on attributes inside of operations.

","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L137"},"def":{"name":"to_s","visibility":"Public","body":"call_value_instead_error_message(\".to_s\")"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L75"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"errors.empty?"}},{"html_id":"value:T|Nil-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L51"},"def":{"name":"value","return_type":"T | ::Nil","visibility":"Public","body":"if allow_blank?\n @value\nelse\n ensure_no_blank(@value)\nend"}},{"html_id":"value=(value:T|Nil)-instance-method","name":"value=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T | ::Nil"}],"args_string":"(value : T | Nil)","args_html":"(value : T | Nil)","location":{"filename":"src/avram/attribute.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L4"},"def":{"name":"value=","args":[{"name":"value","external_name":"value","restriction":"T | ::Nil"}],"visibility":"Public","body":"@value = value"}}],"macros":[{"html_id":"call_value_instead_error_message(method)-macro","name":"call_value_instead_error_message","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""}],"args_string":"(method)","args_html":"(method)","location":{"filename":"src/avram/attribute.cr","line_number":175,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L175"},"def":{"name":"call_value_instead_error_message","args":[{"name":"method","external_name":"method","restriction":""}],"visibility":"Public","body":" \n{% raise(\"\\nThe #{method.id} method should not be called directly on attributes (#{@type}).\\nDid you mean to call it on the value property?\\n\\nTry this...\\n\\n ▸ attribute.value#{method.id}\\n\") %}\n\n \n"}}],"types":[{"html_id":"avram/Avram/Attribute/ErrorMessage","path":"Avram/Attribute/ErrorMessage.html","kind":"alias","full_name":"Avram::Attribute::ErrorMessage","name":"ErrorMessage","abstract":false,"locations":[{"filename":"src/avram/attribute.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Avram::CallableErrorMessage | Proc(String, String, String) | String)","aliased_html":"Avram::CallableErrorMessage | String, String -> String | String","const":false,"namespace":{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute(T)","name":"Attribute"}}]},{"html_id":"avram/Avram/AvramError","path":"Avram/AvramError.html","kind":"class","full_name":"Avram::AvramError","name":"AvramError","abstract":false,"superclass":{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/ConnectionError","kind":"class","full_name":"Avram::ConnectionError","name":"ConnectionError"},{"html_id":"avram/Avram/FailedMigration","kind":"class","full_name":"Avram::FailedMigration","name":"FailedMigration"},{"html_id":"avram/Avram/FailedOperation","kind":"class","full_name":"Avram::FailedOperation","name":"FailedOperation"},{"html_id":"avram/Avram/ImpossibleValidation","kind":"class","full_name":"Avram::ImpossibleValidation","name":"ImpossibleValidation"},{"html_id":"avram/Avram/InvalidDatabaseNameError","kind":"class","full_name":"Avram::InvalidDatabaseNameError","name":"InvalidDatabaseNameError"},{"html_id":"avram/Avram/InvalidOperationError","kind":"class","full_name":"Avram::InvalidOperationError","name":"InvalidOperationError"},{"html_id":"avram/Avram/InvalidQueryError","kind":"class","full_name":"Avram::InvalidQueryError","name":"InvalidQueryError"},{"html_id":"avram/Avram/LazyLoadError","kind":"class","full_name":"Avram::LazyLoadError","name":"LazyLoadError"},{"html_id":"avram/Avram/MissingRequiredAssociationError","kind":"class","full_name":"Avram::MissingRequiredAssociationError","name":"MissingRequiredAssociationError"},{"html_id":"avram/Avram/PGClientNotInstalledError","kind":"class","full_name":"Avram::PGClientNotInstalledError","name":"PGClientNotInstalledError"},{"html_id":"avram/Avram/PGNotRunningError","kind":"class","full_name":"Avram::PGNotRunningError","name":"PGNotRunningError"},{"html_id":"avram/Avram/RecordNotFoundError","kind":"class","full_name":"Avram::RecordNotFoundError","name":"RecordNotFoundError"},{"html_id":"avram/Avram/Rollback","kind":"class","full_name":"Avram::Rollback","name":"Rollback"},{"html_id":"avram/Avram/SchemaMismatchError","kind":"class","full_name":"Avram::SchemaMismatchError","name":"SchemaMismatchError"},{"html_id":"avram/Avram/UnsupportedQueryError","kind":"class","full_name":"Avram::UnsupportedQueryError","name":"UnsupportedQueryError"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Generic Avram exception class.","summary":"

Generic Avram exception class.

"},{"html_id":"avram/Avram/BaseQueryTemplate","path":"Avram/BaseQueryTemplate.html","kind":"class","full_name":"Avram::BaseQueryTemplate","name":"BaseQueryTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/base_query_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/base_query_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,associations,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, associations, *args, **named_args)","args_html":"(type, columns, associations, *args, **named_args)","location":{"filename":"src/avram/base_query_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/base_query_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":3,"visibility":"Public","body":" class ::\n{{ type }}\n::BaseQuery\n def_clone\n include Avram::Queryable(\n{{ type }}\n)\n\n \n{% if type.resolve.has_constant?(\"PRIMARY_KEY_NAME\") %}\n include Avram::PrimaryKeyQueryable({{ type }})\n {% end %}\n\n\n macro generate_criteria_method(name, type)\n def \n\\{\n{ name }}\n \n\\{\n{ type }}.adapter.criteria(self, \"#{table_name}.\n\\{\n{ name }}\")\n \nend\n \nend\n\n def update(\n \n{% for column in columns %}\n {{ column[:name] }} : {{ column[:type] }} | Avram::Nothing{% if column[:nilable] %} | Nil{% end %} = Avram::Nothing.new,\n {% end %}\n\n ) : Int64\n\n _changes = \n{} of Symbol => String?\n\n \n{% for column in columns %}\n if {{ column[:name] }}.nil?\n _changes[:{{ column[:name] }}] = nil\n elsif {{ column[:name] }}.is_a?(Avram::Nothing)\n nil\n else\n value = {{ column[:name] }}.not_nil!.class.adapter.to_db({{ column[:name] }}).to_s\n _changes[:{{ column[:name] }}] = value\n end\n {% end %}\n\n\n database.exec(\n query.statement_for_update(_changes, return_columns: false),\n args: query.args_for_update(_changes)\n ).rows_affected\n \nend\n\n \n{% for column in columns %}\n def {{ column[:name] }}(value)\n {{ column[:name] }}.eq(value)\n end\n\n generate_criteria_method({{ column[:name] }}, {{ column[:type] }})\n\n macro inherited\n generate_criteria_method({{ column[:name] }}, {{ column[:type] }})\n end\n {% end %}\n\n\n \n{% for assoc in associations %}\n def join_{{ assoc[:assoc_name] }}\n inner_join_{{ assoc[:assoc_name] }}\n end\n\n {% for join_type in [\"Inner\", \"Left\", \"Right\", \"Full\"] %}\n def {{ join_type.downcase.id }}_join_{{ assoc[:assoc_name] }}\n {% if assoc[:relationship_type] == (:belongs_to) %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n primary_key: {{ assoc[:foreign_key].id.symbolize }},\n foreign_key: {{ assoc[:type] }}::PRIMARY_KEY_NAME\n )\n )\n {% else %}{% if assoc[:relationship_type] == (:has_one) %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n foreign_key: {{ assoc[:foreign_key].id.symbolize }},\n primary_key: primary_key_name\n )\n )\n {% else %}{% if assoc[:through] %}\n {{ join_type.downcase.id }}_join_{{ assoc[:through].first.id }}\n .__yield_where_{{ assoc[:through].first.id }} do |join_query|\n join_query.{{ join_type.downcase.id }}_join_{{ assoc[:through][1].id }}\n end\n {% else %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n foreign_key: {{ assoc[:foreign_key] }},\n primary_key: primary_key_name\n )\n )\n {% end %}{% end %}{% end %}\n end\n {% end %}\n\n\n def where_{{ assoc[:assoc_name] }}(assoc_query : {{ assoc[:type] }}::BaseQuery, auto_inner_join : Bool = true)\n if auto_inner_join\n join_{{ assoc[:assoc_name] }}.merge_query(assoc_query.query)\n else\n merge_query(assoc_query.query)\n end\n end\n\n # :nodoc:\n # Used internally for has_many through queries\n def __yield_where_{{ assoc[:assoc_name] }}\n assoc_query = yield {{ assoc[:type] }}::BaseQuery.new\n merge_query(assoc_query.query)\n end\n {% end %}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/BetweenCriteria","path":"Avram/BetweenCriteria.html","kind":"module","full_name":"Avram::BetweenCriteria(T, V)","name":"BetweenCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/between_criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria_extensions/between_criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Float64/Lucky/Criteria","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int16/Lucky/Criteria","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/CallableErrorMessage","path":"Avram/CallableErrorMessage.html","kind":"module","full_name":"Avram::CallableErrorMessage","name":"CallableErrorMessage","abstract":false,"locations":[{"filename":"src/avram/validations/callable_error_message.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations/callable_error_message.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"call(attribute_name,attribute_value)-instance-method","name":"call","abstract":true,"args":[{"name":"attribute_name","external_name":"attribute_name","restriction":""},{"name":"attribute_value","external_name":"attribute_value","restriction":""}],"args_string":"(attribute_name, attribute_value)","args_html":"(attribute_name, attribute_value)","location":{"filename":"src/avram/validations/callable_error_message.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations/callable_error_message.cr#L2"},"def":{"name":"call","args":[{"name":"attribute_name","external_name":"attribute_name","restriction":""},{"name":"attribute_value","external_name":"attribute_value","restriction":""}],"visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Callbacks","path":"Avram/Callbacks.html","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks","abstract":false,"locations":[{"filename":"src/avram/callbacks.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"after_commit(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_commit","doc":"Run the given method after save and after successful transaction commit\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_commit notify_post_author\n\n private def notify_post_author(comment : Comment)\n NewCommentNotificationEmail.new(comment, to: comment.author!).deliver_now\n end\nend\n```\n","summary":"

Run the given method after save and after successful transaction commit

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":439,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L439"},"def":{"name":"after_commit","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_commit, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_commit, {{ method_name }}, :unless)\n {% end %}\n\n after_commit(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_commit(if_if=nil,unless_unless=nil,&block)-macro","name":"after_commit","doc":"Run the given block after save and after successful transaction commit\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_commit do |comment|\n NewCommentNotificationEmail.new(comment, to: comment.author!).deliver_now\n end\nend\n```","summary":"

Run the given block after save and after successful transaction commit

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":462,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L462"},"def":{"name":"after_commit","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_commit callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_commit, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_commit, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_commit' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_commit do |saved_user|\\n some_method(saved_user)\\n end\")\nend %}\n\n def after_commit(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_commit).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"after_delete(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_delete","doc":"Same as `after_save` but with a different name","summary":"

Same as after_save but with a different name

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":243,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L243"},"def":{"name":"after_delete","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_delete, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_delete, {{ method_name }}, :unless)\n {% end %}\n\n after_delete(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_delete(if_if=nil,unless_unless=nil,&block)-macro","name":"after_delete","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":323,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L323"},"def":{"name":"after_delete","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_delete callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_delete, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_delete, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_delete' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_delete do |deleted_user|\\n some_method(deleted_user)\\n end\")\nend %}\n\n def after_delete(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_delete).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"after_run(method_name)-macro","name":"after_run","doc":"Run the given method after `run` is called on an `Operation`.\nThe return value of the `run` method is passed to `method_name`.\n\n```\nafter_run :log_entry\n\nprivate def log_entry(value)\n log_stuff(value)\nend\n```","summary":"

Run the given method after run is called on an Operation.

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/avram/callbacks.cr","line_number":378,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L378"},"def":{"name":"after_run","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" after_run do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_run(&block)-macro","name":"after_run","doc":"Run the given block after the operation runs\n\nThe return value from `run` will be passed to this block.\n\n```\nclass GenerateReport < Avram::Operation\n after_run do |value|\n value == \"some report\"\n end\n\n def run\n \"some report\"\n end\nend\n```","summary":"

Run the given block after the operation runs

","abstract":false,"location":{"filename":"src/avram/callbacks.cr","line_number":399,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L399"},"def":{"name":"after_run","block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if block.args.size != 1\n raise(\"The 'after_run' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_run { |value| some_method(value) }\")\nend %}\n\n def after_run(\n%object\n)\n \n{% if @type.methods.map(&.name).includes?((:after_run).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ block.args.first }}\n = \n%object\n\n \n{{ block.body }}\n\n \nend\n \n"}},{"html_id":"after_save(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_save","doc":"Run the given method after save, but before transaction is committed\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThis is a great place to do other database saves because if something goes\nwrong the whole transaction would be rolled back.\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_save touch_post\n\n private def touch_post(comment : Comment)\n SavePost.update!(comment.post!, updated_at: Time.utc)\n end\nend\n```\n\n> This is *not* a good place to do things like send messages, enqueue\n> background jobs, or charge payments. Since the transaction could be rolled\n> back the record may not be persisted to the database.\n> Instead use `after_commit`","summary":"

Run the given method after save, but before transaction is committed

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":230,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L230"},"def":{"name":"after_save","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_save, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_save, {{ method_name }}, :unless)\n {% end %}\n\n after_save(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_save(if_if=nil,unless_unless=nil,&block)-macro","name":"after_save","doc":"Run the given block after save, but before transaction is committed\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThis is a great place to do other database saves because if something goes\nwrong the whole transaction would be rolled back.\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_save do |comment|\n SavePost.update!(comment.post!, updated_at: Time.utc)\n end\nend\n```\n\n> This is *not* a good place to do things like send messages, enqueue\n> background jobs, or charge payments. Since the transaction could be rolled\n> back the record may not be persisted to the database.\n> Instead use `after_commit`","summary":"

Run the given block after save, but before transaction is committed

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":278,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L278"},"def":{"name":"after_save","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_save callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_save, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_save, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_save' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_save do |saved_user|\\n some_method(saved_user)\\n end\")\nend %}\n\n def after_save(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_save).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"before_delete(method_name,if_if=nil,unless_unless=nil)-macro","name":"before_delete","doc":"Same as `before_save`, but with a different name","summary":"

Same as before_save, but with a different name

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":76,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L76"},"def":{"name":"before_delete","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_delete, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_delete, {{ method_name }}, :unless)\n {% end %}\n\n before_delete(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_delete(if_if=nil,unless_unless=nil)-macro","name":"before_delete","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil)","args_html":"(if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":154,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L154"},"def":{"name":"before_delete","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your before_delete callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_delete, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_delete, :unless)\n {% end %}\n\n\n def before_delete\n \n{% if @type.methods.map(&.name).includes?((:before_delete).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ yield }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ yield }}\n end\n {% else %}\n {{ yield }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"before_run(method_name)-macro","name":"before_run","doc":"Run the given method before `run` is called on an `Operation`.\n\n```\nbefore_run :validate_inputs\n\nprivate def validate_inputs\n validate_required data\nend\n```","summary":"

Run the given method before run is called on an Operation.

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/avram/callbacks.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L97"},"def":{"name":"before_run","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" before_run do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_run-macro","name":"before_run","doc":"Run the given block before `run` is called on an `Operation`.\n\n```\nbefore_run do\n validate_required data\nend\n```","summary":"

Run the given block before run is called on an Operation.

","abstract":false,"location":{"filename":"src/avram/callbacks.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L193"},"def":{"name":"before_run","visibility":"Public","body":" def before_run\n \n{% if @type.methods.map(&.name).includes?((:before_run).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}},{"html_id":"before_save(method_name,if_if=nil,unless_unless=nil)-macro","name":"before_save","doc":"Run the given method before saving or creating for `SaveOperation`\n\nThis runs before saving and before the database transaction is started.\nYou can set defaults, validate, or perform any other setup necessary for\nsaving.\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\n```\nbefore_save :run_validations\nbefore_save :validate_can_internet, unless: :too_cool_for_school?\n\nprivate def run_validations\n validate_required name, age\nend\n\nprivate def validate_can_internet\n validate_size_of age, min: 13\nend\n\nprivate def too_cool_for_school?\n [true, false].sample\nend\n```","summary":"

Run the given method before saving or creating for SaveOperation

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L63"},"def":{"name":"before_save","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_save, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_save, {{ method_name }}, :unless)\n {% end %}\n\n before_save(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_save(if_if=nil,unless_unless=nil)-macro","name":"before_save","doc":"Run the given block before saving or creating for `SaveOperation`\n\nThis runs before saving and before the database transaction is started.\nYou can set defaults, validate, or perform any other setup necessary for\nsaving.\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\n```\nbefore_save(unless: :skip_callback?) do\n validate_required name, age\nend\n\nprivate def skip_callback?\n false\nend\n```","summary":"

Run the given block before saving or creating for SaveOperation

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil)","args_html":"(if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":122,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L122"},"def":{"name":"before_save","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your before_save callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_save, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_save, :unless)\n {% end %}\n\n\n def before_save\n \n{% if @type.methods.map(&.name).includes?((:before_save).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ yield }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ yield }}\n end\n {% else %}\n {{ yield }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"conditional_error_for_block_callbacks(callback,condition)-macro","name":"conditional_error_for_block_callbacks","abstract":false,"args":[{"name":"callback","external_name":"callback","restriction":""},{"name":"condition","external_name":"condition","restriction":""}],"args_string":"(callback, condition)","args_html":"(callback, condition)","location":{"filename":"src/avram/callbacks.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/callbacks.cr#L19"},"def":{"name":"conditional_error_for_block_callbacks","args":[{"name":"callback","external_name":"callback","restriction":""},{"name":"condition","external_name":"condition","restriction":""}],"visibility":"Public","body":" \n\\{%\n \nraise <<-ERROR\n You must pass a Symbol to `\n{{ condition.id }}\n` in \n{{ @type }}\n. The Symbol will reference a method you define.\n\n Try this...\n\n \n{{ callback.id }}\n(\n{{ condition.id }}\n: :check_condition?) do\n # your callback block\n end\n\n def check_condition?\n # return your bool value here\n end\n ERROR\n %}\n \n"}}]},{"html_id":"avram/Avram/ChronoUnits","path":"Avram/ChronoUnits.html","kind":"enum","full_name":"Avram::ChronoUnits","name":"ChronoUnits","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/chrono_units.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L2"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Century","name":"Century","value":"0"},{"id":"Day","name":"Day","value":"1"},{"id":"Decade","name":"Decade","value":"2"},{"id":"Dow","name":"Dow","value":"3"},{"id":"Doy","name":"Doy","value":"4"},{"id":"Epoch","name":"Epoch","value":"5"},{"id":"Hour","name":"Hour","value":"6"},{"id":"Isodow","name":"Isodow","value":"7"},{"id":"Isoyear","name":"Isoyear","value":"8"},{"id":"Julian","name":"Julian","value":"9"},{"id":"Microseconds","name":"Microseconds","value":"10"},{"id":"Millennium","name":"Millennium","value":"11"},{"id":"Milliseconds","name":"Milliseconds","value":"12"},{"id":"Minute","name":"Minute","value":"13"},{"id":"Month","name":"Month","value":"14"},{"id":"Quarter","name":"Quarter","value":"15"},{"id":"Second","name":"Second","value":"16"},{"id":"Timezone","name":"Timezone","value":"17"},{"id":"TimezoneHour","name":"TimezoneHour","value":"18"},{"id":"TimezoneMinute","name":"TimezoneMinute","value":"19"},{"id":"Week","name":"Week","value":"20"},{"id":"Year","name":"Year","value":"21"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"century?-instance-method","name":"century?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L3"},"def":{"name":"century?","visibility":"Public","body":"self == Century"}},{"html_id":"day?-instance-method","name":"day?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L4"},"def":{"name":"day?","visibility":"Public","body":"self == Day"}},{"html_id":"decade?-instance-method","name":"decade?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L5"},"def":{"name":"decade?","visibility":"Public","body":"self == Decade"}},{"html_id":"dow?-instance-method","name":"dow?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L6"},"def":{"name":"dow?","visibility":"Public","body":"self == Dow"}},{"html_id":"doy?-instance-method","name":"doy?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L7"},"def":{"name":"doy?","visibility":"Public","body":"self == Doy"}},{"html_id":"epoch?-instance-method","name":"epoch?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L8"},"def":{"name":"epoch?","visibility":"Public","body":"self == Epoch"}},{"html_id":"hour?-instance-method","name":"hour?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L9"},"def":{"name":"hour?","visibility":"Public","body":"self == Hour"}},{"html_id":"isodow?-instance-method","name":"isodow?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L10"},"def":{"name":"isodow?","visibility":"Public","body":"self == Isodow"}},{"html_id":"isoyear?-instance-method","name":"isoyear?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L11"},"def":{"name":"isoyear?","visibility":"Public","body":"self == Isoyear"}},{"html_id":"julian?-instance-method","name":"julian?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L12"},"def":{"name":"julian?","visibility":"Public","body":"self == Julian"}},{"html_id":"microseconds?-instance-method","name":"microseconds?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L13"},"def":{"name":"microseconds?","visibility":"Public","body":"self == Microseconds"}},{"html_id":"millennium?-instance-method","name":"millennium?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L14"},"def":{"name":"millennium?","visibility":"Public","body":"self == Millennium"}},{"html_id":"milliseconds?-instance-method","name":"milliseconds?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L15"},"def":{"name":"milliseconds?","visibility":"Public","body":"self == Milliseconds"}},{"html_id":"minute?-instance-method","name":"minute?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L16"},"def":{"name":"minute?","visibility":"Public","body":"self == Minute"}},{"html_id":"month?-instance-method","name":"month?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L17"},"def":{"name":"month?","visibility":"Public","body":"self == Month"}},{"html_id":"quarter?-instance-method","name":"quarter?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L18"},"def":{"name":"quarter?","visibility":"Public","body":"self == Quarter"}},{"html_id":"second?-instance-method","name":"second?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L19"},"def":{"name":"second?","visibility":"Public","body":"self == Second"}},{"html_id":"timezone?-instance-method","name":"timezone?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L20"},"def":{"name":"timezone?","visibility":"Public","body":"self == Timezone"}},{"html_id":"timezone_hour?-instance-method","name":"timezone_hour?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L21"},"def":{"name":"timezone_hour?","visibility":"Public","body":"self == TimezoneHour"}},{"html_id":"timezone_minute?-instance-method","name":"timezone_minute?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L22"},"def":{"name":"timezone_minute?","visibility":"Public","body":"self == TimezoneMinute"}},{"html_id":"week?-instance-method","name":"week?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L23"},"def":{"name":"week?","visibility":"Public","body":"self == Week"}},{"html_id":"year?-instance-method","name":"year?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/chrono_units.cr#L24"},"def":{"name":"year?","visibility":"Public","body":"self == Year"}}]},{"html_id":"avram/Avram/Connection","path":"Avram/Connection.html","kind":"class","full_name":"Avram::Connection","name":"Connection","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Handles the connection to the DB.","summary":"

Handles the connection to the DB.

","constructors":[{"html_id":"new(connection_string:String,database_class:Avram::Database.class)-class-method","name":"new","abstract":false,"args":[{"name":"connection_string","external_name":"connection_string","restriction":"String"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"args_string":"(connection_string : String, database_class : Avram::Database.class)","args_html":"(connection_string : String, database_class : Avram::Database.class)","location":{"filename":"src/avram/connection.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L5"},"def":{"name":"new","args":[{"name":"connection_string","external_name":"connection_string","restriction":"String"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection_string, database_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"close:Nil-instance-method","name":"close","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L12"},"def":{"name":"close","return_type":"Nil","visibility":"Public","body":"@db.try(&.close)\n@db = nil\n"}},{"html_id":"connect_listen(*channels:String,&block:PQ::Notification->):Nil-instance-method","name":"connect_listen","abstract":false,"args":[{"name":"channels","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String, &block : PQ::Notification -> ) : Nil","args_html":"(*channels : String, &block : PQ::Notification -> ) : Nil","location":{"filename":"src/avram/connection.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L17"},"def":{"name":"connect_listen","args":[{"name":"channels","external_name":"channels","restriction":"String"}],"splat_index":0,"yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(PQ::Notification ->)"},"return_type":"Nil","visibility":"Public","body":"begin\n PG.connect_listen(@connection_string, *channels, &block)\nrescue DB::ConnectionRefused\n raise(ConnectionError.new(connection_uri, database_class: @database_class))\nend"}},{"html_id":"open:DB::Database-instance-method","name":"open","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L8"},"def":{"name":"open","return_type":"DB::Database","visibility":"Public","body":"@db = try_connection!"}},{"html_id":"try_connection!:DB::Database-instance-method","name":"try_connection!","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/connection.cr#L23"},"def":{"name":"try_connection!","return_type":"DB::Database","visibility":"Public","body":"begin\n DB.open(@connection_string)\nrescue DB::ConnectionRefused\n raise(ConnectionError.new(connection_uri, database_class: @database_class))\nend"}}]},{"html_id":"avram/Avram/ConnectionError","path":"Avram/ConnectionError.html","kind":"class","full_name":"Avram::ConnectionError","name":"ConnectionError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L82"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"DEFAULT_PG_PORT","name":"DEFAULT_PG_PORT","value":"5432"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(connection_details:URI,database_class:Avram::Database.class)-class-method","name":"new","abstract":false,"args":[{"name":"connection_details","external_name":"connection_details","restriction":"URI"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"args_string":"(connection_details : URI, database_class : Avram::Database.class)","args_html":"(connection_details : URI, database_class : Avram::Database.class)","location":{"filename":"src/avram/errors.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L88"},"def":{"name":"new","args":[{"name":"connection_details","external_name":"connection_details","restriction":"URI"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection_details, database_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"connection_details:URI-instance-method","name":"connection_details","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L85"},"def":{"name":"connection_details","return_type":"URI","visibility":"Public","body":"@connection_details"}},{"html_id":"database_class:Avram::Database.class-instance-method","name":"database_class","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L86"},"def":{"name":"database_class","return_type":"Avram::Database.class","visibility":"Public","body":"@database_class"}}]},{"html_id":"avram/Avram/Credentials","path":"Avram/Credentials.html","kind":"class","full_name":"Avram::Credentials","name":"Credentials","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/credentials.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"parse?(connection_url:String|Nil):Credentials|Nil-class-method","name":"parse?","doc":"Parse a postgres connection string URL. This may come from an\nenvironment variable.\nReturns `nil` if no `connection_url` is provided.\n\n```\nAvram::Credentials.parse?(ENV[\"DB_URL\"]?)\n```","summary":"

Parse a postgres connection string URL.

","abstract":false,"args":[{"name":"connection_url","external_name":"connection_url","restriction":"String | ::Nil"}],"args_string":"(connection_url : String | Nil) : Credentials | Nil","args_html":"(connection_url : String | Nil) : Credentials | Nil","location":{"filename":"src/avram/credentials.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L28"},"def":{"name":"parse?","args":[{"name":"connection_url","external_name":"connection_url","restriction":"String | ::Nil"}],"return_type":"Credentials | ::Nil","visibility":"Public","body":"if connection_url.nil?\n return nil\nend\nparse(connection_url.as(String))\n"}}],"constructors":[{"html_id":"new(database:String,hostname:String|Nil=nil,username:String|Nil=nil,password:String|Nil=nil,port:Int32|Nil=nil,query:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"String"},{"name":"hostname","default_value":"nil","external_name":"hostname","restriction":"String | ::Nil"},{"name":"username","default_value":"nil","external_name":"username","restriction":"String | ::Nil"},{"name":"password","default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"port","default_value":"nil","external_name":"port","restriction":"Int32 | ::Nil"},{"name":"query","default_value":"nil","external_name":"query","restriction":"String | ::Nil"}],"args_string":"(database : String, hostname : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil, port : Int32 | Nil = nil, query : String | Nil = nil)","args_html":"(database : String, hostname : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil, port : Int32 | Nil = nil, query : String | Nil = nil)","location":{"filename":"src/avram/credentials.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L4"},"def":{"name":"new","args":[{"name":"database","external_name":"database","restriction":"String"},{"name":"hostname","default_value":"nil","external_name":"hostname","restriction":"String | ::Nil"},{"name":"username","default_value":"nil","external_name":"username","restriction":"String | ::Nil"},{"name":"password","default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"port","default_value":"nil","external_name":"port","restriction":"Int32 | ::Nil"},{"name":"query","default_value":"nil","external_name":"query","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(database, hostname, username, password, port, query)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"parse(connection_url:String):Credentials-class-method","name":"parse","doc":"Parse a postgres connection string URL. This may come from an\nenvironment variable.\n\n```\nAvram::Credentials.parse(ENV[\"DB_URL\"])\n```","summary":"

Parse a postgres connection string URL.

","abstract":false,"args":[{"name":"connection_url","external_name":"connection_url","restriction":"String"}],"args_string":"(connection_url : String) : Credentials","args_html":"(connection_url : String) : Credentials","location":{"filename":"src/avram/credentials.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L39"},"def":{"name":"parse","args":[{"name":"connection_url","external_name":"connection_url","restriction":"String"}],"return_type":"Credentials","visibility":"Public","body":"uri = URI.parse(connection_url)\nnew(database: uri.path.to_s, hostname: uri.host, username: uri.user, password: uri.password, port: uri.port, query: uri.query)\n"}},{"html_id":"void:Credentials-class-method","name":"void","doc":"Used when you need to configure credentials,\nbut no database connection is made.","summary":"

Used when you need to configure credentials, but no database connection is made.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L17"},"def":{"name":"void","return_type":"Credentials","visibility":"Public","body":"new(database: \"unused\")"}}],"instance_methods":[{"html_id":"connection_string:String-instance-method","name":"connection_string","doc":"This is the full connection string used\nto connect to the PostgreSQL server.","summary":"

This is the full connection string used to connect to the PostgreSQL server.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L85"},"def":{"name":"connection_string","return_type":"String","visibility":"Public","body":"String.build do |io|\n set_url_protocol(io)\n set_url_creds(io)\n set_url_host(io)\n set_url_port(io)\nend"}},{"html_id":"database:String-instance-method","name":"database","doc":"The name of the database you want to connect to","summary":"

The name of the database you want to connect to

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L52"},"def":{"name":"database","return_type":"String","visibility":"Public","body":"@database = @database.strip\nif @database.starts_with?('/')\n @database = @database[1..-1]\nend\nif @database.empty?\n raise(InvalidDatabaseNameError.new(\"The database name specified was blank. Be sure to set a value.\"))\nend\n@database\n"}},{"html_id":"hostname:String|Nil-instance-method","name":"hostname","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L63"},"def":{"name":"hostname","return_type":"String | ::Nil","visibility":"Public","body":"@hostname.try(&.strip).presence"}},{"html_id":"password:String|Nil-instance-method","name":"password","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L71"},"def":{"name":"password","return_type":"String | ::Nil","visibility":"Public","body":"@password.try(&.strip).presence"}},{"html_id":"port:Int32|Nil-instance-method","name":"port","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L75"},"def":{"name":"port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@port"}},{"html_id":"query:String|Nil-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L79"},"def":{"name":"query","return_type":"String | ::Nil","visibility":"Public","body":"@query.try(&.strip).presence"}},{"html_id":"url:String-instance-method","name":"url","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L2"},"def":{"name":"url","return_type":"String","visibility":"Public","body":"@url"}},{"html_id":"url_without_query_params:String-instance-method","name":"url_without_query_params","doc":"Returns the postgres connection string without\nany query params.","summary":"

Returns the postgres connection string without any query params.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":96,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L96"},"def":{"name":"url_without_query_params","return_type":"String","visibility":"Public","body":"url.sub(\"?#{@query}\", \"\")"}},{"html_id":"username:String|Nil-instance-method","name":"username","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/credentials.cr#L67"},"def":{"name":"username","return_type":"String | ::Nil","visibility":"Public","body":"@username.try(&.strip).presence"}}]},{"html_id":"avram/Avram/Criteria","path":"Avram/Criteria.html","kind":"class","full_name":"Avram::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Bool/Lucky/Criteria","kind":"class","full_name":"Bool::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Float64/Lucky/Criteria","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int16/Lucky/Criteria","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/JSON/Any/Lucky/Criteria","kind":"class","full_name":"JSON::Any::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/JSON/Serializable/Lucky/Criteria","kind":"class","full_name":"JSON::Serializable::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Slice/Lucky/Criteria","kind":"class","full_name":"Slice::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/String/Lucky/Criteria","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/UUID/Lucky/Criteria","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"asc_order(null_sorting:Avram::OrderBy::NullSorting=:default):T-instance-method","name":"asc_order","abstract":false,"args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"args_string":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","args_html":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","location":{"filename":"src/avram/criteria.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L14"},"def":{"name":"asc_order","args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderBy.new(column, :asc, null_sorting))"}},{"html_id":"column:Symbol|String-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L3"},"def":{"name":"column","return_type":"Symbol | String","visibility":"Public","body":"@column"}},{"html_id":"column=(column:Symbol|String)-instance-method","name":"column=","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(column : Symbol | String)","args_html":"(column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L3"},"def":{"name":"column=","args":[{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"@column = column"}},{"html_id":"desc_order(null_sorting:Avram::OrderBy::NullSorting=:default):T-instance-method","name":"desc_order","abstract":false,"args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"args_string":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","args_html":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","location":{"filename":"src/avram/criteria.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L10"},"def":{"name":"desc_order","args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderBy.new(column, :desc, null_sorting))"}},{"html_id":"eq(value):T-instance-method","name":"eq","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L22"},"def":{"name":"eq","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"check_just_nil!(typeof(value))\ncheck_nilable!(value)\nperform_eq(value)\n"}},{"html_id":"gt(value):T-instance-method","name":"gt","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":116,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L116"},"def":{"name":"gt","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::GreaterThan.new(column, V.adapter.to_db!(value)))"}},{"html_id":"gte(value):T-instance-method","name":"gte","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":120,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L120"},"def":{"name":"gte","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::GreaterThanOrEqualTo.new(column, V.adapter.to_db!(value)))"}},{"html_id":"in(values):T-instance-method","name":"in","abstract":false,"args":[{"name":"values","external_name":"values","restriction":""}],"args_string":"(values) : T","args_html":"(values) : T","location":{"filename":"src/avram/criteria.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L152"},"def":{"name":"in","args":[{"name":"values","external_name":"values","restriction":""}],"return_type":"T","visibility":"Public","body":"values = values.map do |value|\n V.adapter.to_db!(value)\nend\nadd_clause(Avram::Where::In.new(column, values))\n"}},{"html_id":"is_nil:T-instance-method","name":"is_nil","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":102,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L102"},"def":{"name":"is_nil","return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Null.new(column))"}},{"html_id":"is_not_nil:T-instance-method","name":"is_not_nil","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L106"},"def":{"name":"is_not_nil","return_type":"T","visibility":"Public","body":"not()\nis_nil\n"}},{"html_id":"lt(value):T-instance-method","name":"lt","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":124,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L124"},"def":{"name":"lt","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::LessThan.new(column, V.adapter.to_db!(value)))"}},{"html_id":"lte(value):T-instance-method","name":"lte","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":128,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L128"},"def":{"name":"lte","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::LessThanOrEqualTo.new(column, V.adapter.to_db!(value)))"}},{"html_id":"nilable_eq(value):T-instance-method","name":"nilable_eq","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":92,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L92"},"def":{"name":"nilable_eq","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"check_just_nil!(typeof(value))\nif value.nil?\n is_nil\nelse\n perform_eq(value)\nend\n"}},{"html_id":"not:Avram::Criteria-instance-method","name":"not","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":111,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L111"},"def":{"name":"not","return_type":"Avram::Criteria","visibility":"Public","body":"@negate_next_criteria = true\nself\n"}},{"html_id":"random_order:T-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L18"},"def":{"name":"random_order","return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderByRandom.new)"}},{"html_id":"rows:T-instance-method","name":"rows","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L2"},"def":{"name":"rows","return_type":"T","visibility":"Public","body":"@rows"}},{"html_id":"rows=(rows:T)-instance-method","name":"rows=","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"}],"args_string":"(rows : T)","args_html":"(rows : T)","location":{"filename":"src/avram/criteria.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L2"},"def":{"name":"rows=","args":[{"name":"rows","external_name":"rows","restriction":"T"}],"visibility":"Public","body":"@rows = rows"}},{"html_id":"select_average:Float64|Nil-instance-method","name":"select_average","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L140"},"def":{"name":"select_average","return_type":"Float64 | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_average(column)).as(PG::Numeric | ::Nil)).try(&.to_f64)"}},{"html_id":"select_average!:Float64-instance-method","name":"select_average!","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":144,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L144"},"def":{"name":"select_average!","return_type":"Float64","visibility":"Public","body":"select_average || 0_f64"}},{"html_id":"select_max:V|Nil-instance-method","name":"select_max","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":136,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L136"},"def":{"name":"select_max","return_type":"V | ::Nil","visibility":"Public","body":"rows.exec_scalar(&.select_max(column)).as(V | ::Nil)"}},{"html_id":"select_min:V|Nil-instance-method","name":"select_min","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L132"},"def":{"name":"select_min","return_type":"V | ::Nil","visibility":"Public","body":"rows.exec_scalar(&.select_min(column)).as(V | ::Nil)"}},{"html_id":"select_sum-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":148,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L148"},"def":{"name":"select_sum","visibility":"Public","body":"rows.exec_scalar(&.select_sum(column))"}}],"macros":[{"html_id":"define_function_criteria(name,output_type=V,sql_name=nil)-macro","name":"define_function_criteria","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"output_type","default_value":"V","external_name":"output_type","restriction":""},{"name":"sql_name","default_value":"nil","external_name":"sql_name","restriction":""}],"args_string":"(name, output_type = V, sql_name = nil)","args_html":"(name, output_type = V, sql_name = nil)","location":{"filename":"src/avram/criteria.cr","line_number":190,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L190"},"def":{"name":"define_function_criteria","args":[{"name":"name","external_name":"name","restriction":""},{"name":"output_type","default_value":"V","external_name":"output_type","restriction":""},{"name":"sql_name","default_value":"nil","external_name":"sql_name","restriction":""}],"visibility":"Public","body":" \n{% sql_name = sql_name ? sql_name.id : name.id.upcase %}\n\n def \n{{ name }}\n\n Criteria(T,\n{{ output_type }}\n).new(rows, \"\n{{ sql_name }}\n(#{column})\")\n \nend\n \n"}}]},{"html_id":"avram/Avram/Database","path":"Avram/Database.html","kind":"class","full_name":"Avram::Database","name":"Database","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L1"},{"filename":"src/avram/database/column_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L2"},{"filename":"src/avram/database/database_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L2"},{"filename":"src/avram/database/table_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"close_connections!-class-method","name":"close_connections!","doc":"Close all available connections as well as the DB","summary":"

Close all available connections as well as the DB

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L162"},"def":{"name":"close_connections!","visibility":"Public","body":"connections.values.map(&.close)\n@@db.try(&.close)\n"}},{"html_id":"connections-class-method","name":"connections","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L6"},"def":{"name":"connections","visibility":"Public","body":"@@connections"}},{"html_id":"credentials-class-method","name":"credentials","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L140"},"def":{"name":"credentials","visibility":"Public","body":"settings.credentials"}},{"html_id":"database_info:DatabaseInfo-class-method","name":"database_info","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L69"},"def":{"name":"database_info","return_type":"DatabaseInfo","visibility":"Public","body":"@@database_info || (@@database_info = DatabaseInfo.load(self))"}},{"html_id":"delete-class-method","name":"delete","doc":"Run a SQL `DELETE` on all tables in the database","summary":"

Run a SQL DELETE on all tables in the database

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L49"},"def":{"name":"delete","visibility":"Public","body":"new.delete"}},{"html_id":"exec(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"exec","doc":"Same as crystal-db's `DB::QueryMethods#exec` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#exec but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"exec","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.exec(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"listen(*channels:String,&block:PQ::Notification->):Nil-class-method","name":"listen","doc":"Listens for `pg_notify()` calls on each channel in `channels`\nYields a `PQ::Notification` object with `channel`, `payload`, and `pid`.\n\n```\n# pg_notify(\"callback\", \"123\")\nAppDatabase.listen(\"callback\", \"jobs\") do |notification|\n notification.channel # => \"callback\"\n notification.payload # => \"123\"\nend\n```","summary":"

Listens for pg_notify() calls on each channel in channels Yields a PQ::Notification object with channel, payload, and pid.

","abstract":false,"args":[{"name":"channels","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String, &block : PQ::Notification -> ) : Nil","args_html":"(*channels : String, &block : PQ::Notification -> ) : Nil","location":{"filename":"src/avram/database.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L63"},"def":{"name":"listen","args":[{"name":"channels","external_name":"channels","restriction":"String"}],"splat_index":0,"yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(PQ::Notification ->)"},"return_type":"Nil","visibility":"Public","body":"new.listen(*channels, &block)"}},{"html_id":"lock_id:UInt64|Nil-class-method","name":"lock_id","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L7"},"def":{"name":"lock_id","return_type":"UInt64 | ::Nil","visibility":"Public","body":"@@lock_id"}},{"html_id":"lock_id=(lock_id:UInt64|Nil)-class-method","name":"lock_id=","abstract":false,"args":[{"name":"lock_id","external_name":"lock_id","restriction":"UInt64 | ::Nil"}],"args_string":"(lock_id : UInt64 | Nil)","args_html":"(lock_id : UInt64 | Nil)","location":{"filename":"src/avram/database.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L7"},"def":{"name":"lock_id=","args":[{"name":"lock_id","external_name":"lock_id","restriction":"UInt64 | ::Nil"}],"visibility":"Public","body":"@@lock_id = lock_id"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#:query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_all(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#:query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_all(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_each(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_each","doc":"Same as crystal-db's `DB::QueryMethods#:query_each` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_each but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_each","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_each(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_one(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#:query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_one(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#query_one?` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one? but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_one?(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#:\"query_one?\"` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:"query_one?" but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_one?(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"rollback-class-method","name":"rollback","doc":"Rollback the current transaction","summary":"

Rollback the current transaction

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L39"},"def":{"name":"rollback","visibility":"Public","body":"new.rollback"}},{"html_id":"run(&)-class-method","name":"run","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":148,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L148"},"def":{"name":"run","yields":1,"block_arity":1,"visibility":"Public","body":"new.run do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"scalar(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"scalar","doc":"Same as crystal-db's `DB::QueryMethods#scalar` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#scalar but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"scalar","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.scalar(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"setup_connection(&block:DB::Connection->Nil)-class-method","name":"setup_connection","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L28"},"def":{"name":"setup_connection","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(DB::Connection -> Nil)"},"visibility":"Public","body":"new.db.setup_connection do |conn|\n block.call(conn)\nend"}},{"html_id":"transaction(&)-class-method","name":"transaction","doc":"Wrap the block in a database transaction\n\n```\nAppDatabase.transaction do\n # Create, read, update\n # Force a rollback with AppDatabase.rollback\nend\n```","summary":"

Wrap the block in a database transaction

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L81"},"def":{"name":"transaction","yields":1,"block_arity":1,"visibility":"Public","body":"new.transaction do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"truncate(**named_args)-class-method","name":"truncate","doc":"Run a SQL `TRUNCATE` on all tables in the database","summary":"

Run a SQL TRUNCATE on all tables in the database

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L44"},"def":{"name":"truncate","double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"visibility":"Public","body":"new.truncate(**named_args)"}},{"html_id":"verify_connection-class-method","name":"verify_connection","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L34"},"def":{"name":"verify_connection","visibility":"Public","body":"new.connection.open.close"}}],"instance_methods":[{"html_id":"exec(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"exec","doc":"Same as crystal-db's `DB::QueryMethods#exec` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#exec but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"exec","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.exec(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"publish_query_event(query,args_,args,queryable,&)-instance-method","name":"publish_query_event","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","external_name":"args","restriction":""},{"name":"queryable","external_name":"queryable","restriction":""}],"args_string":"(query, args_, args, queryable, &)","args_html":"(query, args_, args, queryable, &)","location":{"filename":"src/avram/database.cr","line_number":125,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L125"},"def":{"name":"publish_query_event","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","external_name":"args","restriction":""},{"name":"queryable","external_name":"queryable","restriction":""}],"yields":0,"block_arity":0,"visibility":"Public","body":"begin\n logging_args = (DB::EnumerableConcat.build(args_, args)).to_s\n Avram::Events::QueryEvent.publish(query: query, args: logging_args, queryable: queryable) do\n yield\n end\nrescue e : PQ::PQError\n Avram::Events::FailedQueryEvent.publish(error_message: e.message.to_s, query: query, queryable: queryable, args: logging_args)\n raise(e)\nend"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#:query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_all(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#:query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_all(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_each(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_each","doc":"Same as crystal-db's `DB::QueryMethods#:query_each` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_each but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_each","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_each(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#:query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#query_one?` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one? but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one?(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#:\"query_one?\"` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:"query_one?" but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L105"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one?(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"scalar(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"scalar","doc":"Same as crystal-db's `DB::QueryMethods#scalar` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#scalar but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L88"},"def":{"name":"scalar","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.scalar(query, *args_, **named_args, args: args)\n end\nend"}}],"types":[{"html_id":"avram/Avram/Database/ColumnInfo","path":"Avram/Database/ColumnInfo.html","kind":"struct","full_name":"Avram::Database::ColumnInfo","name":"ColumnInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/DB/Mappable","kind":"module","full_name":"DB::Mappable","name":"Mappable"},{"html_id":"avram/DB/Serializable","kind":"module","full_name":"DB::Serializable","name":"Serializable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/column_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/Mappable","kind":"module","full_name":"DB::Mappable","name":"Mappable"},{"html_id":"avram/DB/Serializable","kind":"module","full_name":"DB::Serializable","name":"Serializable"}],"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"class_methods":[{"html_id":"from_rs(rs:DB::ResultSet)-class-method","name":"from_rs","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/database/column_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L4"},"def":{"name":"from_rs","args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"visibility":"Public","body":"begin\n objs = Array(self).new\n rs.each do\n objs << (self.new(rs))\n end\n objs\nensure\n rs.close\nend"}}],"constructors":[{"html_id":"new(rs:DB::ResultSet)-class-method","name":"new","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/database/column_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L4"},"def":{"name":"new","args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"visibility":"Public","body":"instance = allocate\ninstance.initialize(__set_for_db_serializable: rs)\nif instance.responds_to?(:finalize)\n GC.add_finalizer(instance)\nend\ninstance\n"}}],"instance_methods":[{"html_id":"column_default:String|Nil-instance-method","name":"column_default","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L12"},"def":{"name":"column_default","return_type":"String | ::Nil","visibility":"Public","body":"@column_default"}},{"html_id":"column_default=(column_default:String|Nil)-instance-method","name":"column_default=","abstract":false,"args":[{"name":"column_default","external_name":"column_default","restriction":"String | ::Nil"}],"args_string":"(column_default : String | Nil)","args_html":"(column_default : String | Nil)","location":{"filename":"src/avram/database/column_info.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L12"},"def":{"name":"column_default=","args":[{"name":"column_default","external_name":"column_default","restriction":"String | ::Nil"}],"visibility":"Public","body":"@column_default = column_default"}},{"html_id":"column_name:String-instance-method","name":"column_name","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L10"},"def":{"name":"column_name","return_type":"String","visibility":"Public","body":"@column_name"}},{"html_id":"column_name=(column_name:String)-instance-method","name":"column_name=","abstract":false,"args":[{"name":"column_name","external_name":"column_name","restriction":"String"}],"args_string":"(column_name : String)","args_html":"(column_name : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L10"},"def":{"name":"column_name=","args":[{"name":"column_name","external_name":"column_name","restriction":"String"}],"visibility":"Public","body":"@column_name = column_name"}},{"html_id":"data_type:String-instance-method","name":"data_type","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L13"},"def":{"name":"data_type","return_type":"String","visibility":"Public","body":"@data_type"}},{"html_id":"data_type=(data_type:String)-instance-method","name":"data_type=","abstract":false,"args":[{"name":"data_type","external_name":"data_type","restriction":"String"}],"args_string":"(data_type : String)","args_html":"(data_type : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L13"},"def":{"name":"data_type=","args":[{"name":"data_type","external_name":"data_type","restriction":"String"}],"visibility":"Public","body":"@data_type = data_type"}},{"html_id":"is_nullable:String-instance-method","name":"is_nullable","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L11"},"def":{"name":"is_nullable","return_type":"String","visibility":"Public","body":"@is_nullable"}},{"html_id":"is_nullable=(is_nullable:String)-instance-method","name":"is_nullable=","abstract":false,"args":[{"name":"is_nullable","external_name":"is_nullable","restriction":"String"}],"args_string":"(is_nullable : String)","args_html":"(is_nullable : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L11"},"def":{"name":"is_nullable=","args":[{"name":"is_nullable","external_name":"is_nullable","restriction":"String"}],"visibility":"Public","body":"@is_nullable = is_nullable"}},{"html_id":"nilable?:Bool-instance-method","name":"nilable?","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L15"},"def":{"name":"nilable?","return_type":"Bool","visibility":"Public","body":"is_nullable == \"YES\""}},{"html_id":"table:Avram::Database::TableInfo-instance-method","name":"table","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L19"},"def":{"name":"table","return_type":"Avram::Database::TableInfo","visibility":"Public","body":"TableInfo.new(table_name, table_type, table_schema)"}},{"html_id":"table_catalog:String-instance-method","name":"table_catalog","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L6"},"def":{"name":"table_catalog","return_type":"String","visibility":"Public","body":"@table_catalog"}},{"html_id":"table_catalog=(table_catalog:String)-instance-method","name":"table_catalog=","abstract":false,"args":[{"name":"table_catalog","external_name":"table_catalog","restriction":"String"}],"args_string":"(table_catalog : String)","args_html":"(table_catalog : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L6"},"def":{"name":"table_catalog=","args":[{"name":"table_catalog","external_name":"table_catalog","restriction":"String"}],"visibility":"Public","body":"@table_catalog = table_catalog"}},{"html_id":"table_name:String-instance-method","name":"table_name","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L8"},"def":{"name":"table_name","return_type":"String","visibility":"Public","body":"@table_name"}},{"html_id":"table_name=(table_name:String)-instance-method","name":"table_name=","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"String"}],"args_string":"(table_name : String)","args_html":"(table_name : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L8"},"def":{"name":"table_name=","args":[{"name":"table_name","external_name":"table_name","restriction":"String"}],"visibility":"Public","body":"@table_name = table_name"}},{"html_id":"table_schema:String-instance-method","name":"table_schema","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L7"},"def":{"name":"table_schema","return_type":"String","visibility":"Public","body":"@table_schema"}},{"html_id":"table_schema=(table_schema:String)-instance-method","name":"table_schema=","abstract":false,"args":[{"name":"table_schema","external_name":"table_schema","restriction":"String"}],"args_string":"(table_schema : String)","args_html":"(table_schema : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L7"},"def":{"name":"table_schema=","args":[{"name":"table_schema","external_name":"table_schema","restriction":"String"}],"visibility":"Public","body":"@table_schema = table_schema"}},{"html_id":"table_type:String-instance-method","name":"table_type","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L9"},"def":{"name":"table_type","return_type":"String","visibility":"Public","body":"@table_type"}},{"html_id":"table_type=(table_type:String)-instance-method","name":"table_type=","abstract":false,"args":[{"name":"table_type","external_name":"table_type","restriction":"String"}],"args_string":"(table_type : String)","args_html":"(table_type : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/column_info.cr#L9"},"def":{"name":"table_type=","args":[{"name":"table_type","external_name":"table_type","restriction":"String"}],"visibility":"Public","body":"@table_type = table_type"}}]},{"html_id":"avram/Avram/Database/DatabaseCleaner","path":"Avram/Database/DatabaseCleaner.html","kind":"class","full_name":"Avram::Database::DatabaseCleaner","name":"DatabaseCleaner","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database.cr","line_number":253,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L253"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"new(database:Avram::Database)-class-method","name":"new","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"::Avram::Database"}],"args_string":"(database : Avram::Database)","args_html":"(database : Avram::Database)","location":{"filename":"src/avram/database.cr","line_number":257,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L257"},"def":{"name":"new","args":[{"name":"database","external_name":"database","restriction":"::Avram::Database"}],"visibility":"Public","body":"_ = allocate\n_.initialize(database)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"delete-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":277,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L277"},"def":{"name":"delete","visibility":"Public","body":"if table_names.empty?\n return\nend\ntable_names.each do |t|\n statement = (\"DELETE FROM #{t}\")\n database.exec(statement)\nend\n"}},{"html_id":"truncate(*,cascade:Bool=true,restart_identity:Bool=true)-instance-method","name":"truncate","abstract":false,"args":[{"name":"","external_name":"","restriction":""},{"name":"cascade","default_value":"true","external_name":"cascade","restriction":"Bool"},{"name":"restart_identity","default_value":"true","external_name":"restart_identity","restriction":"Bool"}],"args_string":"(*, cascade : Bool = true, restart_identity : Bool = true)","args_html":"(*, cascade : Bool = true, restart_identity : Bool = true)","location":{"filename":"src/avram/database.cr","line_number":266,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L266"},"def":{"name":"truncate","args":[{"name":"","external_name":"","restriction":""},{"name":"cascade","default_value":"true","external_name":"cascade","restriction":"Bool"},{"name":"restart_identity","default_value":"true","external_name":"restart_identity","restriction":"Bool"}],"splat_index":0,"visibility":"Public","body":"if table_names.empty?\n return\nend\ncascade_sql = cascade ? \" CASCADE\" : \"\"\nrestart_id_sql = restart_identity ? \" RESTART IDENTITY\" : \"\"\ntable_names_sql = table_names.join(\", \")\nsql = \"TRUNCATE TABLE #{table_names_sql}#{restart_id_sql}#{cascade_sql}\"\ndatabase.exec(sql)\n"}}]},{"html_id":"avram/Avram/Database/DatabaseInfo","path":"Avram/Database/DatabaseInfo.html","kind":"struct","full_name":"Avram::Database::DatabaseInfo","name":"DatabaseInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/database_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SQL_QUERY","name":"SQL_QUERY","value":"\" SELECT columns.table_name,\\n tables.table_type,\\n columns.table_schema,\\n columns.table_catalog,\\n columns.column_name,\\n columns.is_nullable,\\n columns.column_default,\\n columns.data_type\\n FROM information_schema.columns as columns\\n JOIN information_schema.tables as tables\\n ON tables.table_name = columns.table_name\\n AND tables.table_catalog = columns.table_catalog\\n AND tables.table_schema = columns.table_schema\\n WHERE columns.table_schema='public';\""}],"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"load(database:Avram::Database.class):DatabaseInfo-class-method","name":"load","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"Avram::Database.class"}],"args_string":"(database : Avram::Database.class) : DatabaseInfo","args_html":"(database : Avram::Database.class) : DatabaseInfo","location":{"filename":"src/avram/database/database_info.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L21"},"def":{"name":"load","args":[{"name":"database","external_name":"database","restriction":"Avram::Database.class"}],"return_type":"DatabaseInfo","visibility":"Public","body":"column_infos = database.query(SQL_QUERY) do |rs|\n ColumnInfo.from_rs(rs)\nend\ngrouped = column_infos.group_by(&.table)\ngrouped.each do |table, columns|\n columns.each do |c|\n table.columns << c\n end\nend\ntable_infos = grouped.keys\nnew(table_infos)\n"}},{"html_id":"new(table_infos:Array(Avram::Database::TableInfo))-class-method","name":"new","abstract":false,"args":[{"name":"table_infos","external_name":"table_infos","restriction":"::Array(::Avram::Database::TableInfo)"}],"args_string":"(table_infos : Array(Avram::Database::TableInfo))","args_html":"(table_infos : Array(Avram::Database::TableInfo))","location":{"filename":"src/avram/database/database_info.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L34"},"def":{"name":"new","args":[{"name":"table_infos","external_name":"table_infos","restriction":"::Array(::Avram::Database::TableInfo)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_infos)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"table(name:String):TableInfo|Nil-instance-method","name":"table","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : TableInfo | Nil","args_html":"(name : String) : TableInfo | Nil","location":{"filename":"src/avram/database/database_info.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L45"},"def":{"name":"table","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"TableInfo | ::Nil","visibility":"Public","body":"table_infos.find() do |__arg2|\n __arg2.table_name == name\nend"}},{"html_id":"table?(name:String):Bool-instance-method","name":"table?","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : Bool","args_html":"(name : String) : Bool","location":{"filename":"src/avram/database/database_info.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L37"},"def":{"name":"table?","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"Bool","visibility":"Public","body":"table_names.includes?(name)"}},{"html_id":"table_infos:Array(TableInfo)-instance-method","name":"table_infos","abstract":false,"location":{"filename":"src/avram/database/database_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L32"},"def":{"name":"table_infos","return_type":"Array(TableInfo)","visibility":"Public","body":"@table_infos"}},{"html_id":"table_infos=(table_infos:Array(TableInfo))-instance-method","name":"table_infos=","abstract":false,"args":[{"name":"table_infos","external_name":"table_infos","restriction":"Array(TableInfo)"}],"args_string":"(table_infos : Array(TableInfo))","args_html":"(table_infos : Array(TableInfo))","location":{"filename":"src/avram/database/database_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L32"},"def":{"name":"table_infos=","args":[{"name":"table_infos","external_name":"table_infos","restriction":"Array(TableInfo)"}],"visibility":"Public","body":"@table_infos = table_infos"}},{"html_id":"table_names:Array(String)-instance-method","name":"table_names","abstract":false,"location":{"filename":"src/avram/database/database_info.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/database_info.cr#L41"},"def":{"name":"table_names","return_type":"Array(String)","visibility":"Public","body":"table_infos.map(&.table_name)"}}]},{"html_id":"avram/Avram/Database/FiberId","path":"Avram/Database/FiberId.html","kind":"alias","full_name":"Avram::Database::FiberId","name":"FiberId","abstract":false,"locations":[{"filename":"src/avram/database.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"UInt64","aliased_html":"UInt64","const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"}},{"html_id":"avram/Avram/Database/TableInfo","path":"Avram/Database/TableInfo.html","kind":"struct","full_name":"Avram::Database::TableInfo","name":"TableInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/table_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"new(table_name:String,table_type:String,table_schema:String)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"::String"},{"name":"table_type","external_name":"table_type","restriction":"::String"},{"name":"table_schema","external_name":"table_schema","restriction":"::String"}],"args_string":"(table_name : String, table_type : String, table_schema : String)","args_html":"(table_name : String, table_type : String, table_schema : String)","location":{"filename":"src/avram/database/table_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L9"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"::String"},{"name":"table_type","external_name":"table_type","restriction":"::String"},{"name":"table_schema","external_name":"table_schema","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, table_type, table_schema)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column(name:String):ColumnInfo|Nil-instance-method","name":"column","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : ColumnInfo | Nil","args_html":"(name : String) : ColumnInfo | Nil","location":{"filename":"src/avram/database/table_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L32"},"def":{"name":"column","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"ColumnInfo | ::Nil","visibility":"Public","body":"columns.find() do |__arg1|\n __arg1.column_name == name\nend"}},{"html_id":"column?(name:String):Bool-instance-method","name":"column?","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : Bool","args_html":"(name : String) : Bool","location":{"filename":"src/avram/database/table_info.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L24"},"def":{"name":"column?","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"Bool","visibility":"Public","body":"column_names.includes?(name)"}},{"html_id":"column_names:Array(String)-instance-method","name":"column_names","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L28"},"def":{"name":"column_names","return_type":"Array(String)","visibility":"Public","body":"columns.map(&.column_name)"}},{"html_id":"columns:Array(Avram::Database::ColumnInfo)-instance-method","name":"columns","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L7"},"def":{"name":"columns","visibility":"Public","body":"@columns"}},{"html_id":"migrations_table?:Bool-instance-method","name":"migrations_table?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L36"},"def":{"name":"migrations_table?","return_type":"Bool","visibility":"Public","body":"table_name == \"migrations\""}},{"html_id":"table?:Bool-instance-method","name":"table?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L16"},"def":{"name":"table?","return_type":"Bool","visibility":"Public","body":"table_type == \"BASE TABLE\""}},{"html_id":"table_name:String-instance-method","name":"table_name","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L4"},"def":{"name":"table_name","return_type":"String","visibility":"Public","body":"@table_name"}},{"html_id":"table_schema:String-instance-method","name":"table_schema","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L6"},"def":{"name":"table_schema","return_type":"String","visibility":"Public","body":"@table_schema"}},{"html_id":"table_type:String-instance-method","name":"table_type","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L5"},"def":{"name":"table_type","return_type":"String","visibility":"Public","body":"@table_type"}},{"html_id":"view?:Bool-instance-method","name":"view?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database/table_info.cr#L20"},"def":{"name":"view?","return_type":"Bool","visibility":"Public","body":"table_type == \"VIEW\""}}]}]},{"html_id":"avram/Avram/DatabaseValidations","path":"Avram/DatabaseValidations.html","kind":"module","full_name":"Avram::DatabaseValidations(T)","name":"DatabaseValidations","abstract":false,"locations":[{"filename":"src/avram/database_validations.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/database_validations.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/DefineAttribute","path":"Avram/DefineAttribute.html","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute","abstract":false,"locations":[{"filename":"src/avram/define_attribute.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"attributes-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L34"},"def":{"name":"attributes","visibility":"Public","body":"[] of Avram::PermittedAttribute(Nil)"}}],"macros":[{"html_id":"attribute(type_declaration)-macro","name":"attribute","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/define_attribute.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L36"},"def":{"name":"attribute","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.type.is_a?(Union) %}\n {% if type_declaration.value.is_a?(Nop) %}\n {% default_value = \"\" %}\n {% else %}\n {% default_value = \"= #{type_declaration.value}\" %}\n {% end %}\n {% raise(\"`attribute` in #{@type} must not be called with a type union or nilable type but was called with #{type_declaration.type}\\nIf you were attempting to create a nilable attribute, all attributes are considered nilable by default.\\n\\nTry this...\\n\\n attribute #{type_declaration.var} : #{type_declaration.type.types.first} #{default_value.id}\\n\\nRead more on attributes: https://luckyframework.org/guides/database/validating-saving\") %}\n {% end %}\n\n\n \n{% ATTRIBUTES << type_declaration %}\n\n\n \n{% type = type_declaration.type %}\n\n \n{% name = type_declaration.var %}\n\n \n{% default_value = if type_declaration.value.is_a?(Nop)\n nil\nelse\n type_declaration.value\nend %}\n\n @_\n{{ name }}\n : Avram::Attribute(\n{{ type }}\n)?\n\n \nensure_base_attributes_method_is_present\n\n def attributes\n ([\n{{ name }}\n] + previous_def + super).uniq\n \nend\n\n def \n{{ name }}\n\n _\n{{ name }}\n.permitted\n \nend\n\n private def _\n{{ name }}\n\n @_\n{{ name }}\n ||= Avram::Attribute(\n{{ type }}\n).new(\n name: \n{{ name.id.symbolize }}\n,\n value: \n{{ default_value }}\n,\n param_key: self.class.param_key\n ).tap do |attribute|\n attribute.extract(params)\n \nend\n \nend\n \n"}},{"html_id":"ensure_base_attributes_method_is_present-macro","name":"ensure_base_attributes_method_is_present","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L2"},"def":{"name":"ensure_base_attributes_method_is_present","visibility":"Public","body":" \n{% if !(@type.methods.map(&.name).includes?((:attributes).id)) %}\n def attributes\n [] of Avram::PermittedAttribute(Nil)\n end\n {% end %}\n\n \n"}},{"html_id":"file_attribute(key)-macro","name":"file_attribute","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/define_attribute.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L90"},"def":{"name":"file_attribute","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" \n{% if key.is_a?(SymbolLiteral) %}{% else %}\n {% raise(\"file_attribute must be declared with a Symbol\") %}\n {% end %}\n\n\n attribute \n{{ key.id }}\n : Avram::Uploadable\n \n"}},{"html_id":"inherit_attributes-macro","name":"inherit_attributes","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/define_attribute.cr#L18"},"def":{"name":"inherit_attributes","visibility":"Public","body":" \n\\{% if\n !@type.constant(:ATTRIBUTES) %}\n ATTRIBUTES = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n attribute in @type.ancestors.first.constant :ATTRIBUTES %}\n \n\\{% \nATTRIBUTES << attribute %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_attributes\n \nend\n \n"}}]},{"html_id":"avram/Avram/DeleteOperation","path":"Avram/DeleteOperation.html","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L34"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"T.name.underscore"}}],"instance_methods":[{"html_id":"after_delete(_record:T)-instance-method","name":"after_delete","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/delete_operation.cr","line_number":89,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L89"},"def":{"name":"after_delete","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"before_delete-instance-method","name":"before_delete","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L87"},"def":{"name":"before_delete","visibility":"Public","body":""}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"delete:Bool-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L38"},"def":{"name":"delete","return_type":"Bool","visibility":"Public","body":"before_delete\nif valid?\n result = delete_or_soft_delete(@record)\n @record = result\n after_delete(@record)\n publish_delete_success_event\n mark_as_deleted\nelse\n publish_delete_failed_event\n mark_as_failed\nend\n"}},{"html_id":"delete!-instance-method","name":"delete!","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":53,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L53"},"def":{"name":"delete!","visibility":"Public","body":"if delete\n @record\nelse\n raise(Avram::InvalidOperationError.new(operation: self))\nend"}},{"html_id":"deleted?:Bool-instance-method","name":"deleted?","doc":"Returns true if the operation has run and saved the record successfully","summary":"

Returns true if the operation has run and saved the record successfully

","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L78"},"def":{"name":"deleted?","return_type":"Bool","visibility":"Public","body":"delete_status == OperationStatus::Deleted"}},{"html_id":"mark_as_deleted:Bool-instance-method","name":"mark_as_deleted","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L72"},"def":{"name":"mark_as_deleted","return_type":"Bool","visibility":"Public","body":"self.delete_status = OperationStatus::Deleted\ntrue\n"}},{"html_id":"mark_as_failed:Bool-instance-method","name":"mark_as_failed","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L82"},"def":{"name":"mark_as_failed","return_type":"Bool","visibility":"Public","body":"self.delete_status = OperationStatus::DeleteFailed\nfalse\n"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L67"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}}],"types":[{"html_id":"avram/Avram/DeleteOperation/OperationStatus","path":"Avram/DeleteOperation/OperationStatus.html","kind":"enum","full_name":"Avram::DeleteOperation::OperationStatus","name":"OperationStatus","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L19"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Deleted","name":"Deleted","value":"0"},{"id":"DeleteFailed","name":"DeleteFailed","value":"1"},{"id":"Unperformed","name":"Unperformed","value":"2"}],"namespace":{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},"instance_methods":[{"html_id":"delete_failed?-instance-method","name":"delete_failed?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L21"},"def":{"name":"delete_failed?","visibility":"Public","body":"self == DeleteFailed"}},{"html_id":"deleted?-instance-method","name":"deleted?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L20"},"def":{"name":"deleted?","visibility":"Public","body":"self == Deleted"}},{"html_id":"unperformed?-instance-method","name":"unperformed?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation.cr#L22"},"def":{"name":"unperformed?","visibility":"Public","body":"self == Unperformed"}}]}]},{"html_id":"avram/Avram/DeleteOperationTemplate","path":"Avram/DeleteOperationTemplate.html","kind":"class","full_name":"Avram::DeleteOperationTemplate","name":"DeleteOperationTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, *args, **named_args)","args_html":"(type, columns, *args, **named_args)","location":{"filename":"src/avram/delete_operation_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/delete_operation_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":2,"visibility":"Public","body":" def delete_operation_class : ::\n{{ type }}\n::DeleteOperation.class\n ::\n{{ type }}\n::DeleteOperation\n \nend\n\n class ::\n{{ type }}\n::DeleteOperation < Avram::DeleteOperation(\n{{ type }}\n)\n\n add_column_attributes(\n{{ columns }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/Events","path":"Avram/Events.html","kind":"module","full_name":"Avram::Events","name":"Events","abstract":false,"locations":[{"filename":"src/avram/events/delete_failed_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Events/DeleteFailedEvent","path":"Avram/Events/DeleteFailedEvent.html","kind":"class","full_name":"Avram::Events::DeleteFailedEvent","name":"DeleteFailedEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/delete_failed_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,errors:Hash(Symbol,Array(String)))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Hash(Symbol, Array(String))"}],"args_string":"(operation_class : String, errors : Hash(Symbol, Array(String)))","args_html":"(operation_class : String, errors : Hash(Symbol, Array(String)))","location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Hash(Symbol, Array(String))"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, errors)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"error_messages_as_string-instance-method","name":"error_messages_as_string","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L10"},"def":{"name":"error_messages_as_string","visibility":"Public","body":"String.build do |msg|\n errors.each do |key, messages|\n msg << \"#{key} #{messages.join(\", \")}\"\n end\nend"}},{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L2"},"def":{"name":"errors","visibility":"Public","body":"@errors"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_failed_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/DeleteSuccessEvent","path":"Avram/Events/DeleteSuccessEvent.html","kind":"class","full_name":"Avram::Events::DeleteSuccessEvent","name":"DeleteSuccessEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/delete_success_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_success_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String)-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"}],"args_string":"(operation_class : String)","args_html":"(operation_class : String)","location":{"filename":"src/avram/events/delete_success_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_success_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/delete_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/delete_success_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/FailedQueryEvent","path":"Avram/Events/FailedQueryEvent.html","kind":"class","full_name":"Avram::Events::FailedQueryEvent","name":"FailedQueryEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/failed_query_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(error_message:String,query:String,args:String|Nil,queryable:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"error_message","external_name":"error_message","restriction":"String"},{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(error_message : String, query : String, args : String | Nil, queryable : String | Nil = nil)","args_html":"(error_message : String, query : String, args : String | Nil, queryable : String | Nil = nil)","location":{"filename":"src/avram/events/failed_query_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L4"},"def":{"name":"new","args":[{"name":"error_message","external_name":"error_message","restriction":"String"},{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(error_message, query, args, queryable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:String?-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"args","visibility":"Public","body":"@args"}},{"html_id":"error_message:String-instance-method","name":"error_message","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"error_message","visibility":"Public","body":"@error_message"}},{"html_id":"query:String-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"query","visibility":"Public","body":"@query"}},{"html_id":"queryable:String?-instance-method","name":"queryable","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"queryable","visibility":"Public","body":"@queryable"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/QueryEvent","path":"Avram/Events/QueryEvent.html","kind":"class","full_name":"Avram::Events::QueryEvent","name":"QueryEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/TimedEvent","kind":"class","full_name":"Pulsar::TimedEvent","name":"TimedEvent"},"ancestors":[{"html_id":"avram/Pulsar/TimedEvent","kind":"class","full_name":"Pulsar::TimedEvent","name":"TimedEvent"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/query_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(query:String,args:String|Nil,queryable:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query : String, args : String | Nil, queryable : String | Nil = nil)","args_html":"(query : String, args : String | Nil, queryable : String | Nil = nil)","location":{"filename":"src/avram/events/query_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L4"},"def":{"name":"new","args":[{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(query, args, queryable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:String?-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L2"},"def":{"name":"args","visibility":"Public","body":"@args"}},{"html_id":"query:String-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L2"},"def":{"name":"query","visibility":"Public","body":"@query"}},{"html_id":"queryable:String?-instance-method","name":"queryable","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/query_event.cr#L2"},"def":{"name":"queryable","visibility":"Public","body":"@queryable"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/SaveFailedEvent","path":"Avram/Events/SaveFailedEvent.html","kind":"class","full_name":"Avram::Events::SaveFailedEvent","name":"SaveFailedEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/save_failed_event.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,attributes:Array(Avram::GenericAttribute))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"args_string":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","args_html":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","location":{"filename":"src/avram/events/save_failed_event.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L7"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, attributes)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attributes:Array(Avram::GenericAttribute)-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L5"},"def":{"name":"attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"@attributes"}},{"html_id":"error_messages_as_string:String-instance-method","name":"error_messages_as_string","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L17"},"def":{"name":"error_messages_as_string","return_type":"String","visibility":"Public","body":"invalid_attributes.join(\". \") do |attribute|\n \"#{attribute.name} #{attribute.errors.join(\", \")}\"\nend"}},{"html_id":"invalid_attributes:Array(Avram::GenericAttribute)-instance-method","name":"invalid_attributes","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L13"},"def":{"name":"invalid_attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"attributes.reject(&.valid?)"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_failed_event.cr#L4"},"def":{"name":"operation_class","return_type":"String","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/SaveSuccessEvent","path":"Avram/Events/SaveSuccessEvent.html","kind":"class","full_name":"Avram::Events::SaveSuccessEvent","name":"SaveSuccessEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/save_success_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_success_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,attributes:Array(Avram::GenericAttribute))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"args_string":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","args_html":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","location":{"filename":"src/avram/events/save_success_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_success_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, attributes)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attributes:Array(Avram::GenericAttribute)-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/events/save_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_success_event.cr#L2"},"def":{"name":"attributes","visibility":"Public","body":"@attributes"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/save_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/events/save_success_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]}]},{"html_id":"avram/Avram/ExtractCriteria","path":"Avram/ExtractCriteria.html","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/extract_criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria_extensions/extract_criteria.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Factory","path":"Avram/Factory.html","kind":"class","full_name":"Avram::Factory","name":"Factory","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/factory.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SEQUENCES","name":"SEQUENCES","value":"{} of String => Int32"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"build_attributes(&)-class-method","name":"build_attributes","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L66"},"def":{"name":"build_attributes","yields":1,"block_arity":1,"visibility":"Public","body":"(yield(new)).attributes"}},{"html_id":"build_attributes-class-method","name":"build_attributes","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L70"},"def":{"name":"build_attributes","visibility":"Public","body":"new.attributes"}},{"html_id":"create-class-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L74"},"def":{"name":"create","visibility":"Public","body":"new.create"}},{"html_id":"create(&)-class-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L78"},"def":{"name":"create","yields":1,"block_arity":1,"visibility":"Public","body":"(yield(new)).create"}},{"html_id":"create_pair-class-method","name":"create_pair","doc":"Returns an array with 2 instances of the model from the Factory.\n\nUsage:\n\n```\ntags = TagFactory.create_pair\ntypeof(tags) # => Array(Tag)\ntags.size # => 2\n```","summary":"

Returns an array with 2 instances of the model from the Factory.

","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L97"},"def":{"name":"create_pair","visibility":"Public","body":"create_pair do |factory|\n factory\nend"}},{"html_id":"create_pair(&)-class-method","name":"create_pair","doc":"Similar to `create_pair`, but accepts a block which yields the factory instance.\n\nBoth factories receive the same argument values.\n\nUsage:\n\n```\nTagFactory.create_pair do |factory|\n # set both factories name to \"test\"\n factory.name(\"test\")\nend\n```","summary":"

Similar to .create_pair, but accepts a block which yields the factory instance.

","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":113,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L113"},"def":{"name":"create_pair","yields":1,"block_arity":1,"visibility":"Public","body":"[1, 2].map do |n|\n self.create do |factory|\n yield(factory)\n end\nend"}}],"instance_methods":[{"html_id":"create-instance-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L82"},"def":{"name":"create","visibility":"Public","body":"run_before_save_callbacks\nrecord = operation.save!\nrun_after_save_callbacks(record)\n"}},{"html_id":"operation-instance-method","name":"operation","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L2"},"def":{"name":"operation","visibility":"Public","body":"@operation"}},{"html_id":"sequence(value:String):String-instance-method","name":"sequence","doc":"Returns a value with a number to use for unique values.\n\nUsage:\n\n```\nclass UserFactory < Avram::Factory\n def initialize\n username sequence(\"username\") # => username-1, username-2, etc.\n email \"#{sequence(\"email\")}@example.com\" # => email-1@example.com, email-2@example.com, etc.\n end\nend\n```","summary":"

Returns a value with a number to use for unique values.

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/factory.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L131"},"def":{"name":"sequence","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"__temp_91 = value\n__temp_92 = SEQUENCES\n__temp_92[__temp_91]? || (__temp_92[__temp_91] = 0)\n__temp_93 = value\n__temp_94 = SEQUENCES\n__temp_94[__temp_93] = __temp_94[__temp_93] + 1\n\"#{value}-#{SEQUENCES[value]}\"\n"}}],"macros":[{"html_id":"setup_attribute_shortcuts(operation)-macro","name":"setup_attribute_shortcuts","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/factory.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L20"},"def":{"name":"setup_attribute_shortcuts","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":" \n{% for attribute in operation.resolve.constant(:COLUMN_ATTRIBUTES) %}\n def {{ attribute[:name] }}(value : {{ attribute[:type] }}{% if attribute[:nilable] %}?{% end %})\n operation.{{ attribute[:name] }}.value = value\n self\n end\n {% end %}\n\n \n"}},{"html_id":"setup_attributes(operation)-macro","name":"setup_attributes","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/factory.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L29"},"def":{"name":"setup_attributes","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":" def attributes\n \n{\n \n{% for attribute in operation.resolve.constant(:COLUMN_ATTRIBUTES) %}\n {{ attribute[:name] }}: operation.{{ attribute[:name] }}.value,\n {% end %}\n\n }\n \nend\n \n"}},{"html_id":"setup_callbacks(model_name)-macro","name":"setup_callbacks","abstract":false,"args":[{"name":"model_name","external_name":"model_name","restriction":""}],"args_string":"(model_name)","args_html":"(model_name)","location":{"filename":"src/avram/factory.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/factory.cr#L39"},"def":{"name":"setup_callbacks","args":[{"name":"model_name","external_name":"model_name","restriction":""}],"visibility":"Public","body":" \n# Run `block` before the record is created\n\n def before_save(&block : -> Nil) : self\n @before_saves << block\n\n self\n \nend\n\n \n# Run `block` after the record is created.\n\n \n# The block will yield the created record instance\n\n def after_save(&block : \n{{ model_name.id }}\n -> Nil) : self\n @after_saves << block\n\n self\n \nend\n\n private def run_before_save_callbacks\n @before_saves.each(&.call)\n \nend\n\n private def run_after_save_callbacks(record : \n{{ model_name.id }}\n)\n @after_saves.each(&.call(record))\n\n record\n \nend\n \n"}}]},{"html_id":"avram/Avram/FailedMigration","path":"Avram/FailedMigration.html","kind":"class","full_name":"Avram::FailedMigration","name":"FailedMigration","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":160,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L160"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(migration:String,statements:Array(String),cause:Exception)-class-method","name":"new","abstract":false,"args":[{"name":"migration","external_name":"migration","restriction":"String"},{"name":"statements","external_name":"statements","restriction":"Array(String)"},{"name":"cause","external_name":"cause","restriction":"Exception"}],"args_string":"(migration : String, statements : Array(String), cause : Exception)","args_html":"(migration : String, statements : Array(String), cause : Exception)","location":{"filename":"src/avram/errors.cr","line_number":164,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L164"},"def":{"name":"new","args":[{"name":"migration","external_name":"migration","restriction":"String"},{"name":"statements","external_name":"statements","restriction":"Array(String)"},{"name":"cause","external_name":"cause","restriction":"Exception"}],"visibility":"Public","body":"_ = allocate\n_.initialize(migration, statements, cause)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"migration:String-instance-method","name":"migration","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":161,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L161"},"def":{"name":"migration","return_type":"String","visibility":"Public","body":"@migration"}},{"html_id":"statements:Array(String)-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L162"},"def":{"name":"statements","return_type":"Array(String)","visibility":"Public","body":"@statements"}}]},{"html_id":"avram/Avram/FailedOperation","path":"Avram/FailedOperation.html","kind":"class","full_name":"Avram::FailedOperation","name":"FailedOperation","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":157,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L157"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Used when `Avram::Operation` fails.","summary":"

Used when Avram::Operation fails.

"},{"html_id":"avram/Avram/GenericAttribute","path":"Avram/GenericAttribute.html","kind":"class","full_name":"Avram::GenericAttribute","name":"GenericAttribute","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/generic_attribute.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"A generic version of `Avram::Attribute` that is used for reporting and metrics.\n\nThis is a data only version of an `Avram::Atribute`. It is purely for\nretrieving and reporting on data. For example, `Avram::GenericAttribute` is\nused by `Avram::Events::SaveFailedEvent` so that subscribers can\nget information about attributes that failed to save.","summary":"

A generic version of Avram::Attribute that is used for reporting and metrics.

","constructors":[{"html_id":"new(name:Symbol,param:String|Nil,original_value:String|Nil,value:String|Nil,param_key:String,errors:Array(String))-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"Symbol"},{"name":"param","external_name":"param","restriction":"String | ::Nil"},{"name":"original_value","external_name":"original_value","restriction":"String | ::Nil"},{"name":"value","external_name":"value","restriction":"String | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Array(String)"}],"args_string":"(name : Symbol, param : String | Nil, original_value : String | Nil, value : String | Nil, param_key : String, errors : Array(String))","args_html":"(name : Symbol, param : String | Nil, original_value : String | Nil, value : String | Nil, param_key : String, errors : Array(String))","location":{"filename":"src/avram/generic_attribute.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L15"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"Symbol"},{"name":"param","external_name":"param","restriction":"String | ::Nil"},{"name":"original_value","external_name":"original_value","restriction":"String | ::Nil"},{"name":"value","external_name":"value","restriction":"String | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Array(String)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, param, original_value, value, param_key, errors)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"errors:Array(String)-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L13"},"def":{"name":"errors","return_type":"Array(String)","visibility":"Public","body":"@errors"}},{"html_id":"name:Symbol-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L8"},"def":{"name":"name","return_type":"Symbol","visibility":"Public","body":"@name"}},{"html_id":"original_value:String|Nil-instance-method","name":"original_value","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L10"},"def":{"name":"original_value","return_type":"String | ::Nil","visibility":"Public","body":"@original_value"}},{"html_id":"param:String|Nil-instance-method","name":"param","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L9"},"def":{"name":"param","return_type":"String | ::Nil","visibility":"Public","body":"@param"}},{"html_id":"param_key:String-instance-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L12"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"@param_key"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L25"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"errors.empty?"}},{"html_id":"value:String|Nil-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/generic_attribute.cr#L11"},"def":{"name":"value","return_type":"String | ::Nil","visibility":"Public","body":"@value"}}]},{"html_id":"avram/Avram/HabitatSettings","path":"Avram/HabitatSettings.html","kind":"class","full_name":"Avram::HabitatSettings","name":"HabitatSettings","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"database_to_migrate:Avram::Database.class-class-method","name":"database_to_migrate","abstract":false,"def":{"name":"database_to_migrate","return_type":"Avram::Database.class","visibility":"Public","body":"@@database_to_migrate.not_nil!"}},{"html_id":"database_to_migrate=(value:Avram::Database.class)-class-method","name":"database_to_migrate=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::Database.class"}],"args_string":"(value : Avram::Database.class)","args_html":"(value : Avram::Database.class)","def":{"name":"database_to_migrate=","args":[{"name":"value","external_name":"value","restriction":"Avram::Database.class"}],"visibility":"Public","body":"@@database_to_migrate = value"}},{"html_id":"database_to_migrate?-class-method","name":"database_to_migrate?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use database_to_migrate in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use database_to_migrate in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"database_to_migrate?","visibility":"Public","body":"@@database_to_migrate"}},{"html_id":"i18n_backend:Avram::I18nBackend-class-method","name":"i18n_backend","abstract":false,"def":{"name":"i18n_backend","return_type":"Avram::I18nBackend","visibility":"Public","body":"@@i18n_backend.not_nil!"}},{"html_id":"i18n_backend=(value:Avram::I18nBackend)-class-method","name":"i18n_backend=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::I18nBackend"}],"args_string":"(value : Avram::I18nBackend)","args_html":"(value : Avram::I18nBackend)","def":{"name":"i18n_backend=","args":[{"name":"value","external_name":"value","restriction":"Avram::I18nBackend"}],"visibility":"Public","body":"@@i18n_backend = value"}},{"html_id":"i18n_backend?-class-method","name":"i18n_backend?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use i18n_backend in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use i18n_backend in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"i18n_backend?","visibility":"Public","body":"@@i18n_backend"}},{"html_id":"lazy_load_enabled:Bool-class-method","name":"lazy_load_enabled","abstract":false,"def":{"name":"lazy_load_enabled","return_type":"Bool","visibility":"Public","body":"@@lazy_load_enabled.not_nil!"}},{"html_id":"lazy_load_enabled=(value:Bool)-class-method","name":"lazy_load_enabled=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","def":{"name":"lazy_load_enabled=","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"@@lazy_load_enabled = value"}},{"html_id":"lazy_load_enabled?-class-method","name":"lazy_load_enabled?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use lazy_load_enabled in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use lazy_load_enabled in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"lazy_load_enabled?","visibility":"Public","body":"@@lazy_load_enabled"}},{"html_id":"query_cache_enabled:Bool-class-method","name":"query_cache_enabled","abstract":false,"def":{"name":"query_cache_enabled","return_type":"Bool","visibility":"Public","body":"@@query_cache_enabled.not_nil!"}},{"html_id":"query_cache_enabled=(value:Bool)-class-method","name":"query_cache_enabled=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","def":{"name":"query_cache_enabled=","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"@@query_cache_enabled = value"}},{"html_id":"query_cache_enabled?-class-method","name":"query_cache_enabled?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use query_cache_enabled in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use query_cache_enabled in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"query_cache_enabled?","visibility":"Public","body":"@@query_cache_enabled"}},{"html_id":"time_formats:Array(String)-class-method","name":"time_formats","abstract":false,"def":{"name":"time_formats","return_type":"Array(String)","visibility":"Public","body":"@@time_formats.not_nil!"}},{"html_id":"time_formats=(value:Array(String))-class-method","name":"time_formats=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Array(String)"}],"args_string":"(value : Array(String))","args_html":"(value : Array(String))","def":{"name":"time_formats=","args":[{"name":"value","external_name":"value","restriction":"Array(String)"}],"visibility":"Public","body":"@@time_formats = value"}},{"html_id":"time_formats?-class-method","name":"time_formats?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use time_formats in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use time_formats in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"time_formats?","visibility":"Public","body":"@@time_formats"}},{"html_id":"to_h-class-method","name":"to_h","doc":"Generates a hash using the provided values","summary":"

Generates a hash using the provided values

","abstract":false,"def":{"name":"to_h","visibility":"Public","body":"{\"lazy_load_enabled\" => lazy_load_enabled, \"database_to_migrate\" => database_to_migrate, \"time_formats\" => time_formats, \"i18n_backend\" => i18n_backend, \"query_cache_enabled\" => query_cache_enabled}"}}]},{"html_id":"avram/Avram/I18n","path":"Avram/I18n.html","kind":"struct","full_name":"Avram::I18n","name":"I18n","abstract":false,"superclass":{"html_id":"avram/Avram/I18nBackend","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend"},"ancestors":[{"html_id":"avram/Avram/I18nBackend","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/i18n_backend.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L5"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"get(key:String|Symbol):String-instance-method","name":"get","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"args_string":"(key : String | Symbol) : String","args_html":"(key : String | Symbol) : String","location":{"filename":"src/avram/i18n_backend.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L6"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"return_type":"String","visibility":"Public","body":"{validate_acceptance_of: \"must be accepted\", validate_at_most_one_filled: \"must be blank\", validate_confirmation_of: \"must match\", validate_exact_size_of: \"must be exactly %d characters long\", validate_exactly_one_filled: \"at least one must be filled\", validate_format_of: \"is invalid\", validate_inclusion_of: \"is not included in the list\", validate_max_size_of: \"must not have more than %d characters\", validate_min_size_of: \"must have at least %d characters\", validate_numeric_max: \"must be no more than %s\", validate_numeric_min: \"must be at least %s\", validate_numeric_nil: \"must not be nil\", validate_required: \"is required\", validate_uniqueness_of: \"is already taken\"}[key]"}}]},{"html_id":"avram/Avram/I18nBackend","path":"Avram/I18nBackend.html","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend","abstract":true,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/I18n","kind":"struct","full_name":"Avram::I18n","name":"I18n"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L1"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"get(key:String|Symbol):String-instance-method","name":"get","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"args_string":"(key : String | Symbol) : String","args_html":"(key : String | Symbol) : String","location":{"filename":"src/avram/i18n_backend.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L2"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"return_type":"String","visibility":"Public","body":""}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/i18n_backend.cr#L1"},"def":{"name":"initialize","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/ImpossibleValidation","path":"Avram/ImpossibleValidation.html","kind":"class","full_name":"Avram::ImpossibleValidation","name":"ImpossibleValidation","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L50"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when a validation is expecting an impossible constraint","summary":"

Raised when a validation is expecting an impossible constraint

","constructors":[{"html_id":"new(attribute:Symbol,message:String=\"animpossiblevalidation\")-class-method","name":"new","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Symbol"},{"name":"message","default_value":"\"an impossible validation\"","external_name":"message","restriction":"String"}],"args_string":"(attribute : Symbol, message : String = \"an impossible validation\")","args_html":"(attribute : Symbol, message : String = "an impossible validation")","location":{"filename":"src/avram/errors.cr","line_number":53,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L53"},"def":{"name":"new","args":[{"name":"attribute","external_name":"attribute","restriction":"Symbol"},{"name":"message","default_value":"\"an impossible validation\"","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(attribute, message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attribute:Symbol-instance-method","name":"attribute","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L51"},"def":{"name":"attribute","return_type":"Symbol","visibility":"Public","body":"@attribute"}}]},{"html_id":"avram/Avram/IncludesCriteria","path":"Avram/IncludesCriteria.html","kind":"module","full_name":"Avram::IncludesCriteria(T, V)","name":"IncludesCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/includes_criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria_extensions/includes_criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/String/Lucky/Criteria","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/UUID/Lucky/Criteria","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/InheritColumnAttributes","path":"Avram/InheritColumnAttributes.html","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes","abstract":false,"locations":[{"filename":"src/avram/inherit_column_attributes.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/inherit_column_attributes.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"inherit_column_attributes-macro","name":"inherit_column_attributes","abstract":false,"location":{"filename":"src/avram/inherit_column_attributes.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/inherit_column_attributes.cr#L8"},"def":{"name":"inherit_column_attributes","visibility":"Public","body":" \n\\{% if\n !@type.constant(:COLUMN_ATTRIBUTES) %}\n COLUMN_ATTRIBUTES = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n attribute in @type.ancestors.first.constant :COLUMN_ATTRIBUTES %}\n \n\\{% \nCOLUMN_ATTRIBUTES << attribute %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_column_attributes\n \nend\n \n"}}]},{"html_id":"avram/Avram/Insert","path":"Avram/Insert.html","kind":"class","full_name":"Avram::Insert","name":"Insert","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/insert.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(table:TableName,params:Params,column_names:Array(Symbol)=[]ofSymbol)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"params","external_name":"params","restriction":"Params"},{"name":"column_names","default_value":"[] of Symbol","external_name":"column_names","restriction":"Array(Symbol)"}],"args_string":"(table : TableName, params : Params, column_names : Array(Symbol) = [] of Symbol)","args_html":"(table : TableName, params : Params, column_names : Array(Symbol) = [] of Symbol)","location":{"filename":"src/avram/insert.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L4"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"params","external_name":"params","restriction":"Params"},{"name":"column_names","default_value":"[] of Symbol","external_name":"column_names","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, params, column_names)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/insert.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L19"},"def":{"name":"args","visibility":"Public","body":"@params.values"}},{"html_id":"statement:String-instance-method","name":"statement","abstract":false,"location":{"filename":"src/avram/insert.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L7"},"def":{"name":"statement","return_type":"String","visibility":"Public","body":"\"insert into #{@table}(#{fields}) values(#{values_placeholders}) returning #{returning}\""}}],"types":[{"html_id":"avram/Avram/Insert/Params","path":"Avram/Insert/Params.html","kind":"alias","full_name":"Avram::Insert::Params","name":"Params","abstract":false,"locations":[{"filename":"src/avram/insert.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/insert.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Hash(Symbol, Nil) | Hash(Symbol, String | Nil) | Hash(Symbol, String))","aliased_html":"Hash(Symbol, Nil) | Hash(Symbol, String?) | Hash(Symbol, String)","const":false,"namespace":{"html_id":"avram/Avram/Insert","kind":"class","full_name":"Avram::Insert","name":"Insert"}}]},{"html_id":"avram/Avram/InvalidDatabaseNameError","path":"Avram/InvalidDatabaseNameError.html","kind":"class","full_name":"Avram::InvalidDatabaseNameError","name":"InvalidDatabaseNameError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":150,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L150"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/InvalidOperationError","path":"Avram/InvalidOperationError.html","kind":"class","full_name":"Avram::InvalidOperationError","name":"InvalidOperationError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Lucky/RenderableError","kind":"module","full_name":"Lucky::RenderableError","name":"RenderableError"},{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L59"},{"filename":"src/lucky/ext/avram/errors.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/RenderableError","kind":"module","full_name":"Lucky::RenderableError","name":"RenderableError"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when using the create!, update!, or delete! methods on an operation when it does not have the proper attributes","summary":"

Raised when using the create!, update!, or delete! methods on an operation when it does not have the proper attributes

","constructors":[{"html_id":"new(operation)-class-method","name":"new","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/errors.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L62"},"def":{"name":"new","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L60"},"def":{"name":"errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@errors"}},{"html_id":"invalid_attribute_name:String-instance-method","name":"invalid_attribute_name","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L17"},"def":{"name":"invalid_attribute_name","return_type":"String","visibility":"Public","body":"invalid_attribute[0].to_s"}},{"html_id":"renderable_details:String-instance-method","name":"renderable_details","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L13"},"def":{"name":"renderable_details","return_type":"String","visibility":"Public","body":"\"#{invalid_attribute_name} #{validation_messages.first}\""}},{"html_id":"renderable_message:String-instance-method","name":"renderable_message","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L9"},"def":{"name":"renderable_message","return_type":"String","visibility":"Public","body":"\"Invalid params\""}},{"html_id":"renderable_status:Int32-instance-method","name":"renderable_status","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/ext/avram/errors.cr#L5"},"def":{"name":"renderable_status","return_type":"Int32","visibility":"Public","body":"400"}}]},{"html_id":"avram/Avram/InvalidQueryError","path":"Avram/InvalidQueryError.html","kind":"class","full_name":"Avram::InvalidQueryError","name":"InvalidQueryError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L153"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Join","path":"Avram/Join.html","kind":"module","full_name":"Avram::Join","name":"Join","abstract":false,"locations":[{"filename":"src/avram/join.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Join/Full","path":"Avram/Join/Full.html","kind":"class","full_name":"Avram::Join::Full","name":"Full","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L63"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L64"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"FULL\""}}]},{"html_id":"avram/Avram/Join/Inner","path":"Avram/Join/Inner.html","kind":"class","full_name":"Avram::Join::Inner","name":"Inner","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L46"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"INNER\""}}]},{"html_id":"avram/Avram/Join/Left","path":"Avram/Join/Left.html","kind":"class","full_name":"Avram::Join::Left","name":"Left","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L51"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L52"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"LEFT\""}}]},{"html_id":"avram/Avram/Join/Right","path":"Avram/Join/Right.html","kind":"class","full_name":"Avram::Join::Right","name":"Right","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L57"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L58"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"RIGHT\""}}]},{"html_id":"avram/Avram/Join/SqlClause","path":"Avram/Join/SqlClause.html","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Join/Full","kind":"class","full_name":"Avram::Join::Full","name":"Full"},{"html_id":"avram/Avram/Join/Inner","kind":"class","full_name":"Avram::Join::Inner","name":"Inner"},{"html_id":"avram/Avram/Join/Left","kind":"class","full_name":"Avram::Join::Left","name":"Left"},{"html_id":"avram/Avram/Join/Right","kind":"class","full_name":"Avram::Join::Right","name":"Right"}],"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"constructors":[{"html_id":"new(from:TableName,to:TableName,primary_key:Symbol|Nil=nil,foreign_key:Symbol|Nil=nil,comparison:String|Nil=\"=\",using:Array(Symbol)=[]ofSymbol)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"primary_key","default_value":"nil","external_name":"primary_key","restriction":"Symbol | ::Nil"},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":"Symbol | ::Nil"},{"name":"comparison","default_value":"\"=\"","external_name":"comparison","restriction":"String | ::Nil"},{"name":"using","default_value":"[] of Symbol","external_name":"using","restriction":"Array(Symbol)"}],"args_string":"(from : TableName, to : TableName, primary_key : Symbol | Nil = nil, foreign_key : Symbol | Nil = nil, comparison : String | Nil = \"=\", using : Array(Symbol) = [] of Symbol)","args_html":"(from : TableName, to : TableName, primary_key : Symbol | Nil = nil, foreign_key : Symbol | Nil = nil, comparison : String | Nil = "=", using : Array(Symbol) = [] of Symbol)","location":{"filename":"src/avram/join.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L8"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"primary_key","default_value":"nil","external_name":"primary_key","restriction":"Symbol | ::Nil"},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":"Symbol | ::Nil"},{"name":"comparison","default_value":"\"=\"","external_name":"comparison","restriction":"String | ::Nil"},{"name":"using","default_value":"[] of Symbol","external_name":"using","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, to, primary_key, foreign_key, comparison, using)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone:self-instance-method","name":"clone","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L40"},"def":{"name":"clone","return_type":"self","visibility":"Public","body":"self"}},{"html_id":"default_foreign_key:String-instance-method","name":"default_foreign_key","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L36"},"def":{"name":"default_foreign_key","return_type":"String","visibility":"Public","body":"(Wordsmith::Inflector.singularize(@from)) + \"_id\""}},{"html_id":"from:TableName-instance-method","name":"from","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L5"},"def":{"name":"from","return_type":"TableName","visibility":"Public","body":"@from"}},{"html_id":"from_column:String-instance-method","name":"from_column","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L28"},"def":{"name":"from_column","return_type":"String","visibility":"Public","body":"\"#{@from}.#{@primary_key || \"id\"}\""}},{"html_id":"join_type:String-instance-method","name":"join_type","abstract":true,"location":{"filename":"src/avram/join.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L18"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":""}},{"html_id":"to:TableName-instance-method","name":"to","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L6"},"def":{"name":"to","return_type":"TableName","visibility":"Public","body":"@to"}},{"html_id":"to_column:String-instance-method","name":"to_column","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L32"},"def":{"name":"to_column","return_type":"String","visibility":"Public","body":"\"#{@to}.#{@foreign_key || default_foreign_key}\""}},{"html_id":"to_sql:String-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/join.cr#L20"},"def":{"name":"to_sql","return_type":"String","visibility":"Public","body":"if !@using.empty?\n \"#{join_type} JOIN #{@to} USING (#{@using.join(\", \")})\"\nelse\n \"#{join_type} JOIN #{@to} ON #{from_column} #{@comparison} #{to_column}\"\nend"}}]}]},{"html_id":"avram/Avram/LazyLoadError","path":"Avram/LazyLoadError.html","kind":"class","full_name":"Avram::LazyLoadError","name":"LazyLoadError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L16"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when trying to access a record that was not preloaded and lazy load\nis disabled.","summary":"

Raised when trying to access a record that was not preloaded and lazy load is disabled.

","constructors":[{"html_id":"new(model:String,association:String)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"String"},{"name":"association","external_name":"association","restriction":"String"}],"args_string":"(model : String, association : String)","args_html":"(model : String, association : String)","location":{"filename":"src/avram/errors.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L20"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"String"},{"name":"association","external_name":"association","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, association)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"association:String-instance-method","name":"association","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L18"},"def":{"name":"association","return_type":"String","visibility":"Public","body":"@association"}},{"html_id":"model:String-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L17"},"def":{"name":"model","return_type":"String","visibility":"Public","body":"@model"}}]},{"html_id":"avram/Avram/MarkAsFailed","path":"Avram/MarkAsFailed.html","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed","abstract":false,"locations":[{"filename":"src/avram/mark_as_failed.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/mark_as_failed.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"mark_as_failed:Nil-instance-method","name":"mark_as_failed","abstract":false,"location":{"filename":"src/avram/mark_as_failed.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/mark_as_failed.cr#L2"},"def":{"name":"mark_as_failed","return_type":"Nil","visibility":"Public","body":"self.save_status = Avram::SaveOperation::OperationStatus::SaveFailed"}}]},{"html_id":"avram/Avram/Migrator","path":"Avram/Migrator.html","kind":"module","full_name":"Avram::Migrator","name":"Migrator","abstract":false,"locations":[{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L1"},{"filename":"src/avram/migrator/migrator.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migrator.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"run(&)-class-method","name":"run","abstract":false,"location":{"filename":"src/avram/migrator/migrator.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migrator.cr#L2"},"def":{"name":"run","yields":0,"block_arity":0,"visibility":"Public","body":"begin\n yield\nrescue e\n puts(e.inspect_with_backtrace)\n exit(1)\nend"}}],"types":[{"html_id":"avram/Avram/Migrator/AlterExtensionStatement","path":"Avram/Migrator/AlterExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::AlterExtensionStatement","name":"AlterExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,to:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"args_string":"(name : String, to : String | Nil = nil)","args_html":"(name : String, to : String | Nil = nil)","location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, to)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"String.build do |sql|\n sql << \"ALTER EXTENSION \\\"#{@name}\\\" UPDATE\"\n if @to\n sql << to_version\n end\n sql << \";\"\nend"}},{"html_id":"to_version-instance-method","name":"to_version","abstract":false,"location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_extension_statement.cr#L13"},"def":{"name":"to_version","visibility":"Public","body":"\" TO '#{@to}'\""}}]},{"html_id":"avram/Avram/Migrator/AlterTableStatement","path":"Avram/Migrator/AlterTableStatement.html","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L15"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_change_default_statement(column:Avram::Migrator::Columns::Base)-instance-method","name":"add_change_default_statement","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"args_string":"(column : Avram::Migrator::Columns::Base)","args_html":"(column : Avram::Migrator::Columns::Base)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L86"},"def":{"name":"add_change_default_statement","args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"visibility":"Public","body":"change_default_statements << (column.build_change_default_statement(@table_name))"}},{"html_id":"add_change_type_statement(column:Avram::Migrator::Columns::Base)-instance-method","name":"add_change_type_statement","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"args_string":"(column : Avram::Migrator::Columns::Base)","args_html":"(column : Avram::Migrator::Columns::Base)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L82"},"def":{"name":"add_change_type_statement","args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"visibility":"Public","body":"change_type_statements << (column.build_change_type_statement(@table_name))"}},{"html_id":"add_fill_existing_with_statements(column:Symbol|String,type,value,nilable)-instance-method","name":"add_fill_existing_with_statements","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol | String"},{"name":"type","external_name":"type","restriction":""},{"name":"value","external_name":"value","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""}],"args_string":"(column : Symbol | String, type, value, nilable)","args_html":"(column : Symbol | String, type, value, nilable)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L250"},"def":{"name":"add_fill_existing_with_statements","args":[{"name":"column","external_name":"column","restriction":"Symbol | String"},{"name":"type","external_name":"type","restriction":""},{"name":"value","external_name":"value","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""}],"visibility":"Public","body":"@fill_existing_with_statements << \"UPDATE #{@table_name} SET #{column} = #{value};\"\nif nilable\nelse\n @fill_existing_with_statements << \"ALTER TABLE #{@table_name} ALTER COLUMN #{column} SET NOT NULL;\"\nend\n"}},{"html_id":"alter_statements:Array(String)-instance-method","name":"alter_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":119,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L119"},"def":{"name":"alter_statements","return_type":"Array(String)","visibility":"Public","body":"alterations = renamed_rows.map do |statement|\n \"ALTER TABLE #{@table_name} #{statement};\"\nend\nif (rows + dropped_rows).empty?\nelse\n alterations << String.build do |statement|\n statement << \"ALTER TABLE #{@table_name}\"\n statement << \"\\n\"\n statement << ((rows + dropped_rows).join(\",\\n\"))\n statement << ';'\n end\nend\nalterations\n"}},{"html_id":"build(&)-instance-method","name":"build","doc":"Accepts a block to alter a table using the `add` method. The generated sql\nstatements are aggregated in the `statements` getter.\n\n## Usage\n\n```\nbuilt = Avram::Migrator::AlterTableStatement.new(:users).build do\n add name : String\n add age : Int32\n remove old_field\nend\n\nbuilt.statements\n# => [\n\"ALTER TABLE users\n ADD name text NOT NULL,\n ADD age int NOT NULL,\n DROP old_field\"\n]\n```","summary":"

Accepts a block to alter a table using the add method.

","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":110,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L110"},"def":{"name":"build","yields":0,"block_arity":0,"visibility":"Public","body":"with self yield\nself\n"}},{"html_id":"change_default_statements:Array(String)-instance-method","name":"change_default_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L13"},"def":{"name":"change_default_statements","visibility":"Public","body":"@change_default_statements"}},{"html_id":"change_type_statements:Array(String)-instance-method","name":"change_type_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L12"},"def":{"name":"change_type_statements","visibility":"Public","body":"@change_type_statements"}},{"html_id":"dropped_rows:Array(String)-instance-method","name":"dropped_rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L10"},"def":{"name":"dropped_rows","visibility":"Public","body":"@dropped_rows"}},{"html_id":"fill_existing_with_statements:Array(String)-instance-method","name":"fill_existing_with_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L11"},"def":{"name":"fill_existing_with_statements","visibility":"Public","body":"@fill_existing_with_statements"}},{"html_id":"renamed_rows:Array(String)-instance-method","name":"renamed_rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L9"},"def":{"name":"renamed_rows","visibility":"Public","body":"@renamed_rows"}},{"html_id":"rows:Array(String)-instance-method","name":"rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L8"},"def":{"name":"rows","visibility":"Public","body":"@rows"}},{"html_id":"statements-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":115,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L115"},"def":{"name":"statements","visibility":"Public","body":"(((alter_statements + change_default_statements) + change_type_statements) + index_statements) + fill_existing_with_statements"}}],"macros":[{"html_id":"add(type_declaration,index=false,using=:btree,unique=false,default=nil,fill_existing_with=nil,**type_options)-macro","name":"add","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""}],"args_string":"(type_declaration, index = false, using = :btree, unique = false, default = nil, fill_existing_with = nil, **type_options)","args_html":"(type_declaration, index = false, using = :btree, unique = false, default = nil, fill_existing_with = nil, **type_options)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":181,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L181"},"def":{"name":"add","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% type = type_declaration.type.resolve %}\n\n \n{% nilable = false %}\n\n \n{% array = false %}\n\n \n{% should_fill_existing = (!(fill_existing_with == nil)) && (fill_existing_with != (:nothing)) %}\n\n\n \n{% if type.nilable? %}\n {% type = type.union_types.reject(&.==(Nil)).first %}\n {% nilable = true %}\n {% end %}\n\n \n{% if type < Array %}\n {% type = type.type_vars.first %}\n {% array = true %}\n {% end %}\n\n\n \n{% if ((!nilable) && (default == nil)) && (fill_existing_with == nil) %}\n {% raise(\"\\nYou must provide a default value or use fill_existing_with when adding a required column to an existing table.\\n\\nTry one of these...\\n\\n ▸ add #{type_declaration}, default: \\\"Something\\\"\\n ▸ add #{type_declaration}, fill_existing_with: \\\"Something\\\"\\n ▸ add #{type_declaration}, fill_existing_with: :nothing\") %}\n {% end %}\n\n\n \n{% if (default != nil) && (fill_existing_with != nil) %}\n {% type_declaration.raise(\"\\nCannot use both 'default' and 'fill_existing_with' arguments for add(#{type_declaration}).\\n\\nTry this...\\n\\n ▸ Use `default` to set the default value, and backfill existing columns\\n ▸ Use `fill_existing_with` to backfill existing columns without a default value\") %}\n {% end %}\n\n\n rows << Avram::Migrator::Columns::\n{{ type }}\nColumn(\n \n{% if array %}Array({{ type }}){% else %}{{ type }}{% end %}\n\n ).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable || should_fill_existing }}\n,\n default: \n{{ default }}\n,\n \n{{ type_options.double_splat }}\n\n )\n \n{% if array %}\n .array!\n {% end %}\n\n .build_add_statement_for_alter\n\n \n{% if should_fill_existing %}\n add_fill_existing_with_statements(\n column: {{ type_declaration.var.stringify }},\n type: {{ type }},\n value: Avram::Migrator::Columns::{{ type }}Column.prepare_value_for_database({{ fill_existing_with }}),\n nilable: {{ nilable }}\n )\n {% end %}\n\n\n \n{% if index || unique %}\n add_index :{{ type_declaration.var }}, using: {{ using }}, unique: {{ unique }}\n {% end %}\n\n \n"}},{"html_id":"add_belongs_to(type_declaration,on_delete,references=nil,foreign_key_type=Int64,fill_existing_with=nil,unique=false)-macro","name":"add_belongs_to","doc":"Adds a references column and index given a model class and references option.","summary":"

Adds a references column and index given a model class and references option.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"args_string":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, fill_existing_with = nil, unique = false)","args_html":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, fill_existing_with = nil, unique = false)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L135"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.is_a?(TypeDeclaration) %}{% else %}\n {% raise(\"add_belongs_to expected a type declaration like 'user : User', instead got: '#{type_declaration}'\") %}\n {% end %}\n\n \n{% if (type_declaration.type.stringify =~ (/\\w::\\w/)) && references.nil? %}\n {% raise(\"Namespaced models must include the `references` option with the name of the table.\\n\\nTry this...\\n\\n ▸ add_belongs_to(#{type_declaration}, on_delete: #{on_delete}, references: :the_table_name)\") %}\n {% end %}\n\n \n{% optional = type_declaration.type.is_a?(Union) %}\n\n\n \n{% if optional %}\n {% underscored_class = type_declaration.type.types.first %}\n {% else %}\n {% underscored_class = type_declaration.type %}\n {% end %}\n\n \n{% underscored_class = underscored_class.stringify.underscore.gsub(/::/, \"_\") %}\n\n\n \n{% foreign_key_name = type_declaration.var + \"_id\" %}\n\n \n%table_name\n = \n{{ references }}\n || Wordsmith::Inflector.pluralize(\n{{ underscored_class }}\n)\n\n rows << ::Avram::Migrator::Columns::\n{{ foreign_key_type }}\nColumn(\n{{ foreign_key_type }}\n).new(\n name: \n{{ foreign_key_name.stringify }}\n,\n nilable: \n{{ optional }}\n,\n default: nil\n )\n .set_references(references: \n%table_name\n.to_s, on_delete: \n{{ on_delete }}\n)\n .build_add_statement_for_alter\n\n \n{% if (!(fill_existing_with == nil)) && (fill_existing_with != (:nothing)) %}\n add_fill_existing_with_statements(\n column: {{ foreign_key_name.stringify }},\n type: {{ foreign_key_type }},\n value: Avram::Migrator::Columns::{{ foreign_key_type }}Column.prepare_value_for_database({{ fill_existing_with }}),\n nilable: {{ optional }}\n )\n {% end %}\n\n\n add_index :\n{{ foreign_key_name }}\n, unique: \n{{ unique }}\n\n \n"}},{"html_id":"change_default(type_declaration,default)-macro","name":"change_default","doc":"Change the columns' default value to `default`\n```\nalter table_for(Post) do\n change_default published_at, default: :now\nend\n```","summary":"

Change the columns' default value to default alter table_for(Post) do change_default published_at, default: :now end

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(type_declaration, default)","args_html":"(type_declaration, default)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L68"},"def":{"name":"change_default","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":" \n{% if !type_declaration.is_a?(TypeDeclaration)\n raise(\"Must pass a type declaration to 'change_default'. Example: change_default count : Int32, default: 1\")\nend %}\n\n \n%column\n = ::Avram::Migrator::Columns::\n{{ type_declaration.type }}\nColumn(\n{{ type_declaration.type }}\n).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: false,\n default: \n{{ default }}\n\n )\n add_change_default_statement \n%column\n\n \n"}},{"html_id":"change_type(type_declaration,**type_options)-macro","name":"change_type","doc":"Change the column's type from whatever it is currently to\n`type_declaration.type`. The only exceptions are when changing\nfrom `text` to `citext` with `String` using `case_sensitive`, or changing to\na `Float64` column which requires setting the `precision`, and `scale`.\n```\nalter table_for(User) do\n change_type email : String, case_sensitive: false\nend\n```","summary":"

Change the column's type from whatever it is currently to type_declaration.type.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration, **type_options)","args_html":"(type_declaration, **type_options)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L27"},"def":{"name":"change_type","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% if !type_declaration.is_a?(TypeDeclaration)\n raise(\"Must pass a type declaration to 'change_type'. Example: change_type age : Int32\")\nelse\n if type_options.keys.includes?(\"default\".id)\n raise(\"Cannot change the default value from `change_type`. Use `change_default` instead.\")\n end\nend %}\n\n \n{% type = type_declaration.type.resolve\nnilable = false\nbytes = false\n %}\n\n \n{% if type.nilable?\n type = type.union_types.reject(&.==(Nil)).first\n nilable = true\nend %}\n\n \n{% if type < Slice\n type = \"Bytes\".id\n bytes = true\nend %}\n\n\n \n%column\n = ::Avram::Migrator::Columns::\n{{ type }}\nColumn(\n{{ type }}\n).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable }}\n,\n default: nil,\n \n{{ type_options.double_splat }}\n\n )\n add_change_type_statement \n%column\n\n \n"}},{"html_id":"remove(name)-macro","name":"remove","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name)","args_html":"(name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":294,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L294"},"def":{"name":"remove","args":[{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":" \n{% if name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"remove\", {{ name }})\n {% end %}\n\n dropped_rows << \" DROP #{\n{{ name }}\n}\"\n \n"}},{"html_id":"remove_belongs_to(association_name)-macro","name":"remove_belongs_to","abstract":false,"args":[{"name":"association_name","external_name":"association_name","restriction":""}],"args_string":"(association_name)","args_html":"(association_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":301,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L301"},"def":{"name":"remove_belongs_to","args":[{"name":"association_name","external_name":"association_name","restriction":""}],"visibility":"Public","body":" \n{% if association_name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"remove_belongs_to\", {{ name }})\n {% end %}\n\n remove \n{{ association_name }}\n_id\n \n"}},{"html_id":"rename(old_name,new_name)-macro","name":"rename","abstract":false,"args":[{"name":"old_name","external_name":"old_name","restriction":""},{"name":"new_name","external_name":"new_name","restriction":""}],"args_string":"(old_name, new_name)","args_html":"(old_name, new_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":276,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L276"},"def":{"name":"rename","args":[{"name":"old_name","external_name":"old_name","restriction":""},{"name":"new_name","external_name":"new_name","restriction":""}],"visibility":"Public","body":" \n{% for name in {old_name, new_name} %}\n {% if name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"rename\", {{ name }})\n {% end %}\n {% end %}\n\n renamed_rows << \"RENAME COLUMN #{\n{{ old_name }}\n} TO #{\n{{ new_name }}\n}\"\n \n"}},{"html_id":"rename_belongs_to(old_association_name,new_association_name)-macro","name":"rename_belongs_to","abstract":false,"args":[{"name":"old_association_name","external_name":"old_association_name","restriction":""},{"name":"new_association_name","external_name":"new_association_name","restriction":""}],"args_string":"(old_association_name, new_association_name)","args_html":"(old_association_name, new_association_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":285,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L285"},"def":{"name":"rename_belongs_to","args":[{"name":"old_association_name","external_name":"old_association_name","restriction":""},{"name":"new_association_name","external_name":"new_association_name","restriction":""}],"visibility":"Public","body":" \n{% for association_name in {old_association_name, new_association_name} %}\n {% if association_name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"rename_belongs_to\", {{ name }})\n {% end %}\n {% end %}\n\n rename \n{{ old_association_name }}\n_id, \n{{ new_association_name }}\n_id\n \n"}},{"html_id":"symbol_expected_error(action,name)-macro","name":"symbol_expected_error","abstract":false,"args":[{"name":"action","external_name":"action","restriction":""},{"name":"name","external_name":"name","restriction":""}],"args_string":"(action, name)","args_html":"(action, name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":255,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/alter_table_statement.cr#L255"},"def":{"name":"symbol_expected_error","args":[{"name":"action","external_name":"action","restriction":""},{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":" \n{% if name.is_a?(TypeDeclaration) %}\n {% example = name.var %}\n {% else %}\n {% example = name.id %}\n {% end %}\n\n\n \n{% raise(\"\\n#{action} expected a symbol like :#{example}, instead got: #{name}.\\n\\nin: #{name.filename}:#{name.line_number}:#{name.column_number}\\n\\nTry replacing...\\n\\n ▸ #{name} with :#{example}\") %}\n\n \n"}}]},{"html_id":"avram/Avram/Migrator/BuildReferenceFragment","path":"Avram/Migrator/BuildReferenceFragment.html","kind":"class","full_name":"Avram::Migrator::BuildReferenceFragment","name":"BuildReferenceFragment","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/build_reference_fragment.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(references:String|Symbol|Nil,on_delete:Symbol|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"::String | ::Symbol | ::Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"args_string":"(references : String | Symbol | Nil, on_delete : Symbol | Nil)","args_html":"(references : String | Symbol | Nil, on_delete : Symbol | Nil)","location":{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/build_reference_fragment.cr#L7"},"def":{"name":"new","args":[{"name":"references","external_name":"references","restriction":"::String | ::Symbol | ::Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(references, on_delete)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/build_reference_fragment.cr#L10"},"def":{"name":"build","visibility":"Public","body":"if on_delete == (:do_nothing)\n \" REFERENCES #{references}\"\nelse\n (\" REFERENCES #{references}\" + \" ON DELETE \") + on_delete_sql\nend"}}]},{"html_id":"avram/Avram/Migrator/ChangeNullStatement","path":"Avram/Migrator/ChangeNullStatement.html","kind":"class","full_name":"Avram::Migrator::ChangeNullStatement","name":"ChangeNullStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/change_null_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/change_null_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for changing a columns NOT NULL status.\n\n### Usage\n\n```\nChangeNullStatement.new(:users, :email, make: :optional).build\n# => \"ALTER TABLE users ALTER COLUMN email DROP NOT NULL;\"\n```","summary":"

Builds an SQL statement for changing a columns NOT NULL status.

","constructors":[{"html_id":"new(table:TableName,column:Symbol,required:Bool)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"required","external_name":"required","restriction":"Bool"}],"args_string":"(table : TableName, column : Symbol, required : Bool)","args_html":"(table : TableName, column : Symbol, required : Bool)","location":{"filename":"src/avram/migrator/change_null_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/change_null_statement.cr#L10"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"required","external_name":"required","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, column, required)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/change_null_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/change_null_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"if @required\n change = \"SET\"\nelse\n change = \"DROP\"\nend\nString.build do |index|\n index << \"ALTER TABLE #{@table}\"\n index << \" ALTER COLUMN #{@column}\"\n index << \" #{change} NOT NULL;\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/Columns","path":"Avram/Migrator/Columns.html","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L1"},{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bool_column.cr#L3"},{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bytes_column.cr#L3"},{"filename":"src/avram/migrator/columns/float_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L3"},{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int16_column.cr#L3"},{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int32_column.cr#L3"},{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int64_column.cr#L3"},{"filename":"src/avram/migrator/columns/string_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/string_column.cr#L3"},{"filename":"src/avram/migrator/columns/time_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L3"},{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/uuid_column.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"types":[{"html_id":"avram/Avram/Migrator/Columns/Base","path":"Avram/Migrator/Columns/Base.html","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/BoolColumn","kind":"class","full_name":"Avram::Migrator::Columns::BoolColumn(T)","name":"BoolColumn"},{"html_id":"avram/Avram/Migrator/Columns/BytesColumn","kind":"class","full_name":"Avram::Migrator::Columns::BytesColumn(T)","name":"BytesColumn"},{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn(T)","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Int16Column","kind":"class","full_name":"Avram::Migrator::Columns::Int16Column(T)","name":"Int16Column"},{"html_id":"avram/Avram/Migrator/Columns/Int32Column","kind":"class","full_name":"Avram::Migrator::Columns::Int32Column(T)","name":"Int32Column"},{"html_id":"avram/Avram/Migrator/Columns/Int64Column","kind":"class","full_name":"Avram::Migrator::Columns::Int64Column(T)","name":"Int64Column"},{"html_id":"avram/Avram/Migrator/Columns/JSON/AnyColumn","kind":"class","full_name":"Avram::Migrator::Columns::JSON::AnyColumn(T)","name":"AnyColumn"},{"html_id":"avram/Avram/Migrator/Columns/StringColumn","kind":"class","full_name":"Avram::Migrator::Columns::StringColumn(T)","name":"StringColumn"},{"html_id":"avram/Avram/Migrator/Columns/TimeColumn","kind":"class","full_name":"Avram::Migrator::Columns::TimeColumn(T)","name":"TimeColumn"},{"html_id":"avram/Avram/Migrator/Columns/UUIDColumn","kind":"class","full_name":"Avram::Migrator::Columns::UUIDColumn(T)","name":"UUIDColumn"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"class_methods":[{"html_id":"escape_literal(value)-class-method","name":"escape_literal","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L78"},"def":{"name":"escape_literal","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"PG::EscapeHelper.escape_literal(value)"}},{"html_id":"prepare_value_for_database(value:Array)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Array"}],"args_string":"(value : Array)","args_html":"(value : Array)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L74"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":"Array"}],"visibility":"Public","body":"escape_literal(PQ::Param.encode_array(value))"}},{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L70"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"escape_literal(value.to_s)"}}],"constructors":[{"html_id":"new(name)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name)","args_html":"(name)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"array!-instance-method","name":"array!","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L28"},"def":{"name":"array!","visibility":"Public","body":"@array = true\nself\n"}},{"html_id":"as_array_type:String-instance-method","name":"as_array_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L49"},"def":{"name":"as_array_type","return_type":"String","visibility":"Public","body":"@array ? \"[]\" : \"\""}},{"html_id":"build_add_statement_for_alter:String-instance-method","name":"build_add_statement_for_alter","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L41"},"def":{"name":"build_add_statement_for_alter","return_type":"String","visibility":"Public","body":"\" ADD \" + build_add_statement"}},{"html_id":"build_add_statement_for_create:String-instance-method","name":"build_add_statement_for_create","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L45"},"def":{"name":"build_add_statement_for_create","return_type":"String","visibility":"Public","body":"\" \" + build_add_statement"}},{"html_id":"build_change_default_statement(table_name:TableName):String-instance-method","name":"build_change_default_statement","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName) : String","args_html":"(table_name : TableName) : String","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L37"},"def":{"name":"build_change_default_statement","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"return_type":"String","visibility":"Public","body":"\"ALTER TABLE ONLY #{table_name} ALTER COLUMN #{name} SET#{default_fragment};\""}},{"html_id":"build_change_type_statement(table_name:TableName):String-instance-method","name":"build_change_type_statement","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName) : String","args_html":"(table_name : TableName) : String","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L33"},"def":{"name":"build_change_type_statement","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"return_type":"String","visibility":"Public","body":"\"ALTER TABLE #{table_name} ALTER COLUMN #{name} SET DATA TYPE #{column_type};\""}},{"html_id":"column_type:String-instance-method","name":"column_type","abstract":true,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L64"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":""}},{"html_id":"set_references(references:String,on_delete:Symbol)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"String"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"}],"args_string":"(references : String, on_delete : Symbol)","args_html":"(references : String, on_delete : Symbol)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L16"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"String"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\nself\n"}},{"html_id":"set_references(references:Nil,on_delete:Nil)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"Nil"}],"args_string":"(references : Nil, on_delete : Nil)","args_html":"(references : Nil, on_delete : Nil)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L20"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"Nil"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\nself\n"}},{"html_id":"set_references(references:Nil|String,on_delete:Symbol|Nil)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"::Nil | ::String"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"args_string":"(references : Nil | String, on_delete : Symbol | Nil)","args_html":"(references : Nil | String, on_delete : Symbol | Nil)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/base.cr#L24"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"::Nil | ::String"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\n{% raise(\"When setting a reference you must set the reference table and the 'on_delete' option.\") %}\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/BoolColumn","path":"Avram/Migrator/Columns/BoolColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::BoolColumn(T)","name":"BoolColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bool_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bool_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = BoolColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bool_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"boolean\""}}]},{"html_id":"avram/Avram/Migrator/Columns/BytesColumn","path":"Avram/Migrator/Columns/BytesColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::BytesColumn(T)","name":"BytesColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bytes_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Slice(UInt8)|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Slice(::UInt8) | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Slice(UInt8) | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Slice(UInt8) | T | Nil)","location":{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bytes_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Slice(::UInt8) | T | ::Nil"}],"visibility":"Public","body":"_ = BytesColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/bytes_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bytea\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Float32Column","path":"Avram/Migrator/Columns/Float32Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Float32Column(T)","name":"Float32Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name,nilable,default,precision,scale)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"args_string":"(name, nilable, default, precision, scale)","args_html":"(name, nilable, default, precision, scale)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"visibility":"Public","body":"_ = Float32Column(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name,nilable,default)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(name, nilable, default)","args_html":"(name, nilable, default)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":"_ = Float32Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/Float64Column","path":"Avram/Migrator/Columns/Float64Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Float64Column(T)","name":"Float64Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L29"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name,nilable,default,precision,scale)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"args_string":"(name, nilable, default, precision, scale)","args_html":"(name, nilable, default, precision, scale)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"visibility":"Public","body":"_ = Float64Column(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name,nilable,default)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(name, nilable, default)","args_html":"(name, nilable, default)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":"_ = Float64Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","path":"Avram/Migrator/Columns/FloatColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn(T)","name":"FloatColumn","abstract":true,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/Float32Column","kind":"class","full_name":"Avram::Migrator::Columns::Float32Column(T)","name":"Float32Column"},{"html_id":"avram/Avram/Migrator/Columns/Float64Column","kind":"class","full_name":"Avram::Migrator::Columns::Float64Column(T)","name":"Float64Column"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Float32|T|Nil,precision:Int32|Nil,scale:Int32|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"},{"name":"precision","external_name":"precision","restriction":"::Int32 | ::Nil"},{"name":"scale","external_name":"scale","restriction":"::Int32 | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil, precision : Int32 | Nil, scale : Int32 | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil, precision : Int32 | Nil, scale : Int32 | Nil)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"},{"name":"precision","external_name":"precision","restriction":"::Int32 | ::Nil"},{"name":"scale","external_name":"scale","restriction":"::Int32 | ::Nil"}],"visibility":"Public","body":"_ = FloatColumn(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name:String,nilable:Bool|Nil,default:Float32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"}],"visibility":"Public","body":"_ = FloatColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/float_column.cr#L17"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"if precision && scale\n \"decimal(#{precision},#{scale})\"\nelse\n \"decimal\"\nend"}}]},{"html_id":"avram/Avram/Migrator/Columns/Int16Column","path":"Avram/Migrator/Columns/Int16Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int16Column(T)","name":"Int16Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int16_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Int32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int16_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"visibility":"Public","body":"_ = Int16Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int16_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"smallint\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Int32Column","path":"Avram/Migrator/Columns/Int32Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int32Column(T)","name":"Int32Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int32_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int32_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = Int32Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int32_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"int4\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Int64Column","path":"Avram/Migrator/Columns/Int64Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int64Column(T)","name":"Int64Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int64_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Int32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int64_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"visibility":"Public","body":"_ = Int64Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/int64_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bigint\""}}]},{"html_id":"avram/Avram/Migrator/Columns/JSON","path":"Avram/Migrator/Columns/JSON.html","kind":"module","full_name":"Avram::Migrator::Columns::JSON","name":"JSON","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/json_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"types":[{"html_id":"avram/Avram/Migrator/Columns/JSON/AnyColumn","path":"Avram/Migrator/Columns/JSON/AnyColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::JSON::AnyColumn(T)","name":"AnyColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/json_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/JSON","kind":"module","full_name":"Avram::Migrator::Columns::JSON","name":"JSON"},"class_methods":[{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L14"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"escape_literal(value.to_json)"}}],"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:::JSON::Any|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::JSON::Any | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : ::JSON::Any | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : ::JSON::Any | Nil)","location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::JSON::Any | ::Nil"}],"visibility":"Public","body":"_ = AnyColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/json_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"jsonb\""}}]}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","path":"Avram/Migrator/Columns/PrimaryKeys.html","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/base.cr#L1"},{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"types":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","path":"Avram/Migrator/Columns/PrimaryKeys/Base.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/base.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int16PrimaryKey","name":"Int16PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int32PrimaryKey","name":"Int32PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int64PrimaryKey","name":"Int64PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::UUIDPrimaryKey","name":"UUIDPrimaryKey"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"instance_methods":[{"html_id":"build:String-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/base.cr#L8"},"def":{"name":"build","return_type":"String","visibility":"Public","body":"\" #{name} #{column_type} PRIMARY KEY\""}},{"html_id":"column_type-instance-method","name":"column_type","abstract":true,"location":{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/base.cr#L6"},"def":{"name":"column_type","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int16PrimaryKey","name":"Int16PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"smallserial\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int32PrimaryKey","name":"Int32PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"serial4\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int64PrimaryKey","name":"Int64PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bigserial\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::UUIDPrimaryKey","name":"UUIDPrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build:String-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L12"},"def":{"name":"build","return_type":"String","visibility":"Public","body":"\" #{name} #{column_type} PRIMARY KEY DEFAULT gen_random_uuid()\""}},{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"uuid\""}}]}]},{"html_id":"avram/Avram/Migrator/Columns/StringColumn","path":"Avram/Migrator/Columns/StringColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::StringColumn(T)","name":"StringColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/string_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/string_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil,case_sensitive:Bool=true)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"},{"name":"case_sensitive","default_value":"true","external_name":"case_sensitive","restriction":"::Bool"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil, case_sensitive : Bool = true)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil, case_sensitive : Bool = true)","location":{"filename":"src/avram/migrator/columns/string_column.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/string_column.cr#L8"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"},{"name":"case_sensitive","default_value":"true","external_name":"case_sensitive","restriction":"::Bool"}],"visibility":"Public","body":"_ = StringColumn(T).allocate\n_.initialize(name, nilable, default, case_sensitive)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","doc":"If `case_sensitive?` is false then the column type is set to `citext`\nwhich requires the `citext` extension to be enabled\notherwise the type is `text`","summary":"

If case_sensitive? is false then the column type is set to citext which requires the citext extension to be enabled otherwise the type is text

","abstract":false,"location":{"filename":"src/avram/migrator/columns/string_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/string_column.cr#L14"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"case_sensitive? ? \"text\" : \"citext\""}}]},{"html_id":"avram/Avram/Migrator/Columns/TimeColumn","path":"Avram/Migrator/Columns/TimeColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::TimeColumn(T)","name":"TimeColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/time_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"class_methods":[{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L14"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"if value == (:now)\n \"NOW()\"\nelse\n if value.is_a?(Time)\n escape_literal(value.to_utc.to_s)\n else\n raise(\"Unrecognized value :#{value} for a timestamptz. Please use a Time object or :now for current timestamp.\")\n end\nend"}}],"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Symbol|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Symbol | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Symbol | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Symbol | T | Nil)","location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Symbol | T | ::Nil"}],"visibility":"Public","body":"_ = TimeColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/time_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"timestamptz\""}}]},{"html_id":"avram/Avram/Migrator/Columns/UUIDColumn","path":"Avram/Migrator/Columns/UUIDColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::UUIDColumn(T)","name":"UUIDColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/uuid_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/uuid_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = UUIDColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/columns/uuid_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"uuid\""}}]}]},{"html_id":"avram/Avram/Migrator/CreateExtensionStatement","path":"Avram/Migrator/CreateExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::CreateExtensionStatement","name":"CreateExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"CREATE EXTENSION IF NOT EXISTS \\\"#{@name}\\\";\""}}]},{"html_id":"avram/Avram/Migrator/CreateForeignKeyStatement","path":"Avram/Migrator/CreateForeignKeyStatement.html","kind":"class","full_name":"Avram::Migrator::CreateForeignKeyStatement","name":"CreateForeignKeyStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_foreign_key_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Generates an ALTER TABLE statement for adding a foreign key constraint on a table.\n\n### Usage\n\n```\nCreateForeignKeyStatement.new(from: :comments, to: :users, column: :author_id, primary_key: :uid, on_delete: :cascade).build\n# => \"ALTER TABLE comments ADD CONSTRAINT comments_author_id_fk FOREIGN KEY (author_id) REFERENCES users (uid) ON DELETE CASCADE;\"\n```","summary":"

Generates an ALTER TABLE statement for adding a foreign key constraint on a table.

","constructors":[{"html_id":"new(from:TableName,to:TableName,on_delete:Symbol,column:Symbol|Nil=nil,primary_key:Symbol=:id)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":"::Symbol"}],"args_string":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil = nil, primary_key : Symbol = :id)","args_html":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil = nil, primary_key : Symbol = :id)","location":{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_foreign_key_statement.cr#L10"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":"::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, to, on_delete, column, primary_key)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_foreign_key_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"foreign_key = @column || ((Wordsmith::Inflector.singularize(@to.to_s)) + \"_id\")\nString.build do |index|\n index << \"ALTER TABLE\"\n index << \" #{@from}\"\n index << \" ADD CONSTRAINT #{@from}_#{foreign_key}_fk\"\n index << \" FOREIGN KEY (#{foreign_key})\"\n index << (BuildReferenceFragment.new(\"#{@to} (#{@primary_key})\", @on_delete)).build\n index << \";\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/CreateFunctionStatement","path":"Avram/Migrator/CreateFunctionStatement.html","kind":"class","full_name":"Avram::Migrator::CreateFunctionStatement","name":"CreateFunctionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_function_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_function_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,body:String,returns:String=\"trigger\")-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"args_string":"(name : String, body : String, returns : String = \"trigger\")","args_html":"(name : String, body : String, returns : String = "trigger")","location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_function_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, body, returns)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_function_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"\"CREATE OR REPLACE FUNCTION #{function_name}\\n RETURNS #{@returns} AS $$\\nBEGIN\\n #{@body}\\nEND\\n$$ LANGUAGE 'plpgsql';\""}},{"html_id":"function_name-instance-method","name":"function_name","abstract":false,"location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_function_statement.cr#L5"},"def":{"name":"function_name","visibility":"Public","body":"if @name.ends_with?(')')\n @name\nelse\n \"#{@name}()\"\nend"}}]},{"html_id":"avram/Avram/Migrator/CreateIndexStatement","path":"Avram/Migrator/CreateIndexStatement.html","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_index_statement.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L28"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for creating an index using table name, column\nname(s), index type and unique flag.\n\n### Usage\n\nFor a single column:\n\n```\nCreateIndexStatement.new(:users, columns: :email, using: :btree, unique: true).build\n# => \"CREATE UNIQUE INDEX users_email_index ON users USING btree (email);\"\n```\n\nFor multiple columns:\n\n```\nCreateIndexStatement.new(:users, columns: [:email, :username], using: :btree, unique: true).build\n# => \"CREATE UNIQUE INDEX users_email_username_index ON users USING btree (email, username);\"\n```\n\nWith custom name:\n\n```\nCreateIndexStatement.new(:users, columns: [:email, :username], name: :custom_index_name).build\n# => \"CREATE INDEX custom_index_name ON users USING btree (email, username);\"\n```","summary":"

Builds an SQL statement for creating an index using table name, column name(s), index type and unique flag.

","constructors":[{"html_id":"new(table:TableName,columns:Columns,using:Symbol=:btree,unique:Bool=false,name:String|Nil|Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":"::Bool"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table : TableName, columns : Columns, using : Symbol = :btree, unique : Bool = false, name : String | Nil | Symbol | Nil = nil)","args_html":"(table : TableName, columns : Columns, using : Symbol = :btree, unique : Bool = false, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L39"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":"::Bool"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, columns, using, unique, name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L44"},"def":{"name":"build","visibility":"Public","body":"index_name = @name\nindex_name || (index_name = \"#{@table}_#{columns.join(\"_\")}_index\")\nString.build do |index|\n index << \"CREATE\"\n if @unique\n index << \" UNIQUE\"\n end\n index << \" INDEX #{index_name}\"\n index << \" ON #{@table}\"\n index << \" USING #{@using.to_s.downcase}\"\n index << \" (#{columns.join(\", \")});\"\nend\n"}}],"types":[{"html_id":"avram/Avram/Migrator/CreateIndexStatement/IndexTypes","path":"Avram/Migrator/CreateIndexStatement/IndexTypes.html","kind":"enum","full_name":"Avram::Migrator::CreateIndexStatement::IndexTypes","name":"IndexTypes","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_index_statement.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L31"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Btree","name":"Btree","value":"0"},{"id":"Hash","name":"Hash","value":"1"},{"id":"Gist","name":"Gist","value":"2"},{"id":"Gin","name":"Gin","value":"3"},{"id":"Brin","name":"Brin","value":"4"}],"namespace":{"html_id":"avram/Avram/Migrator/CreateIndexStatement","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement"},"instance_methods":[{"html_id":"brin?-instance-method","name":"brin?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L36"},"def":{"name":"brin?","visibility":"Public","body":"self == Brin"}},{"html_id":"btree?-instance-method","name":"btree?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L32"},"def":{"name":"btree?","visibility":"Public","body":"self == Btree"}},{"html_id":"gin?-instance-method","name":"gin?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L35"},"def":{"name":"gin?","visibility":"Public","body":"self == Gin"}},{"html_id":"gist?-instance-method","name":"gist?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L34"},"def":{"name":"gist?","visibility":"Public","body":"self == Gist"}},{"html_id":"hash?-instance-method","name":"hash?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_index_statement.cr#L33"},"def":{"name":"hash?","visibility":"Public","body":"self == Hash"}}]}]},{"html_id":"avram/Avram/Migrator/CreateTableStatement","path":"Avram/Migrator/CreateTableStatement.html","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_table_statement.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L11"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build(&):CreateTableStatement-instance-method","name":"build","doc":"Accepts a block to build a table and indices using `add` and `add_index` methods.\n\nThe generated sql statements are aggregated in the `statements` method.\n\n## Usage\n\n```\nbuilt = Avram::Migrator::CreateTableStatement.new(:users).build do\n add_belongs_to Account, on_delete: :cascade\n add :email : String, unique: true\nend\n\nbuilt.statements\n# => [\n \"CREATE TABLE users (\n id serial PRIMARY KEY,\n created_at timestamptz NOT NULL,\n updated_at timestamptz NOT NULL,\n account_id bigint NOT NULL REFERENCES accounts (id) ON DELETE CASCADE,\n email text NOT NULL);\",\n \"CREATE UNIQUE INDEX users_email_index ON users USING btree (email);\"\n]\n```\n\nAn optional second argument can toggle between the usage of a numeric or uuid\nbased id column.\n\n```\nbuilt = Avram::Migrator::CreateTableStatement.new(:users, PrimaryKeyType::UUID).build do\n add :email : String, unique: true\nend\n```","summary":"

Accepts a block to build a table and indices using add and add_index methods.

","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L46"},"def":{"name":"build","yields":0,"block_arity":0,"return_type":"CreateTableStatement","visibility":"Public","body":"with self yield\nself\n"}},{"html_id":"statements-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L51"},"def":{"name":"statements","visibility":"Public","body":"[table_statement] + index_statements"}}],"macros":[{"html_id":"add(type_declaration,default=nil,index=false,unique=false,using=:btree,**type_options)-macro","name":"add","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""}],"args_string":"(type_declaration, default = nil, index = false, unique = false, using = :btree, **type_options)","args_html":"(type_declaration, default = nil, index = false, unique = false, using = :btree, **type_options)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":89,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L89"},"def":{"name":"add","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% type = type_declaration.type.resolve\nnilable = false\narray = false\nbytes = false\n %}\n\n \n{% if type.nilable?\n type = type.union_types.reject(&.==(Nil)).first\n nilable = true\nend %}\n\n \n{% if type < Array\n type = type.type_vars.first\n array = true\nend %}\n\n \n{% if type < Slice\n type = \"Bytes\".id\n bytes = true\nend %}\n\n\n\n rows << Avram::Migrator::Columns::\n{{ type }}\nColumn(\n \n{% if array %}Array({{ type }}){% else %}{{ type }}{% end %}\n\n ).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable }}\n,\n default: \n{{ default }}\n,\n \n{{ type_options.double_splat }}\n\n )\n \n{% if array %}\n .array!\n {% end %}\n\n .build_add_statement_for_create\n\n \n{% if index || unique %}\n add_index :{{ type_declaration.var }}, using: {{ using }}, unique: {{ unique }}\n {% end %}\n\n \n"}},{"html_id":"add_belongs_to(type_declaration,on_delete,references=nil,foreign_key_type=Int64,unique=false)-macro","name":"add_belongs_to","doc":"Adds a references column and index given a model class and references option.","summary":"

Adds a references column and index given a model class and references option.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"args_string":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, unique = false)","args_html":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, unique = false)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L135"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.is_a?(TypeDeclaration) %}{% else %}\n {% raise(\"add_belongs_to expected a type declaration like 'user : User', instead got: '#{type_declaration}'\") %}\n {% end %}\n\n \n{% if (type_declaration.type.stringify =~ (/\\w::\\w/)) && references.nil? %}\n {% raise(\"Namespaced models must include the `references` option with the name of the table.\\n\\nTry this...\\n\\n ▸ add_belongs_to(#{type_declaration}, on_delete: #{on_delete}, references: :the_table_name)\") %}\n {% end %}\n\n \n{% optional = type_declaration.type.is_a?(Union) %}\n\n\n \n{% if optional %}\n {% underscored_class = type_declaration.type.types.first %}\n {% else %}\n {% underscored_class = type_declaration.type %}\n {% end %}\n\n \n{% underscored_class = underscored_class.stringify.underscore.gsub(/::/, \"_\") %}\n\n\n \n{% foreign_key_name = type_declaration.var + \"_id\" %}\n\n \n%table_name\n = \n{{ references }}\n || Wordsmith::Inflector.pluralize(\n{{ underscored_class }}\n)\n\n rows << Avram::Migrator::Columns::\n{{ foreign_key_type }}\nColumn(\n{{ foreign_key_type }}\n).new(\n name: \n{{ foreign_key_name.stringify }}\n,\n nilable: \n{{ optional }}\n,\n default: nil,\n )\n .set_references(references: \n%table_name\n.to_s, on_delete: \n{{ on_delete }}\n)\n .build_add_statement_for_create\n\n add_index :\n{{ foreign_key_name }}\n, unique: \n{{ unique }}\n\n \n"}},{"html_id":"add_timestamps-macro","name":"add_timestamps","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":84,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L84"},"def":{"name":"add_timestamps","visibility":"Public","body":" add created_at : Time, default: :now\n add updated_at : Time, default: :now\n "}},{"html_id":"belongs_to(type_declaration,*args,**named_args)-macro","name":"belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type_declaration, *args, **named_args)","args_html":"(type_declaration, *args, **named_args)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":172,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L172"},"def":{"name":"belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% raise(\"Unexpected call to `belongs_to` in a migration.\\nFound in #{type_declaration.filename.id}:#{type_declaration.line_number}:#{type_declaration.column_number}.\\n\\nDid you mean to use 'add_belongs_to'?\\n\\n'add_belongs_to #{type_declaration}, ...'\") %}\n\n \n"}},{"html_id":"composite_primary_key(*columns)-macro","name":"composite_primary_key","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""}],"args_string":"(*columns)","args_html":"(*columns)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L77"},"def":{"name":"composite_primary_key","args":[{"name":"columns","external_name":"columns","restriction":""}],"splat_index":0,"visibility":"Public","body":" \n{% if columns.size < 2 %}\n {% raise(\"composite_primary_key expected at least two primary keys, instead got #{columns.size}\") %}\n {% end %}\n\n constraints << \" PRIMARY KEY (\n{{ (columns.join(\", \")).id }}\n)\"\n \n"}},{"html_id":"primary_key(type_declaration)-macro","name":"primary_key","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_table_statement.cr#L71"},"def":{"name":"primary_key","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" rows << Avram::Migrator::Columns::PrimaryKeys::\n{{ type_declaration.type }}\nPrimaryKey\n .new(name: \n{{ type_declaration.var.stringify }}\n)\n .build\n \n"}}]},{"html_id":"avram/Avram/Migrator/CreateTriggerStatement","path":"Avram/Migrator/CreateTriggerStatement.html","kind":"class","full_name":"Avram::Migrator::CreateTriggerStatement","name":"CreateTriggerStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_trigger_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName,trigger_name:String,function:String,callbacktrigger_when:Symbol=:before,ontrigger_operation:Array(Symbol)=[:update])-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"},{"name":"function","external_name":"function","restriction":"String"},{"name":"trigger_when","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"trigger_operation","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"args_string":"(table_name : TableName, trigger_name : String, function : String, callback trigger_when : Symbol = :before, on trigger_operation : Array(Symbol) = [:update])","args_html":"(table_name : TableName, trigger_name : String, function : String, callback trigger_when : Symbol = :before, on trigger_operation : Array(Symbol) = [:update])","location":{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_trigger_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"},{"name":"function","external_name":"function","restriction":"String"},{"name":"trigger_when","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"trigger_operation","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, trigger_name, function, trigger_when, trigger_operation)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/create_trigger_statement.cr#L11"},"def":{"name":"build","visibility":"Public","body":"\"CREATE TRIGGER #{@trigger_name}\\n#{@trigger_when.to_s.upcase} #{operation_statement} ON #{@table_name}\\nFOR EACH ROW\\nEXECUTE PROCEDURE #{@function}();\""}}]},{"html_id":"avram/Avram/Migrator/DropExtensionStatement","path":"Avram/Migrator/DropExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::DropExtensionStatement","name":"DropExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP EXTENSION IF EXISTS \\\"#{@name}\\\" CASCADE;\""}}]},{"html_id":"avram/Avram/Migrator/DropForeignKeyStatement","path":"Avram/Migrator/DropForeignKeyStatement.html","kind":"class","full_name":"Avram::Migrator::DropForeignKeyStatement","name":"DropForeignKeyStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_foreign_key_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Generates an ALTER TABLE statement for dropping a foreign key constraint on a table.\n\n### Usage\n\n```\nDropForeignKeyStatement.new(from: :comments, references: :users, column: :author_id).build\n# => \"ALTER TABLE comments DROP CONSTRAINT comments_author_id_fk;\"\n```","summary":"

Generates an ALTER TABLE statement for dropping a foreign key constraint on a table.

","constructors":[{"html_id":"new(from:TableName,references:TableName,column:Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"}],"args_string":"(from : TableName, references : TableName, column : Symbol | Nil = nil)","args_html":"(from : TableName, references : TableName, column : Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_foreign_key_statement.cr#L10"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, references, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_foreign_key_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"foreign_key = @column || ((Wordsmith::Inflector.singularize(@references.to_s)) + \"_id\")\nString.build do |index|\n index << \"ALTER TABLE\"\n index << \" #{@from}\"\n index << \" DROP CONSTRAINT #{@from}_#{foreign_key}_fk\"\n index << \";\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/DropFunctionStatement","path":"Avram/Migrator/DropFunctionStatement.html","kind":"class","full_name":"Avram::Migrator::DropFunctionStatement","name":"DropFunctionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_function_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_function_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_function_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP FUNCTION IF EXISTS \\\"#{@name}\\\" CASCADE;\""}}]},{"html_id":"avram/Avram/Migrator/DropIndexStatement","path":"Avram/Migrator/DropIndexStatement.html","kind":"class","full_name":"Avram::Migrator::DropIndexStatement","name":"DropIndexStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_index_statement.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ALLOWED_ON_DELETE_STRATEGIES","name":"ALLOWED_ON_DELETE_STRATEGIES","value":"[:cascade, :restrict] of ::Symbol"}],"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for dropping an index by inferring it's name using table name and column(s).\n\n### Usage\n\nFor a single column index:\n\n```\nDropIndexStatement.new(:users, :email, if_exists: true, on_delete: :cascade).build\n# => \"DROP INDEX IF EXISTS users_email_index CASCADE;\"\n```\n\nFor multiple column index:\n\n```\nDropIndexStatement.new(:users, [:email, :username] if_exists: true, on_delete: :cascade).build\n# => \"DROP INDEX IF EXISTS users_email_username_index CASCADE;\"\n```\n\nFor index by name:\n\n```\nDropIndexStatement.new(:users, name: :custom_index_name).build\n# => \"DROP INDEX custom_index_name;\"\n```","summary":"

Builds an SQL statement for dropping an index by inferring it's name using table name and column(s).

","constructors":[{"html_id":"new(table:TableName,columns:Columns|Nil=nil,if_exists:Bool=false,on_delete:Symbol=:do_nothing,name:String|Nil|Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":"::Bool"},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":"::Symbol"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table : TableName, columns : Columns | Nil = nil, if_exists : Bool = false, on_delete : Symbol = :do_nothing, name : String | Nil | Symbol | Nil = nil)","args_html":"(table : TableName, columns : Columns | Nil = nil, if_exists : Bool = false, on_delete : Symbol = :do_nothing, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_index_statement.cr#L32"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":"::Bool"},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":"::Symbol"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, columns, if_exists, on_delete, name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_index_statement.cr#L35"},"def":{"name":"build","visibility":"Public","body":"String.build do |index|\n index << \"DROP INDEX\"\n if @if_exists\n index << \" IF EXISTS\"\n end\n index << \" #{index_name}\"\n index << (on_delete_strategy(@on_delete))\nend"}},{"html_id":"on_delete_strategy(on_delete=:do_nothing)-instance-method","name":"on_delete_strategy","abstract":false,"args":[{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""}],"args_string":"(on_delete = :do_nothing)","args_html":"(on_delete = :do_nothing)","location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_index_statement.cr#L44"},"def":{"name":"on_delete_strategy","args":[{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""}],"visibility":"Public","body":"if on_delete == (:do_nothing)\n \";\"\nelse\n if ALLOWED_ON_DELETE_STRATEGIES.includes?(on_delete)\n \" #{on_delete};\".upcase\n else\n raise(\"on_delete: :#{on_delete} is not supported. Please use :do_nothing, :cascade or :restrict\")\n end\nend"}}]},{"html_id":"avram/Avram/Migrator/DropTableStatement","path":"Avram/Migrator/DropTableStatement.html","kind":"class","full_name":"Avram::Migrator::DropTableStatement","name":"DropTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_table_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_table_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_table_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP TABLE #{@table_name}\""}}]},{"html_id":"avram/Avram/Migrator/DropTriggerStatement","path":"Avram/Migrator/DropTriggerStatement.html","kind":"class","full_name":"Avram::Migrator::DropTriggerStatement","name":"DropTriggerStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_trigger_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName,trigger_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"}],"args_string":"(table_name : TableName, trigger_name : String)","args_html":"(table_name : TableName, trigger_name : String)","location":{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_trigger_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, trigger_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/drop_trigger_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP TRIGGER IF EXISTS #{@trigger_name} ON #{@table_name};\""}}]},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","path":"Avram/Migrator/IndexStatementHelpers.html","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers","abstract":false,"locations":[{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/index_statement_helpers.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/AlterTableStatement","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement"},{"html_id":"avram/Avram/Migrator/CreateIndexStatement","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement"},{"html_id":"avram/Avram/Migrator/CreateTableStatement","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement"},{"html_id":"avram/Avram/Migrator/DropIndexStatement","kind":"class","full_name":"Avram::Migrator::DropIndexStatement","name":"DropIndexStatement"},{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"instance_methods":[{"html_id":"add_index(column:Symbol,unique=false,using:Symbol=:btree)-instance-method","name":"add_index","doc":"Generates raw sql for adding an index to a table column. Accepts 'unique' and 'using' options.","summary":"

Generates raw sql for adding an index to a table column.

","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"}],"args_string":"(column : Symbol, unique = false, using : Symbol = :btree)","args_html":"(column : Symbol, unique = false, using : Symbol = :btree)","location":{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/index_statement_helpers.cr#L7"},"def":{"name":"add_index","args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"}],"visibility":"Public","body":"index = (CreateIndexStatement.new(@table_name, column, using, unique)).build\nif index_added?(index, column)\nelse\n index_statements << index\nend\n"}},{"html_id":"index_added?(index:String,column:Symbol)-instance-method","name":"index_added?","doc":"Returns false unless matching index exists. Ignores UNIQUE","summary":"

Returns false unless matching index exists.

","abstract":false,"args":[{"name":"index","external_name":"index","restriction":"String"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(index : String, column : Symbol)","args_html":"(index : String, column : Symbol)","location":{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/index_statement_helpers.cr#L13"},"def":{"name":"index_added?","args":[{"name":"index","external_name":"index","restriction":"String"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"if (index_statements.includes?(index)) || (index_statements.includes?(index.gsub(\" UNIQUE\", \"\")))\nelse\n return false\nend\nraise(\"index on #{@table_name}.#{column} already exists\")\n"}}],"types":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers/Columns","path":"Avram/Migrator/IndexStatementHelpers/Columns.html","kind":"alias","full_name":"Avram::Migrator::IndexStatementHelpers::Columns","name":"Columns","abstract":false,"locations":[{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/index_statement_helpers.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Array(Symbol) | Symbol)","aliased_html":"Array(Symbol) | Symbol","const":false,"namespace":{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}}]},{"html_id":"avram/Avram/Migrator/Migration","path":"Avram/Migrator/Migration.html","kind":"module","full_name":"Avram::Migrator::Migration","name":"Migration","abstract":false,"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"types":[{"html_id":"avram/Avram/Migrator/Migration/V1","path":"Avram/Migrator/Migration/V1.html","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"},{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator/Migration","kind":"module","full_name":"Avram::Migrator::Migration","name":"Migration"},"instance_methods":[{"html_id":"down(quiet=false)-instance-method","name":"down","doc":"Same as #up except calls rollback method in migration.","summary":"

Same as #up except calls rollback method in migration.

","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"args_string":"(quiet = false)","args_html":"(quiet = false)","location":{"filename":"src/avram/migrator/migration.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L48"},"def":{"name":"down","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"visibility":"Public","body":"suppress_logging do\n if pending?\n puts(\"Already rolled back #{self.class.name.colorize(:cyan)}\")\n else\n reset_prepared_statements\n rollback\n execute_in_transaction(@prepared_statements) do |tx|\n untrack_migration(tx)\n if quiet\n else\n puts(\"Rolled back #{self.class.name.colorize(:green)}\")\n end\n end\n end\nend"}},{"html_id":"migrate-instance-method","name":"migrate","abstract":true,"location":{"filename":"src/avram/migrator/migration.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L21"},"def":{"name":"migrate","visibility":"Public","body":""}},{"html_id":"migrated?-instance-method","name":"migrated?","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L69"},"def":{"name":"migrated?","visibility":"Public","body":"suppress_logging do\n Avram.settings.database_to_migrate.query_one?(\"SELECT id FROM migrations WHERE version = $1\", version, as: MigrationId)\nend"}},{"html_id":"pending?-instance-method","name":"pending?","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L65"},"def":{"name":"pending?","visibility":"Public","body":"!migrated?"}},{"html_id":"prepared_statements:Array(String)-instance-method","name":"prepared_statements","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L24"},"def":{"name":"prepared_statements","visibility":"Public","body":"@prepared_statements"}},{"html_id":"reset_prepared_statements-instance-method","name":"reset_prepared_statements","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":110,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L110"},"def":{"name":"reset_prepared_statements","visibility":"Public","body":"@prepared_statements = [] of String"}},{"html_id":"up(quiet=false)-instance-method","name":"up","doc":"Unless already migrated, calls migrate which in turn calls statement\nhelpers to generate and collect SQL statements in the\n@prepared_statements array. Each statement is then executed in a\ntransaction and tracked upon completion.","summary":"

Unless already migrated, calls migrate which in turn calls statement helpers to generate and collect SQL statements in the @prepared_statements array.

","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"args_string":"(quiet = false)","args_html":"(quiet = false)","location":{"filename":"src/avram/migrator/migration.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L30"},"def":{"name":"up","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"visibility":"Public","body":"suppress_logging do\n if migrated?\n puts(\"Already migrated #{self.class.name.colorize(:cyan)}\")\n else\n reset_prepared_statements\n migrate\n execute_in_transaction(@prepared_statements) do |tx|\n track_migration(tx)\n if quiet\n else\n puts(\"Migrated #{self.class.name.colorize(:green)}\")\n end\n end\n end\nend"}},{"html_id":"version:Int64-instance-method","name":"version","abstract":true,"location":{"filename":"src/avram/migrator/migration.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L22"},"def":{"name":"version","return_type":"Int64","visibility":"Public","body":""}}],"types":[{"html_id":"avram/Avram/Migrator/Migration/V1/MigrationId","path":"Avram/Migrator/Migration/V1/MigrationId.html","kind":"alias","full_name":"Avram::Migrator::Migration::V1::MigrationId","name":"MigrationId","abstract":false,"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/migration.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Int32 | Int64)","aliased_html":"Int32 | Int64","const":false,"namespace":{"html_id":"avram/Avram/Migrator/Migration/V1","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1"}}]}]},{"html_id":"avram/Avram/Migrator/MigrationGenerator","path":"Avram/Migrator/MigrationGenerator.html","kind":"class","full_name":"Avram::Migrator::MigrationGenerator","name":"MigrationGenerator","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,migrate_contents:String,rollback_contents:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"migrate_contents","external_name":"migrate_contents","restriction":"String"},{"name":"rollback_contents","external_name":"rollback_contents","restriction":"String"}],"args_string":"(name : String, migrate_contents : String, rollback_contents : String)","args_html":"(name : String, migrate_contents : String, rollback_contents : String)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L17"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"migrate_contents","external_name":"migrate_contents","restriction":"String"},{"name":"rollback_contents","external_name":"rollback_contents","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, migrate_contents, rollback_contents)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"formatted_migrate_contents:String|Nil-instance-method","name":"formatted_migrate_contents","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L32"},"def":{"name":"formatted_migrate_contents","return_type":"String | ::Nil","visibility":"Public","body":"@migrate_contents.try do |contents|\n pad_contents(contents)\nend"}},{"html_id":"formatted_rollback_contents:String|Nil-instance-method","name":"formatted_rollback_contents","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L38"},"def":{"name":"formatted_rollback_contents","return_type":"String | ::Nil","visibility":"Public","body":"@rollback_contents.try do |contents|\n pad_contents(contents)\nend"}},{"html_id":"generate(_version:Nil|String=@_version)-instance-method","name":"generate","abstract":false,"args":[{"name":"_version","default_value":"@_version","external_name":"_version","restriction":"::Nil | ::String"}],"args_string":"(_version : Nil | String = @_version)","args_html":"(_version : Nil | String = @_version)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L20"},"def":{"name":"generate","args":[{"name":"_version","default_value":"@_version","external_name":"_version","restriction":"::Nil | ::String"}],"visibility":"Public","body":"@_version = _version\nensure_camelcase_name\nmake_migrations_folder_if_missing\nensure_unique\nFile.write(file_path, contents)\nio.puts(\"Created #{migration_class_name.colorize(:green)} in .#{relative_file_path.colorize(:green)}\")\n"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L7"},"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"to_s(__io__:IO):Nil-instance-method","name":"to_s","doc":"Appends a short String representation of this object\nwhich includes its class name and its object address.\n\n```\nclass Person\n def initialize(@name : String, @age : Int32)\n end\nend\n\nPerson.new(\"John\", 32).to_s # => #\n```","summary":"

Appends a short String representation of this object which includes its class name and its object address.

","abstract":false,"args":[{"name":"__io__","external_name":"__io__","restriction":"IO"}],"args_string":"(__io__ : IO) : Nil","args_html":"(__io__ : IO) : Nil","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration_generator.cr#L12"},"def":{"name":"to_s","args":[{"name":"__io__","external_name":"__io__","restriction":"IO"}],"return_type":"Nil","visibility":"Public","body":"ECR.embed(\"/home/runner/work/avram/avram/src/avram/tasks/gen/migration.ecr\", \"__io__\")"}}]},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","path":"Avram/Migrator/MissingOnDeleteWithBelongsToError.html","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError","abstract":false,"locations":[{"filename":"src/avram/migrator/missing_on_delete_with_belongs_to_error.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/missing_on_delete_with_belongs_to_error.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/AlterTableStatement","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement"},{"html_id":"avram/Avram/Migrator/CreateTableStatement","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"macros":[{"html_id":"add_belongs_to(type_declaration,references=nil)-macro","name":"add_belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""}],"args_string":"(type_declaration, references = nil)","args_html":"(type_declaration, references = nil)","location":{"filename":"src/avram/migrator/missing_on_delete_with_belongs_to_error.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/missing_on_delete_with_belongs_to_error.cr#L2"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""}],"visibility":"Public","body":" \n{% raise(\"Must use 'on_delete' with 'add_belongs_to'\\n\\nTry this...\\n\\n ▸ add_belongs_to #{type_declaration}, on_delete: :cascade\\n\\nYou can also use :restrict, :nullify, or :do_nothing\\n\\nRead more at: https://luckyframework.org/guides/database/migrations#associations\\n\\n\") %}\n\n \n"}}]},{"html_id":"avram/Avram/Migrator/Runner","path":"Avram/Migrator/Runner.html","kind":"class","full_name":"Avram::Migrator::Runner","name":"Runner","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/runner.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"MIGRATIONS_TABLE_NAME","name":"MIGRATIONS_TABLE_NAME","value":"\"migrations\""}],"extended_modules":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"class_methods":[{"html_id":"cmd_args-class-method","name":"cmd_args","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L40"},"def":{"name":"cmd_args","visibility":"Public","body":"String.build do |args|\n if self.db_user\n args << \"-U #{self.db_user}\"\n end\n if self.db_host\n args << \" -h #{self.db_host}\"\n end\n if self.db_port\n args << \" -p #{self.db_port}\"\n end\n args << \" #{self.db_name}\"\nend"}},{"html_id":"create_db(quiet?:Bool=false)-class-method","name":"create_db","abstract":false,"args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"args_string":"(quiet? : Bool = false)","args_html":"(quiet? : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L58"},"def":{"name":"create_db","args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"visibility":"Public","body":"begin\n DB.connect(\"#{credentials.connection_string}/#{db_user}\") do |db|\n db.exec(\"CREATE DATABASE #{db_name}\")\n end\n if quiet?\n else\n puts(\"Done creating #{db_name.colorize(:green)}\")\n end\nrescue e : DB::ConnectionRefused\n message = e.message.to_s\n if message.blank?\n raise(ConnectionError.new(URI.parse(credentials.url_without_query_params), Avram.settings.database_to_migrate))\n else\n raise(e)\n end\nrescue e : Exception\n message = e.message.to_s\n if message.includes?(\"\\\"#{self.db_name}\\\" already exists\")\n if quiet?\n else\n puts(\"Already created #{self.db_name.colorize(:green)}\")\n end\n else\n if message.includes?(\"Cannot establish connection\")\n raise(PGNotRunningError.new(message))\n else\n raise(e)\n end\n end\nend"}},{"html_id":"credentials-class-method","name":"credentials","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L36"},"def":{"name":"credentials","visibility":"Public","body":"Avram.settings.database_to_migrate.credentials"}},{"html_id":"db_host-class-method","name":"db_host","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L20"},"def":{"name":"db_host","visibility":"Public","body":"credentials.hostname"}},{"html_id":"db_name-class-method","name":"db_name","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L16"},"def":{"name":"db_name","visibility":"Public","body":"credentials.database"}},{"html_id":"db_password-class-method","name":"db_password","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L32"},"def":{"name":"db_password","visibility":"Public","body":"credentials.password"}},{"html_id":"db_port-class-method","name":"db_port","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L24"},"def":{"name":"db_port","visibility":"Public","body":"credentials.port"}},{"html_id":"db_user-class-method","name":"db_user","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L28"},"def":{"name":"db_user","visibility":"Public","body":"credentials.username"}},{"html_id":"drop_db(quiet?:Bool=false)-class-method","name":"drop_db","abstract":false,"args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"args_string":"(quiet? : Bool = false)","args_html":"(quiet? : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L49"},"def":{"name":"drop_db","args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"visibility":"Public","body":"DB.connect(\"#{credentials.connection_string}/#{db_user}\") do |db|\n db.exec(\"DROP DATABASE IF EXISTS #{db_name}\")\nend\nif quiet?\nelse\n puts(\"Done dropping #{Avram::Migrator::Runner.db_name.colorize(:green)}\")\nend\n"}},{"html_id":"dump_db(dump_to:String=\"db/structure.sql\",quiet:Bool=false)-class-method","name":"dump_db","doc":"Creates a new file at `dump_to` with your database schema,\nand includes the migtation data.","summary":"

Creates a new file at dump_to with your database schema, and includes the migtation data.

","abstract":false,"args":[{"name":"dump_to","default_value":"\"db/structure.sql\"","external_name":"dump_to","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(dump_to : String = \"db/structure.sql\", quiet : Bool = false)","args_html":"(dump_to : String = "db/structure.sql", quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":98,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L98"},"def":{"name":"dump_db","args":[{"name":"dump_to","default_value":"\"db/structure.sql\"","external_name":"dump_to","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"Db::VerifyConnection.new(quiet: true).run_task\nrun(\"pg_dump -s #{cmd_args} > #{dump_to}; pg_dump -t migrations --data-only #{cmd_args} >> #{dump_to}\")\nif quiet\nelse\n puts(\"Done dumping #{db_name.colorize(:green)}\")\nend\n"}},{"html_id":"migrations-class-method","name":"migrations","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L11"},"def":{"name":"migrations","visibility":"Public","body":"@@migrations"}},{"html_id":"restore_db(restore_file:String,quiet:Bool=false)-class-method","name":"restore_db","abstract":false,"args":[{"name":"restore_file","external_name":"restore_file","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(restore_file : String, quiet : Bool = false)","args_html":"(restore_file : String, quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L85"},"def":{"name":"restore_db","args":[{"name":"restore_file","external_name":"restore_file","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"if File.exists?(restore_file)\n run(\"psql -q #{cmd_args} -v ON_ERROR_STOP=1 < #{restore_file}\")\n if quiet\n else\n puts(\"Done restoring #{db_name.colorize(:green)}\")\n end\nelse\n raise(\"Unable to locate the restore file: #{restore_file}\")\nend"}},{"html_id":"run(command:String,output:IO=STDOUT)-class-method","name":"run","abstract":false,"args":[{"name":"command","external_name":"command","restriction":"String"},{"name":"output","default_value":"STDOUT","external_name":"output","restriction":"IO"}],"args_string":"(command : String, output : IO = STDOUT)","args_html":"(command : String, output : IO = STDOUT)","location":{"filename":"src/avram/migrator/runner.cr","line_number":130,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L130"},"def":{"name":"run","args":[{"name":"command","external_name":"command","restriction":"String"},{"name":"output","default_value":"STDOUT","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"error_messages = IO::Memory.new\nif self.db_password\n ENV[\"PGPASSWORD\"] = self.db_password\nend\nresult = Process.run(command, shell: true, output: output, error: error_messages)\nif self.db_password\n ENV.delete(\"PGPASSWORD\")\nend\nif result.success?\nelse\n raise(error_messages.to_s)\nend\n"}},{"html_id":"setup_migration_tracking_tables-class-method","name":"setup_migration_tracking_tables","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L106"},"def":{"name":"setup_migration_tracking_tables","visibility":"Public","body":"suppress_logging do\n db = Avram.settings.database_to_migrate\n db.exec(create_table_for_tracking_migrations)\n db.exec(create_unique_index_for_migrations)\nend"}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L13"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"ensure_migrated!-instance-method","name":"ensure_migrated!","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":184,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L184"},"def":{"name":"ensure_migrated!","visibility":"Public","body":"if !pending_migrations.empty?\n display_migration_error_banner\n Process.signal(:term, Process.ppid)\n exit(1)\nend"}},{"html_id":"rollback_all-instance-method","name":"rollback_all","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":161,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L161"},"def":{"name":"rollback_all","visibility":"Public","body":"self.class.setup_migration_tracking_tables\nmigrated_migrations.reverse.each do |__arg1|\n __arg1.new.down\nend\n"}},{"html_id":"rollback_one-instance-method","name":"rollback_one","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":166,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L166"},"def":{"name":"rollback_one","visibility":"Public","body":"self.class.setup_migration_tracking_tables\nif migrated_migrations.empty?\n puts(\"Did not roll anything back because the database has no migrations.\".colorize(:green))\nelse\n migrated_migrations.last.new.down\nend\n"}},{"html_id":"rollback_to(last_version:Int64)-instance-method","name":"rollback_to","abstract":false,"args":[{"name":"last_version","external_name":"last_version","restriction":"Int64"}],"args_string":"(last_version : Int64)","args_html":"(last_version : Int64)","location":{"filename":"src/avram/migrator/runner.cr","line_number":175,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L175"},"def":{"name":"rollback_to","args":[{"name":"last_version","external_name":"last_version","restriction":"Int64"}],"visibility":"Public","body":"self.class.setup_migration_tracking_tables\nsubset = migrated_migrations.select do |mm|\n mm.new.version > last_version\nend\nsubset.reverse.each do |__arg2|\n __arg2.new.down\nend\nputs(\"Done rolling back to #{last_version}\".colorize(:green))\n"}},{"html_id":"run_next_migration-instance-method","name":"run_next_migration","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L155"},"def":{"name":"run_next_migration","visibility":"Public","body":"prepare_for_migration do\n pending_migrations.first.new.up\nend"}},{"html_id":"run_pending_migrations-instance-method","name":"run_pending_migrations","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":149,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/runner.cr#L149"},"def":{"name":"run_pending_migrations","visibility":"Public","body":"prepare_for_migration do\n pending_migrations.each do |__arg0|\n __arg0.new.up(@quiet)\n end\nend"}}]},{"html_id":"avram/Avram/Migrator/StatementHelpers","path":"Avram/Migrator/StatementHelpers.html","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers","abstract":false,"ancestors":[{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"locations":[{"filename":"src/avram/migrator/statement_helpers.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"}],"including_types":[{"html_id":"avram/Avram/Migrator/Migration/V1","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"instance_methods":[{"html_id":"create_foreign_key(from:TableName,to:TableName,on_delete:Symbol,column:Symbol|Nil,primary_key=:id)-instance-method","name":"create_foreign_key","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":""}],"args_string":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil, primary_key = :id)","args_html":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil, primary_key = :id)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L31"},"def":{"name":"create_foreign_key","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":""}],"visibility":"Public","body":"prepared_statements << (CreateForeignKeyStatement.new(from, to, on_delete, column, primary_key)).build"}},{"html_id":"create_function(name:String,body:String,returns:String=\"trigger\")-instance-method","name":"create_function","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"args_string":"(name : String, body : String, returns : String = \"trigger\")","args_html":"(name : String, body : String, returns : String = "trigger")","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L67"},"def":{"name":"create_function","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::CreateFunctionStatement.new(name, body: body, returns: returns)).build"}},{"html_id":"create_index(table_name:TableName,columns:Columns,unique=false,using=:btree,name:String|Nil|Symbol|Nil=nil)-instance-method","name":"create_index","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table_name : TableName, columns : Columns, unique = false, using = :btree, name : String | Nil | Symbol | Nil = nil)","args_html":"(table_name : TableName, columns : Columns, unique = false, using = :btree, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L39"},"def":{"name":"create_index","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (CreateIndexStatement.new(table_name, columns, using, unique, name)).build"}},{"html_id":"create_trigger(table_name:TableName,name:String,function_name:String,callback:Symbol=:before,on:Array(Symbol)=[:update])-instance-method","name":"create_trigger","doc":"Drop any existing trigger by this name first before creating.\nPostgres does not support updating or replacing a trigger as of version 12\n\nCreates a new TRIGGER named `name` on the table `table_name`.\n`function_name` - The PG function to run from this trigger.\n`callback` - When to run this trigger (BEFORE or AFTER). Default `:before`\n`on` - The operation(s) for this trigger (INSERT, UPDATE, DELETE). Default is `[:update]`\n\n```\ncreate_trigger(:users, \"trigger_set_timestamps\", \"set_timestamps\")\n# => CREATE TRIGGER trigger_set_timestamps BEFORE UPDATE ON users FOR EACH ROW EXECUTE PROCEDURE set_timestamps();\n```","summary":"

Drop any existing trigger by this name first before creating.

","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"},{"name":"function_name","external_name":"function_name","restriction":"String"},{"name":"callback","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"on","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"args_string":"(table_name : TableName, name : String, function_name : String, callback : Symbol = :before, on : Array(Symbol) = [:update])","args_html":"(table_name : TableName, name : String, function_name : String, callback : Symbol = :before, on : Array(Symbol) = [:update])","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L87"},"def":{"name":"create_trigger","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"},{"name":"function_name","external_name":"function_name","restriction":"String"},{"name":"callback","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"on","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"visibility":"Public","body":"drop_trigger(table_name, name)\nprepared_statements << (Avram::Migrator::CreateTriggerStatement.new(table_name, name, function_name, callback, on)).build\n"}},{"html_id":"disable_extension(name:String)-instance-method","name":"disable_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L59"},"def":{"name":"disable_extension","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropExtensionStatement.new(name)).build"}},{"html_id":"drop(table_name)-instance-method","name":"drop","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L17"},"def":{"name":"drop","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropTableStatement.new(table_name)).build"}},{"html_id":"drop_foreign_key(from:TableName,references:TableName,column:Symbol|Nil)-instance-method","name":"drop_foreign_key","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"}],"args_string":"(from : TableName, references : TableName, column : Symbol | Nil)","args_html":"(from : TableName, references : TableName, column : Symbol | Nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L35"},"def":{"name":"drop_foreign_key","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (DropForeignKeyStatement.new(from, references, column)).build"}},{"html_id":"drop_function(name:String)-instance-method","name":"drop_function","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L71"},"def":{"name":"drop_function","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropFunctionStatement.new(name)).build"}},{"html_id":"drop_index(table_name:TableName,columns:Columns|Nil=nil,if_exists=false,on_delete=:do_nothing,name:String|Nil|Symbol|Nil=nil)-instance-method","name":"drop_index","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":""},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table_name : TableName, columns : Columns | Nil = nil, if_exists = false, on_delete = :do_nothing, name : String | Nil | Symbol | Nil = nil)","args_html":"(table_name : TableName, columns : Columns | Nil = nil, if_exists = false, on_delete = :do_nothing, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L43"},"def":{"name":"drop_index","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":""},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropIndexStatement.new(table_name, columns, if_exists, on_delete, name)).build"}},{"html_id":"drop_trigger(table_name:TableName,name:String)-instance-method","name":"drop_trigger","doc":"Drop the tigger `name` for the table `table_name`","summary":"

Drop the tigger name for the table table_name

","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(table_name : TableName, name : String)","args_html":"(table_name : TableName, name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":93,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L93"},"def":{"name":"drop_trigger","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropTriggerStatement.new(table_name, name)).build"}},{"html_id":"enable_extension(name:String)-instance-method","name":"enable_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L55"},"def":{"name":"enable_extension","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::CreateExtensionStatement.new(name)).build"}},{"html_id":"make_optional(table:TableName,column:Symbol)-instance-method","name":"make_optional","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(table : TableName, column : Symbol)","args_html":"(table : TableName, column : Symbol)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L51"},"def":{"name":"make_optional","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::ChangeNullStatement.new(table, column, required: false)).build"}},{"html_id":"make_required(table:TableName,column:Symbol)-instance-method","name":"make_required","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(table : TableName, column : Symbol)","args_html":"(table : TableName, column : Symbol)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L47"},"def":{"name":"make_required","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::ChangeNullStatement.new(table, column, required: true)).build"}},{"html_id":"update_extension(name:String,to:String|Nil=nil)-instance-method","name":"update_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"args_string":"(name : String, to : String | Nil = nil)","args_html":"(name : String, to : String | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L63"},"def":{"name":"update_extension","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::AlterExtensionStatement.new(name, to: to)).build"}}],"macros":[{"html_id":"alter(table_name)-macro","name":"alter","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L21"},"def":{"name":"alter","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":" statements = Avram::Migrator::AlterTableStatement.new(\n{{ table_name }}\n).build do\n \n{{ yield }}\n\n \nend.statements\n\n statements.each do |statement|\n prepared_statements << statement\n \nend\n \n"}},{"html_id":"create(table_name)-macro","name":"create","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/migrator/statement_helpers.cr#L7"},"def":{"name":"create","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":" statements = Avram::Migrator::CreateTableStatement.new(\n{{ table_name }}\n).build do\n \n{{ yield }}\n\n \nend.statements\n\n statements.each do |statement|\n prepared_statements << statement\n \nend\n \n"}}]}]},{"html_id":"avram/Avram/MissingRequiredAssociationError","path":"Avram/MissingRequiredAssociationError.html","kind":"class","full_name":"Avram::MissingRequiredAssociationError","name":"MissingRequiredAssociationError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(model:Avram::Model.class,association:Avram::Model.class)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"Avram::Model.class"},{"name":"association","external_name":"association","restriction":"Avram::Model.class"}],"args_string":"(model : Avram::Model.class, association : Avram::Model.class)","args_html":"(model : Avram::Model.class, association : Avram::Model.class)","location":{"filename":"src/avram/errors.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L44"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"Avram::Model.class"},{"name":"association","external_name":"association","restriction":"Avram::Model.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, association)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"association:Avram::Model.class-instance-method","name":"association","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L42"},"def":{"name":"association","return_type":"Avram::Model.class","visibility":"Public","body":"@association"}},{"html_id":"model:Avram::Model.class-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L41"},"def":{"name":"model","return_type":"Avram::Model.class","visibility":"Public","body":"@model"}}]},{"html_id":"avram/Avram/Model","path":"Avram/Model.html","kind":"class","full_name":"Avram::Model","name":"Model","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},{"html_id":"avram/Avram/Polymorphic","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic"},{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/model.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},{"html_id":"avram/Avram/Polymorphic","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic"},{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"database_table_info:Avram::Database::TableInfo|Nil-class-method","name":"database_table_info","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L28"},"def":{"name":"database_table_info","return_type":"Avram::Database::TableInfo | ::Nil","visibility":"Public","body":"database.database_info.table(table_name.to_s)"}},{"html_id":"primary_key_name:Symbol|Nil-class-method","name":"primary_key_name","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L24"},"def":{"name":"primary_key_name","return_type":"Symbol | ::Nil","visibility":"Public","body":"nil"}}],"instance_methods":[{"html_id":"delete-instance-method","name":"delete","doc":"Refer to `PrimaryKeyMethods#delete`","summary":"

Refer to PrimaryKeyMethods#delete

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L52"},"def":{"name":"delete","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#delete on #{@type.name} because it does not have a primary key. Add a primary key or define your own `delete` method.\") %}"}},{"html_id":"model_name:String-instance-method","name":"model_name","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L32"},"def":{"name":"model_name","return_type":"String","visibility":"Public","body":"self.class.name"}},{"html_id":"reload:self-instance-method","name":"reload","doc":"Refer to `PrimaryKeyMethods#reload`","summary":"

Refer to PrimaryKeyMethods#reload

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L37"},"def":{"name":"reload","return_type":"self","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#reload on #{@type.name} because it does not have a primary key. Add a primary key or define your own `reload` method.\") %}"}},{"html_id":"reload(&):self-instance-method","name":"reload","doc":"Refer to `PrimaryKeyMethods#reload`","summary":"

Refer to PrimaryKeyMethods#reload

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L42"},"def":{"name":"reload","yields":0,"block_arity":0,"return_type":"self","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#reload on #{@type.name} because it does not have a primary key. Add a primary key or define your own `reload` method.\") %}"}},{"html_id":"to_param:String-instance-method","name":"to_param","doc":"Refer to `PrimaryKeyMethods#to_param`","summary":"

Refer to PrimaryKeyMethods#to_param

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L47"},"def":{"name":"to_param","return_type":"String","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#to_param on #{@type.name} because it does not have a primary key. Add a primary key or define your own `to_param` method.\") %}"}}],"macros":[{"html_id":"association(assoc_name,type,relationship_type,foreign_key=nil,through=nil)-macro","name":"association","abstract":false,"args":[{"name":"assoc_name","external_name":"assoc_name","restriction":""},{"name":"type","external_name":"type","restriction":""},{"name":"relationship_type","external_name":"relationship_type","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""}],"args_string":"(assoc_name, type, relationship_type, foreign_key = nil, through = nil)","args_html":"(assoc_name, type, relationship_type, foreign_key = nil, through = nil)","location":{"filename":"src/avram/model.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L281"},"def":{"name":"association","args":[{"name":"assoc_name","external_name":"assoc_name","restriction":""},{"name":"type","external_name":"type","restriction":""},{"name":"relationship_type","external_name":"relationship_type","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""}],"visibility":"Public","body":" \n{% ASSOCIATIONS << {type: type, assoc_name: assoc_name.id, foreign_key: foreign_key, relationship_type: relationship_type, through: through} %}\n\n \n"}},{"html_id":"column(type_declaration,autogenerated=false,serializeis_serialized=false,allow_blank=false)-macro","name":"column","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"autogenerated","default_value":"false","external_name":"autogenerated","restriction":""},{"name":"is_serialized","default_value":"false","external_name":"serialize","restriction":""},{"name":"allow_blank","default_value":"false","external_name":"allow_blank","restriction":""}],"args_string":"(type_declaration, autogenerated = false, serialize is_serialized = false, allow_blank = false)","args_html":"(type_declaration, autogenerated = false, serialize is_serialized = false, allow_blank = false)","location":{"filename":"src/avram/model.cr","line_number":246,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L246"},"def":{"name":"column","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"autogenerated","default_value":"false","external_name":"autogenerated","restriction":""},{"name":"is_serialized","default_value":"false","external_name":"serialize","restriction":""},{"name":"allow_blank","default_value":"false","external_name":"allow_blank","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.type.is_a?(Union) %}\n {% data_type = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% data_type = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n \n{% if type_declaration.value || (type_declaration.value == false) %}\n {% value = type_declaration.value %}\n {% else %}\n {% value = nil %}\n {% end %}\n\n\n \n{% COLUMNS << {name: type_declaration.var, type: data_type, nilable: nilable.id, autogenerated: autogenerated, value: value, serialized: is_serialized, allow_blank: allow_blank} %}\n\n \n"}},{"html_id":"default_columns-macro","name":"default_columns","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L137"},"def":{"name":"default_columns","visibility":"Public","body":" primary_key id : Int64\n timestamps\n "}},{"html_id":"primary_key(type_declaration)-macro","name":"primary_key","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/model.cr","line_number":100,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L100"},"def":{"name":"primary_key","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" PRIMARY_KEY_TYPE = \n{{ type_declaration.type }}\n\n PRIMARY_KEY_NAME = \n{{ type_declaration.var.symbolize }}\n\n column \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n, autogenerated: true\n alias PrimaryKeyType = \n{{ type_declaration.type }}\n\n\n def self.primary_key_name : Symbol?\n :\n{{ type_declaration.var.stringify }}\n\n \nend\n\n include Avram::PrimaryKeyMethods\n\n \n# If not using default 'id' primary key\n\n \n{% if type_declaration.var.id != \"id\".id %}\n # Then point 'id' to the primary key\n def id\n {{ type_declaration.var.id }}\n end\n {% end %}\n\n \n"}},{"html_id":"setup(step)-macro","name":"setup","abstract":false,"args":[{"name":"step","external_name":"step","restriction":""}],"args_string":"(step)","args_html":"(step)","location":{"filename":"src/avram/model.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L152"},"def":{"name":"setup","args":[{"name":"step","external_name":"step","restriction":""}],"visibility":"Public","body":" \n{{ step.id }}\n(\n type: \n{{ @type }}\n,\n columns: \n{{ COLUMNS }}\n,\n associations: \n{{ ASSOCIATIONS }}\n\n )\n \n"}},{"html_id":"setup_association_queries(associations,*args,**named_args)-macro","name":"setup_association_queries","abstract":false,"args":[{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(associations, *args, **named_args)","args_html":"(associations, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":209,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L209"},"def":{"name":"setup_association_queries","args":[{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% for assoc in associations %}\n def {{ assoc[:assoc_name] }}_query\n {% if assoc[:relationship_type] == (:has_many) %}\n {{ assoc[:type] }}::BaseQuery.new.{{ assoc[:foreign_key].id }}(id)\n {% else %}{% if assoc[:relationship_type] == (:belongs_to) %}\n {{ assoc[:type] }}::BaseQuery.new.id({{ assoc[:foreign_key].id }})\n {% else %}\n {{ assoc[:type] }}::BaseQuery.new\n {% end %}{% end %}\n end\n {% end %}\n\n \n"}},{"html_id":"setup_column_info_methods(columns,*args,**named_args)-macro","name":"setup_column_info_methods","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L263"},"def":{"name":"setup_column_info_methods","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" def self.column_names : Array(Symbol)\n columns.map \n{ |column| column[:name] }\n \nend\n\n def self.columns : Array(\n{name: Symbol, nilable: Bool, type: String})\n [\n \n{% for column in columns %}\n {\n name: {{ column[:name].id.symbolize }},\n nilable: {{ column[:nilable] }},\n type: {{ column[:type].id }}.name\n },\n {% end %}\n\n ]\n \nend\n \n"}},{"html_id":"setup_db_mapping(columns,*args,**named_args)-macro","name":"setup_db_mapping","doc":"Setup [database mapping](http://crystal-lang.github.io/crystal-db/api/latest/DB.html) for the model's columns.\n\nNOTE: Avram::Migrator saves `Float` columns as numeric which are converted\nin the avram/charms/float64_extensions.cr file","summary":"

Setup database mapping for the model's columns.

","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":189,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L189"},"def":{"name":"setup_db_mapping","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" DB.mapping(\n{\n \n{% for column in columns %}\n {{ column[:name] }}: {\n {% if column[:type].id == Array(Float64).id %}\n type: Array(PG::Numeric),\n {% else %}{% if column[:type].is_a?(Generic) || column[:serialized] %}\n type: {{ column[:type] }},\n {% else %}\n type: {{ column[:type] }}::Lucky::ColumnType,\n {% end %}{% end %}\n nilable: {{ column[:nilable] }},\n {% if column[:serialized] %}\n converter: JSONConverter({{ column[:type] }}),\n {% end %}\n },\n {% end %}\n\n })\n \n"}},{"html_id":"setup_getters(columns,*args,**named_args)-macro","name":"setup_getters","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":233,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L233"},"def":{"name":"setup_getters","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% for column in columns %}\n def {{ column[:name] }} : {{ column[:type] }}{{ (column[:nilable] ? \"?\" : \"\").id }}\n {{ column[:type] }}.adapter.from_db!(@{{ column[:name] }})\n end\n {% if column[:type].id == Bool.id %}\n def {{ column[:name] }}? : Bool\n !!{{ column[:name] }}\n end\n {% end %}\n {% end %}\n\n \n"}},{"html_id":"setup_initialize(columns,*args,**named_args)-macro","name":"setup_initialize","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":176,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L176"},"def":{"name":"setup_initialize","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" def initialize(\n \n{% for column in columns %}\n @{{ column[:name] }},\n {% end %}\n\n )\n \nend\n \n"}},{"html_id":"setup_table_schema_enforcer_validations(type,*args,**named_args)-macro","name":"setup_table_schema_enforcer_validations","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":223,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L223"},"def":{"name":"setup_table_schema_enforcer_validations","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" schema_enforcer_validations << EnsureExistingTable.new(model_class: \n{{ type.id }}\n)\n schema_enforcer_validations << EnsureMatchingColumns.new(model_class: \n{{ type.id }}\n)\n \n"}},{"html_id":"setup_view_schema_enforcer_validations(type,*args,**named_args)-macro","name":"setup_view_schema_enforcer_validations","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":228,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L228"},"def":{"name":"setup_view_schema_enforcer_validations","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" schema_enforcer_validations << EnsureExistingTable.new(model_class: \n{{ type.id }}\n)\n schema_enforcer_validations << EnsureMatchingColumns.new(model_class: \n{{ type.id }}\n, check_required: false)\n \n"}},{"html_id":"skip_default_columns-macro","name":"skip_default_columns","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L142"},"def":{"name":"skip_default_columns","visibility":"Public","body":" macro default_columns\n \nend\n \n"}},{"html_id":"table(table_name=nil)-macro","name":"table","abstract":false,"args":[{"name":"table_name","default_value":"nil","external_name":"table_name","restriction":""}],"args_string":"(table_name = nil)","args_html":"(table_name = nil)","location":{"filename":"src/avram/model.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L56"},"def":{"name":"table","args":[{"name":"table_name","default_value":"nil","external_name":"table_name","restriction":""}],"visibility":"Public","body":" default_columns\n\n \n{{ yield }}\n\n\n validate_columns(\"table\")\n validate_primary_key\n\n \n{% if table_name %}\n class_getter table_name : String = {{ table_name.id.stringify }}\n {% else %}\n class_getter table_name : String = Avram::TableFor.table_for({{ @type.id }})\n {% end %}\n\n setup(Avram::Model.setup_initialize)\n setup(Avram::Model.setup_db_mapping)\n setup(Avram::Model.setup_getters)\n setup(Avram::Model.setup_column_info_methods)\n setup(Avram::Model.setup_association_queries)\n setup(Avram::Model.setup_table_schema_enforcer_validations)\n setup(Avram::BaseQueryTemplate.setup)\n setup(Avram::SaveOperationTemplate.setup)\n setup(Avram::DeleteOperationTemplate.setup)\n setup(Avram::SchemaEnforcer.setup)\n \n"}},{"html_id":"timestamps-macro","name":"timestamps","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L147"},"def":{"name":"timestamps","visibility":"Public","body":" column created_at : Time, autogenerated: true\n column updated_at : Time, autogenerated: true\n "}},{"html_id":"validate_columns(model_type)-macro","name":"validate_columns","abstract":false,"args":[{"name":"model_type","external_name":"model_type","restriction":""}],"args_string":"(model_type)","args_html":"(model_type)","location":{"filename":"src/avram/model.cr","line_number":160,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L160"},"def":{"name":"validate_columns","args":[{"name":"model_type","external_name":"model_type","restriction":""}],"visibility":"Public","body":" \n{% if COLUMNS.empty? %}\n {% raise(\"#{@type} must define at least one column.\\n\\nExample:\\n\\n #{model_type.id} do\\n primary_key id : Int64\\n ...\\n end\") %}\n {% end %}\n\n \n"}},{"html_id":"validate_primary_key-macro","name":"validate_primary_key","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":121,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L121"},"def":{"name":"validate_primary_key","visibility":"Public","body":" \n{% if !(@type.has_constant?(\"PRIMARY_KEY_TYPE\")) %}\n \\{% raise <<-ERROR\n No primary key was specified.\n\n Example:\n\n table do\n primary_key id : Int64\n ...\n end\n ERROR\n %}\n {% end %}\n\n \n"}},{"html_id":"view(view_name=nil)-macro","name":"view","abstract":false,"args":[{"name":"view_name","default_value":"nil","external_name":"view_name","restriction":""}],"args_string":"(view_name = nil)","args_html":"(view_name = nil)","location":{"filename":"src/avram/model.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L81"},"def":{"name":"view","args":[{"name":"view_name","default_value":"nil","external_name":"view_name","restriction":""}],"visibility":"Public","body":" \n{{ yield }}\n\n\n validate_columns(\"view\")\n \n{% if view_name %}\n class_getter table_name : String = {{ view_name.id.stringify }}\n {% else %}\n class_getter table_name : String = Avram::TableFor.table_for({{ @type.id }})\n {% end %}\n\n setup(Avram::Model.setup_initialize)\n setup(Avram::Model.setup_db_mapping)\n setup(Avram::Model.setup_getters)\n setup(Avram::Model.setup_column_info_methods)\n setup(Avram::Model.setup_association_queries)\n setup(Avram::Model.setup_view_schema_enforcer_validations)\n setup(Avram::BaseQueryTemplate.setup)\n setup(Avram::SchemaEnforcer.setup)\n \n"}}],"types":[{"html_id":"avram/Avram/Model/JSONConverter","path":"Avram/Model/JSONConverter.html","kind":"module","full_name":"Avram::Model::JSONConverter(T)","name":"JSONConverter","abstract":false,"locations":[{"filename":"src/avram/model.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L11"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"},"class_methods":[{"html_id":"from_rs(rs:DB::ResultSet)-class-method","name":"from_rs","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/model.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/model.cr#L12"},"def":{"name":"from_rs","args":[{"name":"rs","external_name":"rs","restriction":"DB::ResultSet"}],"visibility":"Public","body":"value = rs.read(::Union(JSON::PullParser, ::Nil))\nif value\n T.new(value)\nend\n"}}]}]},{"html_id":"avram/Avram/NeedyInitializer","path":"Avram/NeedyInitializer.html","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer","abstract":false,"locations":[{"filename":"src/avram/needy_initializer.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L68"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializers-macro","name":"generate_initializers","abstract":false,"location":{"filename":"src/avram/needy_initializer.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L37"},"def":{"name":"generate_initializers","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L15"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# This is called at the end so @type will be of the subclass,\n\n \n# and not the parent abstract class.\n\n generate_initializers\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n property \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n \n"}}]},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","path":"Avram/NeedyInitializerAndDeleteMethods.html","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods","abstract":false,"locations":[{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_delete(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_delete","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":94,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L94"},"def":{"name":"generate_delete","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.delete\n{% if with_bang %}!{% end %}\n(\n record : T,\n params : Hash,\n **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:delete\n{% if with_bang %}!{% end %}\n, additional_args: \"record, \")\n \nend\n\n def self.delete\n{% if with_bang %}!{% end %}\n(\n record : T,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n record,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.delete!\n {% else %}\n operation.delete\n yield operation, operation.record\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_delete_methods(attribute_method_args,attribute_params)-macro","name":"generate_delete_methods","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L133"},"def":{"name":"generate_delete_methods","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n \n"}},{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L140"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @record : T,\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @record : T,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \nextract_changes_from_params\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n unless {{ attribute[:name] }}.is_a? Avram::Nothing\n self.{{ attribute[:name] }}.value = {{ attribute[:name] }}\n end\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer_and_delete_methods-macro","name":"generate_initializer_and_delete_methods","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L37"},"def":{"name":"generate_initializer_and_delete_methods","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# These method arguments can be used in macros for generating delete/new\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute[:name]} : #{attribute[:type]} | Avram::Nothing\" %}\n {% if attribute[:nilable] %}{% attribute_method_args = attribute_method_args + \" | Nil\" %}{% end %}\n {% attribute_method_args = attribute_method_args + \" = Avram::Nothing.new,\\n\" %}\n\n {% attribute_params = attribute_params + \"#{attribute[:name]}: #{attribute[:name]},\\n\" %}\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n generate_delete_methods(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"hash_is_not_allowed_helpful_error(method,additional_args=nil)-macro","name":"hash_is_not_allowed_helpful_error","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"args_string":"(method, additional_args = nil)","args_html":"(method, additional_args = nil)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L81"},"def":{"name":"hash_is_not_allowed_helpful_error","args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"visibility":"Public","body":" \n{% raise(\"You can't pass a Hash directly to #{method.id}. Instead pass named arguments, or convert the hash to params.\\n\\nTry this...\\n\\n * Use named arguments (recommended) - #{@type}.#{method.id}(#{if additional_args\n additional_args.id\nend}title: \\\"My Title\\\")\\n * Convert hash to params (not as safe) - Avram::Params.new({\\\"title\\\" => \\\"My Title\\\"})\\n\") %}\n\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L15"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# This is called at the end so @type will be of the subclass,\n\n \n# and not the parent abstract class.\n\n generate_initializer_and_delete_methods\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_delete_methods.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n property \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n \n"}}]},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","path":"Avram/NeedyInitializerAndSaveMethods.html","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods","abstract":false,"locations":[{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_create(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_create","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":96,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L96"},"def":{"name":"generate_create","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.create\n{% if with_bang %}!{% end %}\n(\n params : Hash, **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:create\n{% if with_bang %}!{% end %}\n)\n \nend\n\n def self.create\n{% if with_bang %}!{% end %}\n(\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.save!\n {% else %}\n if operation.save\n yield operation, operation.record\n else\n yield operation, nil\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":185,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L185"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @record : T,\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @record = nil\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @record : T,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @record = nil\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \nextract_changes_from_params\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n unless {{ attribute[:name] }}.is_a? Avram::Nothing\n self.{{ attribute[:name] }}.value = {{ attribute[:name] }}\n end\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer_and_save_methods-macro","name":"generate_initializer_and_save_methods","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L39"},"def":{"name":"generate_initializer_and_save_methods","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# These method arguments can be used in macros fro generating create/update/new\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute[:name]} : #{attribute[:type]} | Avram::Nothing\" %}\n {% if attribute[:nilable] %}{% attribute_method_args = attribute_method_args + \" | Nil\" %}{% end %}\n {% attribute_method_args = attribute_method_args + \" = Avram::Nothing.new,\\n\" %}\n\n {% attribute_params = attribute_params + \"#{attribute[:name]}: #{attribute[:name]},\\n\" %}\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n generate_save_methods(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"generate_save_methods(attribute_method_args,attribute_params)-macro","name":"generate_save_methods","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":173,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L173"},"def":{"name":"generate_save_methods","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n \n"}},{"html_id":"generate_update(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_update","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":134,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L134"},"def":{"name":"generate_update","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.update\n{% if with_bang %}!{% end %}\n(\n record : T,\n params : Hash,\n **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:update\n{% if with_bang %}!{% end %}\n, additional_args: \"record, \")\n \nend\n\n def self.update\n{% if with_bang %}!{% end %}\n(\n record : T,\n \n{% if with_params %}with params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n record,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.update!\n {% else %}\n operation.save\n yield operation, operation.record.not_nil!\n {% end %}\n\n \nend\n \n"}},{"html_id":"hash_is_not_allowed_helpful_error(method,additional_args=nil)-macro","name":"hash_is_not_allowed_helpful_error","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"args_string":"(method, additional_args = nil)","args_html":"(method, additional_args = nil)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":83,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L83"},"def":{"name":"hash_is_not_allowed_helpful_error","args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"visibility":"Public","body":" \n{% raise(\"You can't pass a Hash directly to #{method.id}. Instead pass named arguments, or convert the hash to params.\\n\\nTry this...\\n\\n * Use named arguments (recommended) - #{@type}.#{method.id}(#{if additional_args\n additional_args.id\nend}title: \\\"My Title\\\")\\n * Convert hash to params (not as safe) - Avram::Params.new({\\\"title\\\" => [\\\"My Title\\\"]})\\n\") %}\n\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L16"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# @type is not correct in this method, but is in the macro we call below\n\n \n# That is why this extrac macro was extracted. We need @type to get the\n\n \n# attributes for this SaveOperation\n\n generate_initializer_and_save_methods\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/needy_initializer_and_save_methods.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n @\n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n property \n{{ type_declaration.var }}\n\n \n"}}]},{"html_id":"avram/Avram/NestedSaveOperation","path":"Avram/NestedSaveOperation.html","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation","abstract":false,"locations":[{"filename":"src/avram/nested_save_operation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nested_save_operation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"mark_nested_save_operations_as_failed-instance-method","name":"mark_nested_save_operations_as_failed","abstract":false,"location":{"filename":"src/avram/nested_save_operation.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nested_save_operation.cr#L49"},"def":{"name":"mark_nested_save_operations_as_failed","visibility":"Public","body":"nested_save_operations.each do |operation|\n (operation.as(Avram::MarkAsFailed)).mark_as_failed\nend"}},{"html_id":"nested_save_operations-instance-method","name":"nested_save_operations","abstract":false,"location":{"filename":"src/avram/nested_save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nested_save_operation.cr#L55"},"def":{"name":"nested_save_operations","visibility":"Public","body":"[] of Avram::MarkAsFailed"}}],"macros":[{"html_id":"has_one(type_declaration)-macro","name":"has_one","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/nested_save_operation.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nested_save_operation.cr#L2"},"def":{"name":"has_one","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% name = type_declaration.var %}\n\n \n{% type = type_declaration.type.resolve %}\n\n\n \n{% model_type = type.ancestors.find do |t|\n t.stringify.starts_with?(\"Avram::SaveOperation(\")\nend.type_vars.first %}\n\n\n \n{% assoc = (T.constant(:ASSOCIATIONS)).find do |assoc|\n (assoc[:relationship_type] == (:has_one)) && (assoc[:type].resolve.name == model_type.name)\nend %}\n\n\n \n{% if assoc %}{% else %}\n {% raise(\"#{T} must have a has_one association with #{model_type}\") %}\n {% end %}\n\n\n @_\n{{ name }}\n : \n{{ type }}\n | Nil\n\n after_save save_\n{{ name }}\n\n\n def save_\n{{ name }}\n(saved_record)\n \n{{ name }}\n.\n{{ (@type.constant(:FOREIGN_KEY)).id }}\n.value = saved_record.id\n\n unless \n{{ name }}\n.save\n add_error(:\n{{ name }}\n, \"failed\")\n mark_nested_save_operations_as_failed\n database.rollback\n \nend\n \nend\n\n def \n{{ name }}\n\n @_\n{{ name }}\n ||= if new_record?\n \n{{ type }}\n.new(params)\n \nelse\n \n{{ type }}\n.new(record.not_nil!.\n{{ assoc[:assoc_name].id }}\n!, params)\n \nend\n \nend\n\n def nested_save_operations\n \n{% if @type.methods.map(&.name).includes?((:nested_save_operations).id) %}\n previous_def +\n {% end %}\n\n [\n{{ name }}\n]\n \nend\n \n"}}]},{"html_id":"avram/Avram/Nothing","path":"Avram/Nothing.html","kind":"class","full_name":"Avram::Nothing","name":"Nothing","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/nothing.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/nothing.cr#L5"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"This class is used in various places\nwhere the question of \"Did I not pass in anything or did I pass in nil?\"\nneeds to be answered.\n:nodoc:","summary":"

This class is used in various places where the question of "Did I not pass in anything or did I pass in nil?" needs to be answered.

"},{"html_id":"avram/Avram/Operation","path":"Avram/Operation.html","kind":"class","full_name":"Avram::Operation","name":"Operation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializer","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/operation.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializer","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L104"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"name.underscore"}},{"html_id":"run(params:Avram::Paramable,*args,**named_args,&)-class-method","name":"run","doc":"Yields the instance of the operation, and the return value from\nthe `run` instance method.\n\n```\nMyOperation.run(params) do |operation, value|\n # operation is complete\nend\n```","summary":"

Yields the instance of the operation, and the return value from the #run instance method.

","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"args_string":"(params : Avram::Paramable, *args, **named_args, &)","args_html":"(params : Avram::Paramable, *args, **named_args, &)","location":{"filename":"src/avram/operation.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L52"},"def":{"name":"run","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":2,"block_arity":2,"visibility":"Public","body":"operation = self.new(params, *args, **named_args)\nvalue = nil\noperation.before_run\nif operation.valid?\n value = operation.run\n operation.after_run(value)\nend\nyield operation, value\n"}},{"html_id":"run(*args,**named_args,&)-class-method","name":"run","doc":"Yields the instance of the operation, and the return value from\nthe `run` instance method.\n\n```\nMyOperation.run do |operation, value|\n # operation is complete\nend\n```","summary":"

Yields the instance of the operation, and the return value from the #run instance method.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args, &)","args_html":"(*args, **named_args, &)","location":{"filename":"src/avram/operation.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L26"},"def":{"name":"run","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"yields":2,"block_arity":2,"visibility":"Public","body":"params = Avram::Params.new\nrun(params, *args, **named_args) do |operation, value|\n yield operation, value\nend\n"}},{"html_id":"run!(params:Avram::Paramable,*args,**named_args)-class-method","name":"run!","doc":"Returns the value from the `run` instance method.\nor raise `Avram::FailedOperation` if the operation fails.\n\n```\nvalue = MyOperation.run!(params)\n```","summary":"

Returns the value from the #run instance method.

","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"args_string":"(params : Avram::Paramable, *args, **named_args)","args_html":"(params : Avram::Paramable, *args, **named_args)","location":{"filename":"src/avram/operation.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L72"},"def":{"name":"run!","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"run(params, *args, **named_args) do |_operation, value|\n if value\n else\n raise(Avram::FailedOperation.new(\"The operation failed to return a value\"))\n end\n value\nend"}},{"html_id":"run!(*args,**named_args)-class-method","name":"run!","doc":"Returns the value from the `run` instance method.\nor raise `Avram::FailedOperation` if the operation fails.\n\n```\nvalue = MyOperation.run!\n```","summary":"

Returns the value from the #run instance method.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/operation.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L39"},"def":{"name":"run!","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"params = Avram::Params.new\nrun!(params, *args, **named_args)\n"}}],"constructors":[{"html_id":"new(params:Avram::Paramable)-class-method","name":"new","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/operation.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L87"},"def":{"name":"new","args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"visibility":"Public","body":"_ = allocate\n_.initialize(params)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L90"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"after_run(_value)-instance-method","name":"after_run","abstract":false,"args":[{"name":"_value","external_name":"_value","restriction":""}],"args_string":"(_value)","args_html":"(_value)","location":{"filename":"src/avram/operation.cr","line_number":84,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L84"},"def":{"name":"after_run","args":[{"name":"_value","external_name":"_value","restriction":""}],"visibility":"Public","body":""}},{"html_id":"before_run-instance-method","name":"before_run","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L79"},"def":{"name":"before_run","visibility":"Public","body":""}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"params:Avram::Paramable-instance-method","name":"params","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L16"},"def":{"name":"params","return_type":"Avram::Paramable","visibility":"Public","body":"@params"}},{"html_id":"run-instance-method","name":"run","abstract":true,"location":{"filename":"src/avram/operation.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L82"},"def":{"name":"run","visibility":"Public","body":""}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":99,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation.cr#L99"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/OperationErrors","path":"Avram/OperationErrors.html","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors","abstract":false,"locations":[{"filename":"src/avram/operation_errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation_errors.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"add_error(key:Symbol,message:String):Nil-instance-method","name":"add_error","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"Symbol"},{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(key : Symbol, message : String) : Nil","args_html":"(key : Symbol, message : String) : Nil","location":{"filename":"src/avram/operation_errors.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation_errors.cr#L19"},"def":{"name":"add_error","args":[{"name":"key","external_name":"key","restriction":"Symbol"},{"name":"message","external_name":"message","restriction":"String"}],"return_type":"Nil","visibility":"Public","body":"__temp_89 = key\n@custom_errors[__temp_89]? || (@custom_errors[__temp_89] = [] of String)\n@custom_errors[key].push(message)\n"}},{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/operation_errors.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/operation_errors.cr#L6"},"def":{"name":"errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"attr_errors = attributes.reduce({} of Symbol => Array(String)) do |errors_hash, attribute|\n if attribute.errors.empty?\n errors_hash\n else\n errors_hash[attribute.name] = attribute.errors\n errors_hash\n end\nend\nattr_errors.merge(@custom_errors)\n"}}]},{"html_id":"avram/Avram/OrderBy","path":"Avram/OrderBy.html","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy","abstract":false,"superclass":{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},"ancestors":[{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(column:String|Symbol,direction:Direction,nulls:NullSorting=:default)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"String | Symbol"},{"name":"direction","external_name":"direction","restriction":"Direction"},{"name":"nulls","default_value":":default","external_name":"nulls","restriction":"NullSorting"}],"args_string":"(column : String | Symbol, direction : Direction, nulls : NullSorting = :default)","args_html":"(column : String | Symbol, direction : Direction, nulls : NullSorting = :default)","location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L24"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":"String | Symbol"},{"name":"direction","external_name":"direction","restriction":"Direction"},{"name":"nulls","default_value":":default","external_name":"nulls","restriction":"NullSorting"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column, direction, nulls)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L18"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L20"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":"@column"}},{"html_id":"direction:Avram::OrderBy::Direction-instance-method","name":"direction","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L21"},"def":{"name":"direction","visibility":"Public","body":"@direction"}},{"html_id":"nulls:Avram::OrderBy::NullSorting-instance-method","name":"nulls","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L22"},"def":{"name":"nulls","visibility":"Public","body":"@nulls"}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L31"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":"String.build do |str|\n str << \"#{column} #{direction}\"\n if nulls.default?\n else\n str << \" #{nulls}\"\n end\nend"}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L38"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":"@direction = @direction.asc? ? Direction::DESC : Direction::ASC\nself\n"}}],"types":[{"html_id":"avram/Avram/OrderBy/Direction","path":"Avram/OrderBy/Direction.html","kind":"enum","full_name":"Avram::OrderBy::Direction","name":"Direction","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L13"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"ASC","name":"ASC","value":"0"},{"id":"DESC","name":"DESC","value":"1"}],"namespace":{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},"instance_methods":[{"html_id":"asc?-instance-method","name":"asc?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L14"},"def":{"name":"asc?","visibility":"Public","body":"self == ASC"}},{"html_id":"desc?-instance-method","name":"desc?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L15"},"def":{"name":"desc?","visibility":"Public","body":"self == DESC"}}]},{"html_id":"avram/Avram/OrderBy/NullSorting","path":"Avram/OrderBy/NullSorting.html","kind":"enum","full_name":"Avram::OrderBy::NullSorting","name":"NullSorting","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L3"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"DEFAULT","name":"DEFAULT","value":"0"},{"id":"NULLS_FIRST","name":"NULLS_FIRST","value":"1"},{"id":"NULLS_LAST","name":"NULLS_LAST","value":"2"}],"namespace":{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},"instance_methods":[{"html_id":"default?-instance-method","name":"default?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L4"},"def":{"name":"default?","visibility":"Public","body":"self == DEFAULT"}},{"html_id":"nulls_first?-instance-method","name":"nulls_first?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L5"},"def":{"name":"nulls_first?","visibility":"Public","body":"self == NULLS_FIRST"}},{"html_id":"nulls_last?-instance-method","name":"nulls_last?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L6"},"def":{"name":"nulls_last?","visibility":"Public","body":"self == NULLS_LAST"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"Returns a `String` representation of this enum member.\nIn the case of regular enums, this is just the name of the member.\nIn the case of flag enums, it's the names joined by vertical bars, or \"None\",\nif the value is zero.\n\nIf an enum's value doesn't match a member's value, the raw value\nis returned as a string.\n\n```\nColor::Red.to_s # => \"Red\"\nIOMode::None.to_s # => \"None\"\n(IOMode::Read | IOMode::Write).to_s # => \"Read | Write\"\n\nColor.new(10).to_s # => \"10\"\n```","summary":"

Returns a String representation of this enum member.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by.cr#L8"},"def":{"name":"to_s","visibility":"Public","body":"super().gsub(\"_\", \" \")"}}]}]},{"html_id":"avram/Avram/OrderByClause","path":"Avram/OrderByClause.html","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},{"html_id":"avram/Avram/OrderByRandom","kind":"class","full_name":"Avram::OrderByRandom","name":"OrderByRandom"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L3"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":""}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L4"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":""}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause.cr#L5"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/OrderByRandom","path":"Avram/OrderByRandom.html","kind":"class","full_name":"Avram::OrderByRandom","name":"OrderByRandom","abstract":false,"superclass":{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},"ancestors":[{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L3"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L5"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":"@column"}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L7"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":"\"RANDOM ()\""}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/order_by_clause/order_by_random.cr#L11"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":"self"}}]},{"html_id":"avram/Avram/Paramable","path":"Avram/Paramable.html","kind":"module","full_name":"Avram::Paramable","name":"Paramable","abstract":false,"locations":[{"filename":"src/avram/paramable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Params","kind":"class","full_name":"Avram::Params","name":"Params"},{"html_id":"avram/Lucky/Params","kind":"class","full_name":"Lucky::Params","name":"Params"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"get(key:String)-instance-method","name":"get","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L9"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get?(key:String)-instance-method","name":"get?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L8"},"def":{"name":"get?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get_all(key:String)-instance-method","name":"get_all","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L11"},"def":{"name":"get_all","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get_all?(key:String)-instance-method","name":"get_all?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L10"},"def":{"name":"get_all?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"has_key_for?(operation:Avram::Operation.class|Avram::SaveOperation.class):Bool-instance-method","name":"has_key_for?","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":"Avram::Operation.class | Avram::SaveOperation.class"}],"args_string":"(operation : Avram::Operation.class | Avram::SaveOperation.class) : Bool","args_html":"(operation : Avram::Operation.class | Avram::SaveOperation.class) : Bool","location":{"filename":"src/avram/paramable.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L13"},"def":{"name":"has_key_for?","args":[{"name":"operation","external_name":"operation","restriction":"Avram::Operation.class | Avram::SaveOperation.class"}],"return_type":"Bool","visibility":"Public","body":"!(nested?(operation.param_key)).empty?"}},{"html_id":"many_nested(key:String):Array(Hash(String,String))-instance-method","name":"many_nested","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/paramable.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L7"},"def":{"name":"many_nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":""}},{"html_id":"many_nested?(key:String):Array(Hash(String,String))-instance-method","name":"many_nested?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/paramable.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L6"},"def":{"name":"many_nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":""}},{"html_id":"nested(key:String):Hash(String,String)-instance-method","name":"nested","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/paramable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L3"},"def":{"name":"nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":""}},{"html_id":"nested?(key:String):Hash(String,String)-instance-method","name":"nested?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/paramable.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L2"},"def":{"name":"nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":""}},{"html_id":"nested_arrays(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/paramable.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L5"},"def":{"name":"nested_arrays","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":""}},{"html_id":"nested_arrays?(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/paramable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/paramable.cr#L4"},"def":{"name":"nested_arrays?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/ParamKeyOverride","path":"Avram/ParamKeyOverride.html","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride","abstract":false,"locations":[{"filename":"src/avram/param_key_override.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/param_key_override.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"define_param_key_override-macro","name":"define_param_key_override","abstract":false,"location":{"filename":"src/avram/param_key_override.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/param_key_override.cr#L10"},"def":{"name":"define_param_key_override","visibility":"Public","body":" macro param_key(key)\n def self.param_key : String\n \n\\{\n{ key.id.stringify }}\n \nend\n \nend\n \n"}}]},{"html_id":"avram/Avram/Params","path":"Avram/Params.html","kind":"class","full_name":"Avram::Params","name":"Params","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Paramable","kind":"module","full_name":"Avram::Paramable","name":"Paramable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/params.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Paramable","kind":"module","full_name":"Avram::Paramable","name":"Paramable"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(hash:Hash(String,Array(String)|String)|Hash(String,Array(String))|Hash(String,String))-class-method","name":"new","abstract":false,"args":[{"name":"hash","external_name":"hash","restriction":"::Hash(::String, ::Array(::String) | ::String) | ::Hash(::String, ::Array(::String)) | ::Hash(::String, ::String)"}],"args_string":"(hash : Hash(String, Array(String) | String) | Hash(String, Array(String)) | Hash(String, String))","args_html":"(hash : Hash(String, Array(String) | String) | Hash(String, Array(String)) | Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L12"},"def":{"name":"new","args":[{"name":"hash","external_name":"hash","restriction":"::Hash(::String, ::Array(::String) | ::String) | ::Hash(::String, ::Array(::String)) | ::Hash(::String, ::String)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(hash)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/params.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L8"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"get(key:String)-instance-method","name":"get","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L51"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"(get?(key)).not_nil!"}},{"html_id":"get?(key:String)-instance-method","name":"get?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L47"},"def":{"name":"get?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"@hash[key]?.try do |value|\n if value.is_a?(String)\n value\n end\nend"}},{"html_id":"get_all(key:String)-instance-method","name":"get_all","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L59"},"def":{"name":"get_all","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"(get_all?(key)).not_nil!"}},{"html_id":"get_all?(key:String)-instance-method","name":"get_all?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L55"},"def":{"name":"get_all?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"@hash[key]?.try do |value|\n if value.is_a?(Array)\n value\n end\nend"}},{"html_id":"get_all_files(key:String)-instance-method","name":"get_all_files","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L71"},"def":{"name":"get_all_files","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"get_all(key)"}},{"html_id":"many_nested(key:String):Array(Hash(String,String))-instance-method","name":"many_nested","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L43"},"def":{"name":"many_nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":"[nested(key)]"}},{"html_id":"many_nested?(key:String):Array(Hash(String,String))-instance-method","name":"many_nested?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L39"},"def":{"name":"many_nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":"many_nested(key)"}},{"html_id":"nested(key:String):Hash(String,String)-instance-method","name":"nested","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L19"},"def":{"name":"nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"Hash(String, String).new.tap do |params|\n @hash.each do |_key, _value|\n if _value.is_a?(String)\n params[_key] = _value\n end\n end\nend"}},{"html_id":"nested?(key:String):Hash(String,String)-instance-method","name":"nested?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L15"},"def":{"name":"nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested(key)"}},{"html_id":"nested_arrays(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/params.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L31"},"def":{"name":"nested_arrays","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":"Hash(String, Array(String)).new.tap do |params|\n @hash.each do |_key, _value|\n if _value.is_a?(Array)\n params[_key] = _value\n end\n end\nend"}},{"html_id":"nested_arrays?(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/params.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L27"},"def":{"name":"nested_arrays?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":"nested_arrays(key)"}},{"html_id":"nested_file(key:String):Hash(String,String)-instance-method","name":"nested_file","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L67"},"def":{"name":"nested_file","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested(key)"}},{"html_id":"nested_file?(key:String):Hash(String,String)-instance-method","name":"nested_file?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/params.cr#L63"},"def":{"name":"nested_file?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested?(key)"}}]},{"html_id":"avram/Avram/PermittedAttribute","path":"Avram/PermittedAttribute.html","kind":"class","full_name":"Avram::PermittedAttribute(T)","name":"PermittedAttribute","abstract":false,"superclass":{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute","name":"Attribute"},"ancestors":[{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute","name":"Attribute"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/permitted_attribute.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/permitted_attribute.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(name,value:T|Nil,param_key,param=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":""},{"name":"param","default_value":"nil","external_name":"param","restriction":""}],"args_string":"(name, value : T | Nil, param_key, param = nil)","args_html":"(name, value : T | Nil, param_key, param = nil)","location":{"filename":"src/avram/attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/attribute.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":""},{"name":"param","default_value":"nil","external_name":"param","restriction":""}],"visibility":"Public","body":"_ = PermittedAttribute(T).allocate\n_.initialize(name, value, param_key, param)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/PGClientNotInstalledError","path":"Avram/PGClientNotInstalledError.html","kind":"class","full_name":"Avram::PGClientNotInstalledError","name":"PGClientNotInstalledError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L105"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(original_message:String)-class-method","name":"new","abstract":false,"args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"args_string":"(original_message : String)","args_html":"(original_message : String)","location":{"filename":"src/avram/errors.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L106"},"def":{"name":"new","args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(original_message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/PGNotRunningError","path":"Avram/PGNotRunningError.html","kind":"class","full_name":"Avram::PGNotRunningError","name":"PGNotRunningError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L131"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(original_message:String)-class-method","name":"new","abstract":false,"args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"args_string":"(original_message : String)","args_html":"(original_message : String)","location":{"filename":"src/avram/errors.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L132"},"def":{"name":"new","args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(original_message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Polymorphic","path":"Avram/Polymorphic.html","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic","abstract":false,"locations":[{"filename":"src/avram/polymorphic.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/polymorphic.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Helpers for defining polymorphic associations","summary":"

Helpers for defining polymorphic associations

","macros":[{"html_id":"polymorphic(polymorphic_name,associations,optional=false)-macro","name":"polymorphic","doc":"# Save a comment for this video\nvideo = VideoQuery.first\nComment::SaveOperation.create!(video_id: video.id)\n```","summary":"

\n \n \nSave a comment for this video video = VideoQuery.first Comment::SaveOperation.create!(video_id: video.id) ```

","abstract":false,"args":[{"name":"polymorphic_name","external_name":"polymorphic_name","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"optional","default_value":"false","external_name":"optional","restriction":""}],"args_string":"(polymorphic_name, associations, optional = false)","args_html":"(polymorphic_name, associations, optional = false)","location":{"filename":"src/avram/polymorphic.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/polymorphic.cr#L104"},"def":{"name":"polymorphic","args":[{"name":"polymorphic_name","external_name":"polymorphic_name","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"optional","default_value":"false","external_name":"optional","restriction":""}],"visibility":"Public","body":" \n{% polymorphic_name = polymorphic_name.id %}\n\n def \n{{ polymorphic_name }}\n\n \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable!\n\n \n# Generates something like: post || video\n\n \n{{ (associations.map(&.id).join(\" || \")).id }}\n{% if !optional %} || Avram::Polymorphic.raise_missing_polymorphic(:{{ polymorphic_name }}, self){% end %}\n\n \nend\n\n def \n{{ polymorphic_name }}\n!\n \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable!\n\n \n# Generates something like: post! || video!\n\n \n{% associations_with_a_bang = associations.map(&.id).map do |assoc|\n \"#{assoc}!\"\nend %}\n\n \n{{ (associations_with_a_bang.join(\" || \")).id }}\n{% if !optional %} || Avram::Polymorphic.raise_missing_polymorphic(:{{ polymorphic_name }}, self){% end %}\n\n \nend\n\n private def \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable! : Nil\n if should_check_polymorphism_at_runtime?\n \n{% associations_to_check = associations.map(&.id).map do |assoc|\n \"#{assoc}.as(Nil)\"\nend %}\n\n \n{{ (associations_to_check.join(\" || \")).id }}\n \n# Ensure polymorphic associations are nilable\n\n \nend\n \nend\n\n \n# This is a bit of a hack to get around Crystal's smart compiler :)\n\n \n# In the ensure_\n{assoc}_belongs_to_are_nilable! we need to check that the\n\n \n# compiler *can* cast to nil, but we don't want to *actually* check it at\n\n \n# runtime. The problem is that we can't do `if false` because Crystal realizes\n\n \n# That will never match and so doesn't even check the `as(Nil)`\n\n \n# We have to trick it by extracting the false to a method. That way\n\n \n# Crystal doesn't realize it is always 'false' and will still check\n\n \n# That the types can be cast to Nil at compile, without actually casting it\n\n \n# at runtime.\n\n private def should_check_polymorphism_at_runtime? : Bool\n false\n \nend\n\n macro finished\n class SaveOperation\n \n# These validations must be run after all of the `before_save`\n\n \n# in case anyone sets their polymorphic association in a callback.\n\n \n# These are ran in the SaveOperation#valid? method\n\n default_validations do\n \n{% list_of_foreign_keys = associations.map(&.id).map do |assoc|\n \"#{assoc.id}_id\".id\nend %}\n\n\n \n# TODO: Needs to actually get the foreign key from the ASSOCIATIONS constant\n\n \n{% if optional %}\n validate_at_most_one_filled {{ (list_of_foreign_keys.map(&.id).join(\", \")).id }}\n {% else %}\n validate_exactly_one_filled {{ (list_of_foreign_keys.map(&.id).join(\", \")).id }},\n message: \"at least one '{{ polymorphic_name.id }}' must be filled\"\n {% end %}\n\n \nend\n \nend\n\n class BaseQuery\n def preload_\n{{ polymorphic_name.id }}\n\n \n{% for association in associations %}\n preload_{{ association.id }}\n {% end %}\n\n \nend\n \nend\n \nend\n \n"}}]},{"html_id":"avram/Avram/PrimaryKeyMethods","path":"Avram/PrimaryKeyMethods.html","kind":"module","full_name":"Avram::PrimaryKeyMethods","name":"PrimaryKeyMethods","abstract":false,"locations":[{"filename":"src/avram/primary_key_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/avram/primary_key_methods.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L2"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if id == other.id\nelse\n return false\nend\nif model_name == other.model_name\nelse\n return false\nend\ntrue\n"}},{"html_id":"delete-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L75"},"def":{"name":"delete","visibility":"Public","body":"self.class.database.exec(\"DELETE FROM #{@@table_name} WHERE #{primary_key_name} = #{escape_primary_key(id)}\")"}},{"html_id":"primary_key_name:Symbol|Nil-instance-method","name":"primary_key_name","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L4"},"def":{"name":"primary_key_name","return_type":"Symbol | ::Nil","visibility":"Public","body":"self.class.primary_key_name"}},{"html_id":"reload:self-instance-method","name":"reload","doc":"Reload the model with the latest information from the database\n\nThis method will return a new model instance with the\nlatest data from the database. Note that this does\n**not** change the original instance, so you may need to\nassign the result to a variable or work directly with the return value.\n\nExample:\n\n```\nuser = SaveUser.create!(name: \"Original\")\nSaveUser.update!(user, name: \"Updated\")\n\n# Will be \"Original\"\nuser.name\n# Will return \"Updated\"\nuser.reload.name # Will be \"Updated\"\n# Will still be \"Original\" since the 'user' is the same model instance.\nuser.name\n\nInstead re-assign the variable. Now 'name' will return \"Updated\" since\n'user' references the reloaded model.\nuser = user.reload\nuser.name\n```","summary":"

Reload the model with the latest information from the database

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L33"},"def":{"name":"reload","return_type":"self","visibility":"Public","body":"base_query_class.find(id)"}},{"html_id":"reload(&):self-instance-method","name":"reload","doc":"Same as `reload` but allows passing a block to customize the query.\n\nThis is almost always used to preload additional relationships.\n\nExample:\n\n```\nuser = SaveUser.create(params)\n\n# We want to display the list of articles the user has commented on, so let's #\n# preload them to avoid N+1 performance issues\nuser = user.reload(&.preload_comments(CommentQuery.new.preload_article))\n\n# Now we can safely get all the comment authors\nuser.comments.map(&.article)\n```\n\nNote that the yielded query is the `BaseQuery` so it will not have any\nmethods defined on your customized query. This is usually fine since\ntypically reload only uses preloads.\n\nIf you do need to do something more custom you can manually reload:\n\n```\nuser = SaveUser.create!(name: \"Helen\")\nUserQuery.new.some_custom_preload_method.find(user.id)\n```","summary":"

Same as #reload but allows passing a block to customize the query.

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L64"},"def":{"name":"reload","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"query = yield base_query_class.new\nquery.find(id)\n"}},{"html_id":"to_param:String-instance-method","name":"to_param","doc":"For integration with Lucky\nThis allows an `Avram::Model` to be passed into a Lucky::Action to create a url/path","summary":"

For integration with Lucky This allows an Avram::Model to be passed into a Lucky::Action to create a url/path

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_methods.cr#L71"},"def":{"name":"to_param","return_type":"String","visibility":"Public","body":"id.to_s"}}]},{"html_id":"avram/Avram/PrimaryKeyQueryable","path":"Avram/PrimaryKeyQueryable.html","kind":"module","full_name":"Avram::PrimaryKeyQueryable(T)","name":"PrimaryKeyQueryable","abstract":false,"locations":[{"filename":"src/avram/primary_key_queryable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_queryable.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/PrimaryKeyType","path":"Avram/PrimaryKeyType.html","kind":"enum","full_name":"Avram::PrimaryKeyType","name":"PrimaryKeyType","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/primary_key_type.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_type.cr#L1"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Serial","name":"Serial","value":"0"},{"id":"UUID","name":"UUID","value":"1"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"serial?-instance-method","name":"serial?","abstract":false,"location":{"filename":"src/avram/primary_key_type.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_type.cr#L2"},"def":{"name":"serial?","visibility":"Public","body":"self == Serial"}},{"html_id":"uuid?-instance-method","name":"uuid?","abstract":false,"location":{"filename":"src/avram/primary_key_type.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/primary_key_type.cr#L3"},"def":{"name":"uuid?","visibility":"Public","body":"self == UUID"}}]},{"html_id":"avram/Avram/Queryable","path":"Avram/Queryable.html","kind":"module","full_name":"Avram::Queryable(T)","name":"Queryable","abstract":false,"ancestors":[{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"}],"locations":[{"filename":"src/avram/queryable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"add_preload(&block:Array(T)->Nil)-instance-method","name":"add_preload","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":273,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L273"},"def":{"name":"add_preload","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(Array(T) -> Nil)"},"visibility":"Public","body":"@preloads << block"}},{"html_id":"any?:Bool-instance-method","name":"any?","doc":"Returns `true` if at least one of the collection's members is truthy.\n\n```\n[nil, true, 99].any? # => true\n[nil, false].any? # => false\n```","summary":"

Returns true if at least one of the collection's members is truthy.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":223,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L223"},"def":{"name":"any?","return_type":"Bool","visibility":"Public","body":"cache_store.fetch(cache_key(:\"any?\"), as: Bool) do\n queryable = clone\n new_query = (queryable.query.limit(1)).select(\"1 AS one\")\n results = database.query_one?(new_query.statement, args: new_query.args, queryable: schema_class.name, as: ( Int32 | Int64))\n !results.nil?\nend"}},{"html_id":"cache_key(operation:Symbol):String-instance-method","name":"cache_key","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":"Symbol"}],"args_string":"(operation : Symbol) : String","args_html":"(operation : Symbol) : String","location":{"filename":"src/avram/queryable.cr","line_number":285,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L285"},"def":{"name":"cache_key","args":[{"name":"operation","external_name":"operation","restriction":"Symbol"}],"return_type":"String","visibility":"Public","body":"[cache_key, operation].join(':')"}},{"html_id":"cache_key:String-instance-method","name":"cache_key","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L281"},"def":{"name":"cache_key","return_type":"String","visibility":"Public","body":"[query.statement, query.args].join(':')"}},{"html_id":"cache_store-instance-method","name":"cache_store","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":277,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L277"},"def":{"name":"cache_store","visibility":"Public","body":"Fiber.current.query_cache"}},{"html_id":"database(*args,**options)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.database(*args, **options)"}},{"html_id":"database(*args,**options,&)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.database(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"delete:Int64-instance-method","name":"delete","doc":"Delete the records using the query's where clauses, or all records if no wheres are added.\n\nReturns the number of deleted records as `Int64`.\n\n```\n# DELETE FROM users WHERE age < 21\nUserQuery.new.age.lt(21).delete\n```","summary":"

Delete the records using the query's where clauses, or all records if no wheres are added.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L104"},"def":{"name":"delete","return_type":"Int64","visibility":"Public","body":"clone.delete!"}},{"html_id":"distinct:self-instance-method","name":"distinct","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L70"},"def":{"name":"distinct","return_type":"self","visibility":"Public","body":"clone.tap do |__arg0|\n __arg0.query.distinct\nend"}},{"html_id":"distinct_on(&):self-instance-method","name":"distinct_on","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L86"},"def":{"name":"distinct_on","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_distinct_on\n"}},{"html_id":"each(&)-instance-method","name":"each","doc":"Must yield this collection's elements to the block.","summary":"

Must yield this collection's elements to the block.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":265,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L265"},"def":{"name":"each","yields":1,"block_arity":1,"visibility":"Public","body":"results.each do |result|\n yield result\nend"}},{"html_id":"exec_scalar(&)-instance-method","name":"exec_scalar","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":303,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L303"},"def":{"name":"exec_scalar","yields":1,"block_arity":1,"visibility":"Public","body":"new_query = yield query.clone\ndatabase.scalar(new_query.statement, args: new_query.args, queryable: schema_class.name)\n"}},{"html_id":"first:T-instance-method","name":"first","doc":"Returns the first element in the collection. Raises `Enumerable::EmptyError`\nif the collection is empty.\n\n```\n([1, 2, 3]).first # => 1\n([] of Int32).first # raises Enumerable::EmptyError\n```","summary":"

Returns the first element in the collection.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":206,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L206"},"def":{"name":"first","return_type":"T","visibility":"Public","body":"first? || (raise(RecordNotFoundError.new(model: table_name, query: :first)))"}},{"html_id":"first?:T|Nil-instance-method","name":"first?","doc":"Returns the first element in the collection.\nWhen the collection is empty, returns `nil`.\n\n```\n([1, 2, 3]).first? # => 1\n([] of Int32).first? # => nil\n```","summary":"

Returns the first element in the collection.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":199,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L199"},"def":{"name":"first?","return_type":"T | ::Nil","visibility":"Public","body":"(with_ordered_query.limit(1)).results.first?"}},{"html_id":"group(&):self-instance-method","name":"group","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":182,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L182"},"def":{"name":"group","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_group\n"}},{"html_id":"group_count:Hash(Array(PGValue),Int64)-instance-method","name":"group_count","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":252,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L252"},"def":{"name":"group_count","return_type":"Hash(Array(PGValue), Int64)","visibility":"Public","body":"(database.query_all((query.select_direct(query.groups + [\"COUNT(*)\"])).statement, args: query.args, queryable: schema_class.name) do |rs|\n {query.groups.map do\n rs.read(PGValue)\n end, rs.read(Int64)}\nend).to_h"}},{"html_id":"join(join_clause:Avram::Join::SqlClause):self-instance-method","name":"join","abstract":false,"args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"args_string":"(join_clause : Avram::Join::SqlClause) : self","args_html":"(join_clause : Avram::Join::SqlClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":123,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L123"},"def":{"name":"join","args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg4|\n __arg4.query.join(join_clause)\nend"}},{"html_id":"last:T-instance-method","name":"last","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":219,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L219"},"def":{"name":"last","return_type":"T","visibility":"Public","body":"last? || (raise(RecordNotFoundError.new(model: table_name, query: :last)))"}},{"html_id":"last?:T|Nil-instance-method","name":"last?","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":210,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L210"},"def":{"name":"last?","return_type":"T | ::Nil","visibility":"Public","body":"(with_ordered_query.clone.tap() do |__arg19|\n __arg19.query.reverse_order\nend.limit(1)).results.first?"}},{"html_id":"limit(amount):self-instance-method","name":"limit","abstract":false,"args":[{"name":"amount","external_name":"amount","restriction":""}],"args_string":"(amount) : self","args_html":"(amount) : self","location":{"filename":"src/avram/queryable.cr","line_number":191,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L191"},"def":{"name":"limit","args":[{"name":"amount","external_name":"amount","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg17|\n __arg17.query.limit(amount)\nend"}},{"html_id":"merge_query(query_to_merge:Avram::QueryBuilder):self-instance-method","name":"merge_query","abstract":false,"args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"args_string":"(query_to_merge : Avram::QueryBuilder) : self","args_html":"(query_to_merge : Avram::QueryBuilder) : self","location":{"filename":"src/avram/queryable.cr","line_number":156,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L156"},"def":{"name":"merge_query","args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg12|\n __arg12.query.merge(query_to_merge)\nend"}},{"html_id":"none:self-instance-method","name":"none","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":187,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L187"},"def":{"name":"none","return_type":"self","visibility":"Public","body":"clone.tap do |__arg16|\n __arg16.query.where(Avram::Where::Equal.new(\"1\", \"0\"))\nend"}},{"html_id":"none?:Bool-instance-method","name":"none?","doc":"Returns `true` if all of the elements of the collection are falsey.\n\n```\n[nil, false].none? # => true\n[nil, false, true].none? # => false\n```\n\nIt's the opposite of `all?`.","summary":"

Returns true if all of the elements of the collection are falsey.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":232,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L232"},"def":{"name":"none?","return_type":"Bool","visibility":"Public","body":"!any?"}},{"html_id":"offset(amount):self-instance-method","name":"offset","abstract":false,"args":[{"name":"amount","external_name":"amount","restriction":""}],"args_string":"(amount) : self","args_html":"(amount) : self","location":{"filename":"src/avram/queryable.cr","line_number":195,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L195"},"def":{"name":"offset","args":[{"name":"amount","external_name":"amount","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg18|\n __arg18.query.offset(amount)\nend"}},{"html_id":"or(&):self-instance-method","name":"or","doc":"Run the `or` block first to grab the last WHERE clause and set its\nconjunction to OR. Then call yield to set the next set of ORs","summary":"

Run the #or block first to grab the last WHERE clause and set its conjunction to OR.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L162"},"def":{"name":"or","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"query.or(&.itself)\nyield self\n"}},{"html_id":"order_by(column,direction):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"column","external_name":"column","restriction":""},{"name":"direction","external_name":"direction","restriction":""}],"args_string":"(column, direction) : self","args_html":"(column, direction) : self","location":{"filename":"src/avram/queryable.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L167"},"def":{"name":"order_by","args":[{"name":"column","external_name":"column","restriction":""},{"name":"direction","external_name":"direction","restriction":""}],"return_type":"self","visibility":"Public","body":"begin\n direction = Avram::OrderBy::Direction.parse(direction.to_s)\n order_by(Avram::OrderBy.new(column, direction))\nrescue e : ArgumentError\n raise(\"#{e.message}. Accepted values are: :asc, :desc\")\nend"}},{"html_id":"order_by(order:Avram::OrderByClause):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"order","external_name":"order","restriction":"Avram::OrderByClause"}],"args_string":"(order : Avram::OrderByClause) : self","args_html":"(order : Avram::OrderByClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":174,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L174"},"def":{"name":"order_by","args":[{"name":"order","external_name":"order","restriction":"Avram::OrderByClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg14|\n __arg14.query.order_by(order)\nend"}},{"html_id":"preloads-instance-method","name":"preloads","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":271,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L271"},"def":{"name":"preloads","visibility":"Public","body":"@preloads"}},{"html_id":"primary_key_name(*args,**options)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.primary_key_name(*args, **options)"}},{"html_id":"primary_key_name(*args,**options,&)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.primary_key_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query:Avram::QueryBuilder-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L4"},"def":{"name":"query","return_type":"Avram::QueryBuilder","visibility":"Public","body":"if (value = @query).nil?\n @query = (Avram::QueryBuilder.new(table: table_name).select(schema_class.column_names))\nelse\n value\nend"}},{"html_id":"query=(query:Avram::QueryBuilder)-instance-method","name":"query=","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"Avram::QueryBuilder"}],"args_string":"(query : Avram::QueryBuilder)","args_html":"(query : Avram::QueryBuilder)","location":{"filename":"src/avram/queryable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L4"},"def":{"name":"query=","args":[{"name":"query","external_name":"query","restriction":"Avram::QueryBuilder"}],"visibility":"Public","body":"@query = query"}},{"html_id":"random_order:self-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":178,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L178"},"def":{"name":"random_order","return_type":"self","visibility":"Public","body":"clone.tap do |__arg15|\n __arg15.query.random_order\nend"}},{"html_id":"reset_limit:self-instance-method","name":"reset_limit","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L78"},"def":{"name":"reset_limit","return_type":"self","visibility":"Public","body":"clone.tap do |__arg2|\n __arg2.query.limit(nil)\nend"}},{"html_id":"reset_offset:self-instance-method","name":"reset_offset","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L82"},"def":{"name":"reset_offset","return_type":"self","visibility":"Public","body":"clone.tap do |__arg3|\n __arg3.query.offset(nil)\nend"}},{"html_id":"reset_order:self-instance-method","name":"reset_order","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L74"},"def":{"name":"reset_order","return_type":"self","visibility":"Public","body":"clone.tap do |__arg1|\n __arg1.query.reset_order\nend"}},{"html_id":"reset_where(&):self-instance-method","name":"reset_where","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":91,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L91"},"def":{"name":"reset_where","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_reset_where\n"}},{"html_id":"results:Array(T)-instance-method","name":"results","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":289,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L289"},"def":{"name":"results","return_type":"Array(T)","visibility":"Public","body":"cache_store.fetch(cache_key, as: Array(T)) do\n exec_query.tap do |records|\n preloads.each(&.call(records))\n end\nend"}},{"html_id":"schema_class:T.class-instance-method","name":"schema_class","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L66"},"def":{"name":"schema_class","return_type":"T.class","visibility":"Public","body":"T"}},{"html_id":"select_count:Int64-instance-method","name":"select_count","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":236,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L236"},"def":{"name":"select_count","return_type":"Int64","visibility":"Public","body":"cache_store.fetch(cache_key(:select_count), as: Int64) do\n begin\n table = \"(#{query.statement}) AS temp\"\n new_query = (Avram::QueryBuilder.new(table)).select_count\n result = database.scalar(new_query.statement, args: query.args, queryable: schema_class.name)\n result.as(Int64)\n rescue e : DB::NoResultsError\n 0_i64\n end\nend"}},{"html_id":"table_name(*args,**options)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.table_name(*args, **options)"}},{"html_id":"table_name(*args,**options,&)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L10"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.table_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"to_prepared_sql-instance-method","name":"to_prepared_sql","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":340,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L340"},"def":{"name":"to_prepared_sql","visibility":"Public","body":"query.to_prepared_sql"}},{"html_id":"to_sql-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":336,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L336"},"def":{"name":"to_sql","visibility":"Public","body":"query.to_sql"}},{"html_id":"update:Int64-instance-method","name":"update","doc":"Update the records using the query's where clauses, or all records if no wheres are added.\n\nReturns the number of records updated as `Int64`.\n\n```\n# Update all comments with the word \"spam\" as spam\nCommentQuery.new.body.ilike(\"spam\").update(spam: true)\n```","summary":"

Update the records using the query's where clauses, or all records if no wheres are added.

","abstract":true,"location":{"filename":"src/avram/queryable.cr","line_number":121,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L121"},"def":{"name":"update","return_type":"Int64","visibility":"Public","body":""}},{"html_id":"where(column:Symbol,value):self-instance-method","name":"where","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"value","external_name":"value","restriction":""}],"args_string":"(column : Symbol, value) : self","args_html":"(column : Symbol, value) : self","location":{"filename":"src/avram/queryable.cr","line_number":127,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L127"},"def":{"name":"where","args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"value","external_name":"value","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg5|\n __arg5.query.where(Avram::Where::Equal.new(column, value.to_s))\nend"}},{"html_id":"where(sql_clause:Avram::Where::SqlClause):self-instance-method","name":"where","abstract":false,"args":[{"name":"sql_clause","external_name":"sql_clause","restriction":"Avram::Where::SqlClause"}],"args_string":"(sql_clause : Avram::Where::SqlClause) : self","args_html":"(sql_clause : Avram::Where::SqlClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":139,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L139"},"def":{"name":"where","args":[{"name":"sql_clause","external_name":"sql_clause","restriction":"Avram::Where::SqlClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg7|\n __arg7.query.where(sql_clause)\nend"}},{"html_id":"where(statement:String,*bind_vars):self-instance-method","name":"where","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"args_string":"(statement : String, *bind_vars) : self","args_html":"(statement : String, *bind_vars) : self","location":{"filename":"src/avram/queryable.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L131"},"def":{"name":"where","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"splat_index":1,"return_type":"self","visibility":"Public","body":"where(statement, args: bind_vars.to_a)"}},{"html_id":"where(statement:String,*,argsbind_vars:Array):self-instance-method","name":"where","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"args_string":"(statement : String, *, args bind_vars : Array) : self","args_html":"(statement : String, *, args bind_vars : Array) : self","location":{"filename":"src/avram/queryable.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L135"},"def":{"name":"where","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"splat_index":1,"return_type":"self","visibility":"Public","body":"clone.tap do |__arg6|\n __arg6.query.where(Avram::Where::Raw.new(statement, args: bind_vars))\nend"}},{"html_id":"where(&):self-instance-method","name":"where","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L143"},"def":{"name":"where","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"cloned = clone.tap do |__arg8|\n __arg8.query.where(Avram::Where::PrecedenceStart.new)\nend\nresult = yield cloned\nif result.query.wheres.last.is_a?(Avram::Where::PrecedenceStart)\n result.clone.tap do |__arg9|\n __arg9.query.remove_last_where\n end\nelse\n cloned = result.clone.tap do |__arg10|\n __arg10.query.clear_conjunction\n end\n cloned.clone.tap do |__arg11|\n __arg11.query.where(Avram::Where::PrecedenceEnd.new)\n end\nend\n"}}],"types":[{"html_id":"avram/Avram/Queryable/PGValue","path":"Avram/Queryable/PGValue.html","kind":"alias","full_name":"Avram::Queryable::PGValue","name":"PGValue","abstract":false,"locations":[{"filename":"src/avram/queryable.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/queryable.cr#L250"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Bool | Float32 | Float64 | Int16 | Int32 | Int64 | PG::Numeric | String | Time | UUID | Nil)","aliased_html":"Bool | Float32 | Float64 | Int16 | Int32 | Int64 | PG::Numeric | String | Time | UUID | Nil","const":false,"namespace":{"html_id":"avram/Avram/Queryable","kind":"module","full_name":"Avram::Queryable(T)","name":"Queryable"},"doc":"Remove when PG::PGValue matches rs.read possibilities","summary":"

Remove when PG::PGValue matches rs.read possibilities

"}]},{"html_id":"avram/Avram/QueryBuilder","path":"Avram/QueryBuilder.html","kind":"class","full_name":"Avram::QueryBuilder","name":"QueryBuilder","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/query_builder.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(table:String|Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"::String | ::Symbol"}],"args_string":"(table : String | Symbol)","args_html":"(table : String | Symbol)","location":{"filename":"src/avram/query_builder.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L18"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"::String | ::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:Array(String|Array(String)|Array(Int32))-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L106"},"def":{"name":"args","return_type":"Array(String | Array(String) | Array(Int32))","visibility":"Public","body":"prepared_statement_values"}},{"html_id":"args_for_update(params)-instance-method","name":"args_for_update","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""}],"args_string":"(params)","args_html":"(params)","location":{"filename":"src/avram/query_builder.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L77"},"def":{"name":"args_for_update","args":[{"name":"params","external_name":"params","restriction":""}],"visibility":"Public","body":"(param_values(params)) + prepared_statement_values"}},{"html_id":"clear_conjunction-instance-method","name":"clear_conjunction","doc":"Clears the last conjunction\ne.g. users.age = $1 AND -> users.age = $1","summary":"

Clears the last conjunction e.g.

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":334,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L334"},"def":{"name":"clear_conjunction","visibility":"Public","body":"if @wheres.empty?\nelse\n @wheres.last.conjunction = Avram::Where::Conjunction::None\nend"}},{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L2"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"delete:self-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":114,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L114"},"def":{"name":"delete","return_type":"self","visibility":"Public","body":"@delete = true\nself\n"}},{"html_id":"distinct:self-instance-method","name":"distinct","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":119,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L119"},"def":{"name":"distinct","return_type":"self","visibility":"Public","body":"@distinct = true\nself\n"}},{"html_id":"distinct?:Bool-instance-method","name":"distinct?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":129,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L129"},"def":{"name":"distinct?","return_type":"Bool","visibility":"Public","body":"@distinct || has_distinct_on?"}},{"html_id":"distinct_on(column:ColumnName):self-instance-method","name":"distinct_on","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":124,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L124"},"def":{"name":"distinct_on","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@distinct_on = column\nself\n"}},{"html_id":"distinct_on:ColumnName|Nil-instance-method","name":"distinct_on","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L6"},"def":{"name":"distinct_on","return_type":"ColumnName | Nil","visibility":"Public","body":"@distinct_on"}},{"html_id":"group_by(column:ColumnName):self-instance-method","name":"group_by","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":189,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L189"},"def":{"name":"group_by","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@groups << column\nself\n"}},{"html_id":"group_sql:String|Nil-instance-method","name":"group_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":194,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L194"},"def":{"name":"group_sql","return_type":"String | ::Nil","visibility":"Public","body":"if grouped?\n \"GROUP BY \" + (groups.join(\", \"))\nend"}},{"html_id":"grouped?:Bool-instance-method","name":"grouped?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":204,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L204"},"def":{"name":"grouped?","return_type":"Bool","visibility":"Public","body":"!@groups.empty?"}},{"html_id":"groups:Array(ColumnName)-instance-method","name":"groups","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":200,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L200"},"def":{"name":"groups","return_type":"Array(ColumnName)","visibility":"Public","body":"@groups"}},{"html_id":"has_distinct_on?:Bool-instance-method","name":"has_distinct_on?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L133"},"def":{"name":"has_distinct_on?","return_type":"Bool","visibility":"Public","body":"!(!@distinct_on)"}},{"html_id":"join(join_clause:Avram::Join::SqlClause):self-instance-method","name":"join","abstract":false,"args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"args_string":"(join_clause : Avram::Join::SqlClause) : self","args_html":"(join_clause : Avram::Join::SqlClause) : self","location":{"filename":"src/avram/query_builder.cr","line_number":302,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L302"},"def":{"name":"join","args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"return_type":"self","visibility":"Public","body":"if (join_clause.to != table) && @joins.none? do |join|\n join.to == join_clause.to\nend\n @joins << join_clause\nend\nself\n"}},{"html_id":"joins:Array(Avram::Join::SqlClause)-instance-method","name":"joins","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":309,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L309"},"def":{"name":"joins","return_type":"Array(Avram::Join::SqlClause)","visibility":"Public","body":"@joins.uniq(&.to_sql)"}},{"html_id":"limit(limit:Int32|Nil):self-instance-method","name":"limit","abstract":false,"args":[{"name":"limit","external_name":"limit","restriction":"Int32 | ::Nil"}],"args_string":"(limit : Int32 | Nil) : self","args_html":"(limit : Int32 | Nil) : self","location":{"filename":"src/avram/query_builder.cr","line_number":141,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L141"},"def":{"name":"limit","args":[{"name":"limit","external_name":"limit","restriction":"Int32 | ::Nil"}],"return_type":"self","visibility":"Public","body":"@limit = limit\nself\n"}},{"html_id":"limit:Int32|Nil-instance-method","name":"limit","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L137"},"def":{"name":"limit","return_type":"Int32 | ::Nil","visibility":"Public","body":"@limit"}},{"html_id":"merge(query_to_merge:Avram::QueryBuilder)-instance-method","name":"merge","doc":"Merges the wheres, joins, and orders from the passed in query","summary":"

Merges the wheres, joins, and orders from the passed in query

","abstract":false,"args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"args_string":"(query_to_merge : Avram::QueryBuilder)","args_html":"(query_to_merge : Avram::QueryBuilder)","location":{"filename":"src/avram/query_builder.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L39"},"def":{"name":"merge","args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"visibility":"Public","body":"query_to_merge.wheres.each do |where|\n where(where)\nend\nquery_to_merge.joins.each do |join|\n join(join)\nend\nquery_to_merge.orders.each do |order|\n order_by(order)\nend\nquery_to_merge.groups.each do |group|\n group_by(group)\nend\n"}},{"html_id":"offset(offset:Int32|Nil):self-instance-method","name":"offset","abstract":false,"args":[{"name":"offset","external_name":"offset","restriction":"Int32 | ::Nil"}],"args_string":"(offset : Int32 | Nil) : self","args_html":"(offset : Int32 | Nil) : self","location":{"filename":"src/avram/query_builder.cr","line_number":149,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L149"},"def":{"name":"offset","args":[{"name":"offset","external_name":"offset","restriction":"Int32 | ::Nil"}],"return_type":"self","visibility":"Public","body":"@offset = offset\nself\n"}},{"html_id":"offset:Int32|Nil-instance-method","name":"offset","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":145,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L145"},"def":{"name":"offset","return_type":"Int32 | ::Nil","visibility":"Public","body":"@offset"}},{"html_id":"or(&block:Avram::QueryBuilder->Avram::QueryBuilder):self-instance-method","name":"or","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":322,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L322"},"def":{"name":"or","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(Avram::QueryBuilder -> Avram::QueryBuilder)"},"return_type":"self","visibility":"Public","body":"if @wheres.empty?\n raise(Avram::InvalidQueryError.new(\"Cannot call `or` before calling a `where`\"))\nend\n@wheres.last.conjunction = Avram::Where::Conjunction::Or\nblock.call(self)\n"}},{"html_id":"order_by(order:OrderByClause):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"order","external_name":"order","restriction":"OrderByClause"}],"args_string":"(order : OrderByClause) : self","args_html":"(order : OrderByClause) : self","location":{"filename":"src/avram/query_builder.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L153"},"def":{"name":"order_by","args":[{"name":"order","external_name":"order","restriction":"OrderByClause"}],"return_type":"self","visibility":"Public","body":"if ordered_randomly?\n reset_order\nend\n@orders << order\nself\n"}},{"html_id":"order_sql:String|Nil-instance-method","name":"order_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":179,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L179"},"def":{"name":"order_sql","return_type":"String | ::Nil","visibility":"Public","body":"if ordered?\n \"ORDER BY \" + (orders.join(\", \", &.prepare))\nend"}},{"html_id":"ordered?:Bool-instance-method","name":"ordered?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":271,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L271"},"def":{"name":"ordered?","return_type":"Bool","visibility":"Public","body":"!@orders.empty?"}},{"html_id":"ordered_randomly?:Bool-instance-method","name":"ordered_randomly?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":275,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L275"},"def":{"name":"ordered_randomly?","return_type":"Bool","visibility":"Public","body":"ordered? && @orders.first.is_a?(Avram::OrderByRandom)"}},{"html_id":"orders:Array(Avram::OrderByClause)-instance-method","name":"orders","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":185,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L185"},"def":{"name":"orders","return_type":"Array(Avram::OrderByClause)","visibility":"Public","body":"@orders.uniq!(&.column)"}},{"html_id":"random_order:self-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":159,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L159"},"def":{"name":"random_order","return_type":"self","visibility":"Public","body":"reset_order\n@orders << Avram::OrderByRandom.new\nself\n"}},{"html_id":"remove_last_where-instance-method","name":"remove_last_where","doc":"Removes the last `Avram::Where` to be added","summary":"

Removes the last Avram::Where to be added

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":339,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L339"},"def":{"name":"remove_last_where","visibility":"Public","body":"@wheres.pop"}},{"html_id":"reset_order:Array(Avram::OrderByClause)-instance-method","name":"reset_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":170,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L170"},"def":{"name":"reset_order","return_type":"Array(Avram::OrderByClause)","visibility":"Public","body":"@orders.clear"}},{"html_id":"reset_where(column:ColumnName):self-instance-method","name":"reset_where","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":165,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L165"},"def":{"name":"reset_where","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@wheres.reject! do |clause|\n clause.is_a?(Avram::Where::SqlClause) && (clause.column.to_s == column.to_s)\nend\nself\n"}},{"html_id":"reverse_order:self-instance-method","name":"reverse_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":174,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L174"},"def":{"name":"reverse_order","return_type":"self","visibility":"Public","body":"if ordered_randomly?\nelse\n @orders = @orders.map(&.reversed).reverse!\nend\nself\n"}},{"html_id":"select(selection:Array(ColumnName)):self-instance-method","name":"select","abstract":false,"args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"args_string":"(selection : Array(ColumnName)) : self","args_html":"(selection : Array(ColumnName)) : self","location":{"filename":"src/avram/query_builder.cr","line_number":262,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L262"},"def":{"name":"select","args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"return_type":"self","visibility":"Public","body":"@selections = selection.join(\", \") do |column|\n \"#{@table}.#{column}\"\nend\nself\n"}},{"html_id":"select(selections:String):self-instance-method","name":"select","abstract":false,"args":[{"name":"selections","external_name":"selections","restriction":"String"}],"args_string":"(selections : String) : self","args_html":"(selections : String) : self","location":{"filename":"src/avram/query_builder.cr","line_number":267,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L267"},"def":{"name":"select","args":[{"name":"selections","external_name":"selections","restriction":"String"}],"return_type":"self","visibility":"Public","body":"@selections = selections\nself\n"}},{"html_id":"select_average(column:ColumnName):self-instance-method","name":"select_average","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":220,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L220"},"def":{"name":"select_average","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"AVG(#{column})\")"}},{"html_id":"select_count:self-instance-method","name":"select_count","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":208,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L208"},"def":{"name":"select_count","return_type":"self","visibility":"Public","body":"add_aggregate(\"COUNT(*)\")"}},{"html_id":"select_direct(selection:Array(ColumnName)):self-instance-method","name":"select_direct","abstract":false,"args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"args_string":"(selection : Array(ColumnName)) : self","args_html":"(selection : Array(ColumnName)) : self","location":{"filename":"src/avram/query_builder.cr","line_number":257,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L257"},"def":{"name":"select_direct","args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"return_type":"self","visibility":"Public","body":"@selections = selection.join(\", \")\nself\n"}},{"html_id":"select_max(column:ColumnName):self-instance-method","name":"select_max","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":216,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L216"},"def":{"name":"select_max","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"MAX(#{column})\")"}},{"html_id":"select_min(column:ColumnName):self-instance-method","name":"select_min","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":212,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L212"},"def":{"name":"select_min","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"MIN(#{column})\")"}},{"html_id":"select_sum(column:ColumnName):self-instance-method","name":"select_sum","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":224,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L224"},"def":{"name":"select_sum","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"SUM(#{column})\")"}},{"html_id":"selects:Array(String)-instance-method","name":"selects","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":251,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L251"},"def":{"name":"selects","return_type":"Array(String)","visibility":"Public","body":"(@selections.split(\", \")).map() do |__arg3|\n (__arg3.split('.')).last\nend"}},{"html_id":"statement:String-instance-method","name":"statement","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L57"},"def":{"name":"statement","return_type":"String","visibility":"Public","body":"clone.statement!"}},{"html_id":"statement!:String-instance-method","name":"statement!","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L61"},"def":{"name":"statement!","return_type":"String","visibility":"Public","body":"join_sql([@delete ? delete_sql : select_sql] + sql_condition_clauses)"}},{"html_id":"statement_for_update(params,return_columnsreturning?:Bool=true)-instance-method","name":"statement_for_update","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"args_string":"(params, return_columns returning? : Bool = true)","args_html":"(params, return_columns returning? : Bool = true)","location":{"filename":"src/avram/query_builder.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L65"},"def":{"name":"statement_for_update","args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"visibility":"Public","body":"clone.statement_for_update!(params, returning?)"}},{"html_id":"statement_for_update!(params,return_columnsreturning?:Bool=true)-instance-method","name":"statement_for_update!","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"args_string":"(params, return_columns returning? : Bool = true)","args_html":"(params, return_columns returning? : Bool = true)","location":{"filename":"src/avram/query_builder.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L69"},"def":{"name":"statement_for_update!","args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"visibility":"Public","body":"sql = [\"UPDATE #{table}\", set_sql_clause(params)]\nsql = sql + sql_condition_clauses\nif returning?\n sql = sql + [\"RETURNING #{@selections}\"]\nend\njoin_sql(sql)\n"}},{"html_id":"table:TableName-instance-method","name":"table","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L5"},"def":{"name":"table","return_type":"TableName","visibility":"Public","body":"@table"}},{"html_id":"to_prepared_sql:String-instance-method","name":"to_prepared_sql","doc":"Prepares the SQL statement by combining the `args` and `statement`\nin to a single `String`","summary":"

Prepares the SQL statement by combining the #args and #statement in to a single String

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L27"},"def":{"name":"to_prepared_sql","return_type":"String","visibility":"Public","body":"params = args.map do |arg|\n \"'#{String.new((PQ::Param.encode(arg)).slice)}'\"\nend\ni = 0\nsql = statement\nsql.scan(/\\$\\d+/) do |match|\n sql = sql.sub(match[0], params[i])\n i = i + 1\nend\nsql\n"}},{"html_id":"to_sql:Array(Array(Int32)|Array(String)|String)-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L21"},"def":{"name":"to_sql","return_type":"Array(Array(Int32) | Array(String) | String)","visibility":"Public","body":"[statement] + args"}},{"html_id":"where(where_clause:Avram::Where::Condition):self-instance-method","name":"where","abstract":false,"args":[{"name":"where_clause","external_name":"where_clause","restriction":"Avram::Where::Condition"}],"args_string":"(where_clause : Avram::Where::Condition) : self","args_html":"(where_clause : Avram::Where::Condition) : self","location":{"filename":"src/avram/query_builder.cr","line_number":317,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L317"},"def":{"name":"where","args":[{"name":"where_clause","external_name":"where_clause","restriction":"Avram::Where::Condition"}],"return_type":"self","visibility":"Public","body":"@wheres << where_clause\nself\n"}},{"html_id":"wheres:Array(Avram::Where::Condition)-instance-method","name":"wheres","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":361,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L361"},"def":{"name":"wheres","return_type":"Array(Avram::Where::Condition)","visibility":"Public","body":"@wheres"}}],"types":[{"html_id":"avram/Avram/QueryBuilder/ColumnName","path":"Avram/QueryBuilder/ColumnName.html","kind":"alias","full_name":"Avram::QueryBuilder::ColumnName","name":"ColumnName","abstract":false,"locations":[{"filename":"src/avram/query_builder.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/query_builder.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(String | Symbol)","aliased_html":"String | Symbol","const":false,"namespace":{"html_id":"avram/Avram/QueryBuilder","kind":"class","full_name":"Avram::QueryBuilder","name":"QueryBuilder"}}]},{"html_id":"avram/Avram/RecordNotFoundError","path":"Avram/RecordNotFoundError.html","kind":"class","full_name":"Avram::RecordNotFoundError","name":"RecordNotFoundError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when Avram cannot find a record by given id","summary":"

Raised when Avram cannot find a record by given id

","constructors":[{"html_id":"new(model:TableName,id:String)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"id","external_name":"id","restriction":"String"}],"args_string":"(model : TableName, id : String)","args_html":"(model : TableName, id : String)","location":{"filename":"src/avram/errors.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L31"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"id","external_name":"id","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, id)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(model:TableName,query:Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"query","external_name":"query","restriction":"Symbol"}],"args_string":"(model : TableName, query : Symbol)","args_html":"(model : TableName, query : Symbol)","location":{"filename":"src/avram/errors.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L35"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"query","external_name":"query","restriction":"Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, query)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"id:String|Nil-instance-method","name":"id","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L28"},"def":{"name":"id","return_type":"String | ::Nil","visibility":"Public","body":"@id"}},{"html_id":"model:TableName-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L27"},"def":{"name":"model","return_type":"TableName","visibility":"Public","body":"@model"}},{"html_id":"query:Symbol|Nil-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L29"},"def":{"name":"query","return_type":"Symbol | ::Nil","visibility":"Public","body":"@query"}}]},{"html_id":"avram/Avram/Rollback","path":"Avram/Rollback.html","kind":"class","full_name":"Avram::Rollback","name":"Rollback","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raise to rollback a transaction.","summary":"

Raise to rollback a transaction.

"},{"html_id":"avram/Avram/SaveOperation","path":"Avram/SaveOperation.html","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Upsert","kind":"module","full_name":"Avram::Upsert","name":"Upsert"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/MarkAsFailed","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed"},{"html_id":"avram/Avram/NestedSaveOperation","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation"},{"html_id":"avram/Avram/DatabaseValidations","kind":"module","full_name":"Avram::DatabaseValidations","name":"DatabaseValidations"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L13"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DatabaseValidations","kind":"module","full_name":"Avram::DatabaseValidations","name":"DatabaseValidations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/MarkAsFailed","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed"},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods"},{"html_id":"avram/Avram/NestedSaveOperation","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Upsert","kind":"module","full_name":"Avram::Upsert","name":"Upsert"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L44"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"T.name.underscore"}},{"html_id":"upsert(*args,**named_args)-class-method","name":"upsert","doc":"Performs a create or update depending on if there is a conflicting row in the database.\n\nSee `Avram::Upsert.upsert_lookup_columns` for full documentation and examples.","summary":"

Performs a create or update depending on if there is a conflicting row in the database.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/save_operation.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L24"},"def":{"name":"upsert","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"{% raise(\"Please use the 'upsert_lookup_columns' macro in #{@type} before using 'upsert'\") %}"}},{"html_id":"upsert!(*args,**named_args)-class-method","name":"upsert!","doc":"Performs a create or update depending on if there is a conflicting row in the database.\n\nSee `Avram::Upsert.upsert_lookup_columns` for full documentation and examples.","summary":"

Performs a create or update depending on if there is a conflicting row in the database.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/save_operation.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L24"},"def":{"name":"upsert!","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"{% raise(\"Please use the 'upsert_lookup_columns' macro in #{@type} before using 'upsert!'\") %}"}}],"constructors":[{"html_id":"new(params:Avram::Paramable)-class-method","name":"new","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/save_operation.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L48"},"def":{"name":"new","args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"visibility":"Public","body":"_ = SaveOperation(T).allocate\n_.initialize(params)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L51"},"def":{"name":"new","visibility":"Public","body":"_ = SaveOperation(T).allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"after_commit(_record:T)-instance-method","name":"after_commit","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/save_operation.cr","line_number":283,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L283"},"def":{"name":"after_commit","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"after_save(_record:T)-instance-method","name":"after_save","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/save_operation.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L281"},"def":{"name":"after_save","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"attributes-instance-method","name":"attributes","abstract":true,"location":{"filename":"src/avram/save_operation.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L42"},"def":{"name":"attributes","visibility":"Public","body":""}},{"html_id":"before_save-instance-method","name":"before_save","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":279,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L279"},"def":{"name":"before_save","visibility":"Public","body":""}},{"html_id":"changes:Hash(Symbol,String|Nil)-instance-method","name":"changes","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L193"},"def":{"name":"changes","return_type":"Hash(Symbol, String | ::Nil)","visibility":"Public","body":"attributes_to_hash(column_attributes.select(&.changed?))"}},{"html_id":"created?:Bool-instance-method","name":"created?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L133"},"def":{"name":"created?","return_type":"Bool","visibility":"Public","body":"saved? && new_record?"}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"database(*args,**options)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.database(*args, **options)"}},{"html_id":"database(*args,**options,&)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.database(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"generic_attributes:Array(Avram::GenericAttribute)-instance-method","name":"generic_attributes","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L64"},"def":{"name":"generic_attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"attributes.map do |attr|\n Avram::GenericAttribute.new(name: attr.name, param: attr.param.try(&.to_s), value: attr.value.try(&.to_s), original_value: attr.original_value.try(&.to_s), param_key: attr.param_key, errors: attr.errors)\nend"}},{"html_id":"new_record?:Bool-instance-method","name":"new_record?","doc":"`#persisted?` always returns `true` in `after_*` hooks, whether\na new record was created, or an existing one was updated.\n\nThis method should always return `true` for a create or `false`\nfor an update, independent of the stage we are at in the operation.","summary":"

#persisted? always returns true in after_* hooks, whether a new record was created, or an existing one was updated.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L263"},"def":{"name":"new_record?","return_type":"Bool","visibility":"Public","body":"({{ (T.constant(:PRIMARY_KEY_NAME)).id }}).value.nil?"}},{"html_id":"params:Avram::Paramable-instance-method","name":"params","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L39"},"def":{"name":"params","return_type":"Avram::Paramable","visibility":"Public","body":"@params"}},{"html_id":"persisted?:Bool-instance-method","name":"persisted?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":254,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L254"},"def":{"name":"persisted?","return_type":"Bool","visibility":"Public","body":"!(!record_id)"}},{"html_id":"primary_key_name(*args,**options)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.primary_key_name(*args, **options)"}},{"html_id":"primary_key_name(*args,**options,&)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.primary_key_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"run_default_validations:Nil-instance-method","name":"run_default_validations","doc":"Runs all required validations for required types\nas well as any additional valitaions the type needs to run\ne.g. polymorphic validations","summary":"

Runs all required validations for required types as well as any additional valitaions the type needs to run e.g.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":100,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L100"},"def":{"name":"run_default_validations","return_type":"Nil","visibility":"Public","body":"validate_required(*required_attributes)\ndefault_validations\n"}},{"html_id":"save:Bool-instance-method","name":"save","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":212,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L212"},"def":{"name":"save","return_type":"Bool","visibility":"Public","body":"before_save\nif valid?\n transaction_committed = database.transaction do\n if (!changes.empty?) || (!persisted?)\n insert_or_update\n end\n after_save(record.as(T))\n true\n end\n if transaction_committed\n self.save_status = OperationStatus::Saved\n after_commit(record.as(T))\n Avram::Events::SaveSuccessEvent.publish(operation_class: self.class.name, attributes: generic_attributes)\n true\n else\n mark_as_failed\n publish_save_failed_event\n false\n end\nelse\n mark_as_failed\n publish_save_failed_event\n false\nend\n"}},{"html_id":"save!:T-instance-method","name":"save!","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":242,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L242"},"def":{"name":"save!","return_type":"T","visibility":"Public","body":"if save\n record.as(T)\nelse\n raise(Avram::InvalidOperationError.new(operation: self))\nend"}},{"html_id":"save_failed?:Bool-instance-method","name":"save_failed?","doc":"Return true if the operation has run and the record failed to save","summary":"

Return true if the operation has run and the record failed to save

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L142"},"def":{"name":"save_failed?","return_type":"Bool","visibility":"Public","body":"save_status == OperationStatus::SaveFailed"}},{"html_id":"save_status:OperationStatus-instance-method","name":"save_status","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L40"},"def":{"name":"save_status","return_type":"OperationStatus","visibility":"Public","body":"@save_status"}},{"html_id":"save_status=(save_status:OperationStatus)-instance-method","name":"save_status=","abstract":false,"args":[{"name":"save_status","external_name":"save_status","restriction":"OperationStatus"}],"args_string":"(save_status : OperationStatus)","args_html":"(save_status : OperationStatus)","location":{"filename":"src/avram/save_operation.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L40"},"def":{"name":"save_status=","args":[{"name":"save_status","external_name":"save_status","restriction":"OperationStatus"}],"visibility":"Public","body":"@save_status = save_status"}},{"html_id":"saved?:Bool-instance-method","name":"saved?","doc":"Returns true if the operation has run and saved the record successfully","summary":"

Returns true if the operation has run and saved the record successfully

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":129,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L129"},"def":{"name":"saved?","return_type":"Bool","visibility":"Public","body":"save_status == OperationStatus::Saved"}},{"html_id":"table_name(*args,**options)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.table_name(*args, **options)"}},{"html_id":"table_name(*args,**options,&)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L55"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.table_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"update!:T-instance-method","name":"update!","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L250"},"def":{"name":"update!","return_type":"T","visibility":"Public","body":"save!"}},{"html_id":"updated?:Bool-instance-method","name":"updated?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L137"},"def":{"name":"updated?","return_type":"Bool","visibility":"Public","body":"saved? && (!new_record?)"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Runs required validation,\nthen returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Runs required validation, then returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":120,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L120"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"run_default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"add_cast_value_methods(columns)-macro","name":"add_cast_value_methods","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""}],"args_string":"(columns)","args_html":"(columns)","location":{"filename":"src/avram/save_operation.cr","line_number":197,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L197"},"def":{"name":"add_cast_value_methods","args":[{"name":"columns","external_name":"columns","restriction":""}],"visibility":"Public","body":" private def cast_value(value : Nil)\n nil\n \nend\n\n \n{% for column in columns %}\n # pass `value` to it's `Lucky.to_db` for parsing.\n # In most cases, that's just calling `to_s`, but in the case of an Array,\n # `value` is passed to `PQ::Param` to properly encode `[true]` to `{t}`, etc...\n private def cast_value(value : {{ column[:type] }})\n value.class.adapter.to_db(value.as({{ column[:type] }}))\n end\n {% end %}\n\n \n"}},{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}},{"html_id":"permit_columns(*attribute_names)-macro","name":"permit_columns","abstract":false,"args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"args_string":"(*attribute_names)","args_html":"(*attribute_names)","location":{"filename":"src/avram/save_operation.cr","line_number":146,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L146"},"def":{"name":"permit_columns","args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"splat_index":0,"visibility":"Public","body":" \n{% for attribute_name in attribute_names %}\n {% if attribute_name.is_a?(TypeDeclaration) %}\n {% raise(\"Must use a Symbol or a bare word in 'permit_columns'. Instead, got: #{attribute_name}\\n\\nTry this...\\n\\n ▸ permit_columns #{attribute_name.var}\\n\") %}\n {% end %}\n {% if attribute_name.is_a?(SymbolLiteral) || attribute_name.is_a?(Call) %}{% else %}\n {% raise(\"Must use a Symbol or a bare word in 'permit_columns'. Instead, got: #{attribute_name}\\n\\nTry this...\\n\\n ▸ Use a bare word (recommended): 'permit_columns name'\\n ▸ Use a Symbol: 'permit_columns :name'\\n\") %}\n {% end %}\n {% if COLUMN_ATTRIBUTES.any? do |attribute|\n attribute[:name].id == attribute_name.id\nend %}\n def {{ attribute_name.id }}\n _{{ attribute_name.id }}.permitted\n end\n\n @@permitted_param_keys << \"{{ attribute_name.id }}\"\n {% else %}\n {% raise(\"Can't permit '#{attribute_name}' because the column has not been defined on the model for #{@type}.\\n\\nTry this...\\n\\n ▸ Make sure you spelled the column correctly.\\n ▸ Add the column to the model if it doesn't exist.\\n ▸ Use 'attribute' if you want an attribute that is not saved to the database.\\n\") %}\n {% end %}\n {% end %}\n\n \n"}},{"html_id":"skip_default_validations-macro","name":"skip_default_validations","doc":"This allows you to skip the default validations\nwhich may be used as an escape hatch when you want\nto allow storing an empty string value.","summary":"

This allows you to skip the default validations which may be used as an escape hatch when you want to allow storing an empty string value.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":112,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L112"},"def":{"name":"skip_default_validations","visibility":"Public","body":" def run_default_validations\n \nend\n \n"}}],"types":[{"html_id":"avram/Avram/SaveOperation/OperationStatus","path":"Avram/SaveOperation/OperationStatus.html","kind":"enum","full_name":"Avram::SaveOperation::OperationStatus","name":"OperationStatus","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L27"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Saved","name":"Saved","value":"0"},{"id":"SaveFailed","name":"SaveFailed","value":"1"},{"id":"Unperformed","name":"Unperformed","value":"2"}],"namespace":{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"},"instance_methods":[{"html_id":"save_failed?-instance-method","name":"save_failed?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L29"},"def":{"name":"save_failed?","visibility":"Public","body":"self == SaveFailed"}},{"html_id":"saved?-instance-method","name":"saved?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L28"},"def":{"name":"saved?","visibility":"Public","body":"self == Saved"}},{"html_id":"unperformed?-instance-method","name":"unperformed?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation.cr#L30"},"def":{"name":"unperformed?","visibility":"Public","body":"self == Unperformed"}}]}]},{"html_id":"avram/Avram/SaveOperationTemplate","path":"Avram/SaveOperationTemplate.html","kind":"class","full_name":"Avram::SaveOperationTemplate","name":"SaveOperationTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, *args, **named_args)","args_html":"(type, columns, *args, **named_args)","location":{"filename":"src/avram/save_operation_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/save_operation_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":2,"visibility":"Public","body":" \n# This makes it easy for plugins and extensions to use the base SaveOperation\n\n def base_query_class : ::\n{{ type }}\n::BaseQuery.class\n ::\n{{ type }}\n::BaseQuery\n \nend\n\n def save_operation_class : ::\n{{ type }}\n::SaveOperation.class\n ::\n{{ type }}\n::SaveOperation\n \nend\n\n class ::\n{{ type }}\n::SaveOperation < Avram::SaveOperation(\n{{ type }}\n)\n \n{% primary_key_type = type.resolve.constant(\"PRIMARY_KEY_TYPE\") %}\n\n\n macro inherited\n FOREIGN_KEY = \"\n{{ type.stringify.underscore.id }}\n_id\"\n \nend\n\n add_column_attributes(\n{{ columns }}\n)\n add_cast_value_methods(\n{{ columns }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/SchemaEnforcer","path":"Avram/SchemaEnforcer.html","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer","abstract":false,"locations":[{"filename":"src/avram/schema_enforcer.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer.cr#L4"},{"filename":"src/avram/schema_enforcer/validation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/validation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ALL_MODELS","name":"ALL_MODELS","value":"[] of Avram::Model.class"},{"id":"MODELS_TO_SKIP","name":"MODELS_TO_SKIP","value":"[] of String"}],"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"ensure_correct_column_mappings!-class-method","name":"ensure_correct_column_mappings!","abstract":false,"location":{"filename":"src/avram/schema_enforcer.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer.cr#L22"},"def":{"name":"ensure_correct_column_mappings!","visibility":"Public","body":"{% if !ALL_MODELS.empty? %}\n ALL_MODELS.each do |model|\n model.ensure_correct_column_mappings!\n end\n {% end %}"}}],"macros":[{"html_id":"setup(type,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/schema_enforcer.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer.cr#L8"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" class_getter schema_enforcer_validations = [] of Avram::SchemaEnforcer::Validation\n\n def self.ensure_correct_column_mappings!\n return if Avram::SchemaEnforcer::MODELS_TO_SKIP.includes?(self.name)\n\n schema_enforcer_validations.each(&.validate!)\n \nend\n\n \n{% if !type.resolve.abstract? %}\n {% Avram::SchemaEnforcer::ALL_MODELS << type %}\n {% end %}\n\n \n"}},{"html_id":"skip_schema_enforcer-macro","name":"skip_schema_enforcer","abstract":false,"location":{"filename":"src/avram/schema_enforcer.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer.cr#L30"},"def":{"name":"skip_schema_enforcer","visibility":"Public","body":" \n{% Avram::SchemaEnforcer::MODELS_TO_SKIP << @type.stringify %}\n\n \n"}}],"types":[{"html_id":"avram/Avram/SchemaEnforcer/EnsureExistingTable","path":"Avram/SchemaEnforcer/EnsureExistingTable.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureExistingTable","name":"EnsureExistingTable","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_existing_table.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_existing_table.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_existing_table.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_existing_table.cr#L2"},"def":{"name":"validate!","visibility":"Public","body":"if table_missing?\n best_match = Levenshtein::Finder.find(table_name, database_info.table_names, tolerance: 2)\n message = String.build do |string|\n string << \"#{model_class.name.colorize.bold} wants to use the '#{table_name.colorize.bold}' table but it is missing.\\n\"\n if best_match\n string << \"\\nIf you meant for #{model_class.name.colorize.bold} to use the '#{best_match.colorize.yellow.bold}' table, try this...\\n\\n ▸ Change the table name in #{model_class.name.colorize.bold}:\\n\\n table :#{best_match.colorize.bold} do\\n # ..columns\\n end\\n\"\n end\n string << \"\\nIf you need to create the '#{table_name}' table...\\n\\n ▸ Generate a migration:\\n\\n lucky gen.migration Create#{Wordsmith::Inflector.pluralize(model_class.name)}\\n\\n ▸ Create the table in the migration:\\n\\n create table_for(#{model_class.name}) do/end\\n\"\n string << \"\\nOr, you can skip schema checks for this model:\\n\\n class #{model_class.name} < BaseModel\\n # Great for models used in migrations, or for legacy schemas\\n skip_schema_enforcer\\n end\\n\\n\"\n end\n raise(Avram::SchemaMismatchError.new(message))\nend"}}]},{"html_id":"avram/Avram/SchemaEnforcer/EnsureMatchingColumns","path":"Avram/SchemaEnforcer/EnsureMatchingColumns.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureMatchingColumns","name":"EnsureMatchingColumns","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_matching_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"constructors":[{"html_id":"new(model_class,check_required:Bool)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":""},{"name":"check_required","external_name":"check_required","restriction":"::Bool"}],"args_string":"(model_class, check_required : Bool)","args_html":"(model_class, check_required : Bool)","location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_matching_columns.cr#L11"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":""},{"name":"check_required","external_name":"check_required","restriction":"::Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class, check_required)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(model_class)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":""}],"args_string":"(model_class)","args_html":"(model_class)","location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_matching_columns.cr#L7"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_matching_columns.cr#L14"},"def":{"name":"validate!","visibility":"Public","body":"model_class.columns.each do |attribute|\n check_column_matches(attribute)\nend\nif matching_error?\n message = (@missing_columns + @optional_attribute_errors) + @required_attribute_errors\n raise(Avram::SchemaMismatchError.new(message.join(\"\\n\\n\")))\nend\n"}}]},{"html_id":"avram/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault","path":"Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureUUIDPrimaryKeyHasDefault","name":"EnsureUUIDPrimaryKeyHasDefault","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"instance_methods":[{"html_id":"has_primary_key?:Bool-instance-method","name":"has_primary_key?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L25"},"def":{"name":"has_primary_key?","return_type":"Bool","visibility":"Public","body":"!model_class.primary_key_name.nil?"}},{"html_id":"missing_column_default?:Bool-instance-method","name":"missing_column_default?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L33"},"def":{"name":"missing_column_default?","return_type":"Bool","visibility":"Public","body":"primary_key_info.column_default.nil?"}},{"html_id":"primary_key_info:Avram::Database::ColumnInfo-instance-method","name":"primary_key_info","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L37"},"def":{"name":"primary_key_info","return_type":"Avram::Database::ColumnInfo","visibility":"Public","body":"pkey_name = model_class.primary_key_name.to_s\n(table_info.column(pkey_name)).as(Avram::Database::ColumnInfo)\n"}},{"html_id":"uuid_primary_key?:Bool-instance-method","name":"uuid_primary_key?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L29"},"def":{"name":"uuid_primary_key?","return_type":"Bool","visibility":"Public","body":"primary_key_info.data_type == \"uuid\""}},{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L2"},"def":{"name":"validate!","visibility":"Public","body":"if (has_primary_key? && uuid_primary_key?) && missing_column_default?\nelse\n return\nend\nmessage = \"Primary key on the '#{table_name.colorize.bold}' table has the type set as uuid but does not have a default value.\\n\\nTo add a default value...\\n\\n ▸ Generate a migration:\\n\\n lucky gen.migration AddDefaultTo#{Wordsmith::Inflector.pluralize(model_class.name)}PrimaryKey\\n\\n ▸ Enable a Postgres extension to generate uuids if one is not already available in the migration:\\n\\n enable_extension \\\"pgcrypto\\\" # https://www.postgresql.org/docs/current/pgcrypto.html\\n\\n ▸ Update the primary key column to have a default value in the migration:\\n\\n execute(\\\"ALTER TABLE #{table_name.colorize.bold} ALTER COLUMN #{primary_key_info.column_name.colorize.bold} SET DEFAULT gen_random_uuid();\\\")\"\nraise(Avram::SchemaMismatchError.new(message))\n"}}]},{"html_id":"avram/Avram/SchemaEnforcer/Validation","path":"Avram/SchemaEnforcer/Validation.html","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/validation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/validation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/SchemaEnforcer/EnsureExistingTable","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureExistingTable","name":"EnsureExistingTable"},{"html_id":"avram/Avram/SchemaEnforcer/EnsureMatchingColumns","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureMatchingColumns","name":"EnsureMatchingColumns"},{"html_id":"avram/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureUUIDPrimaryKeyHasDefault","name":"EnsureUUIDPrimaryKeyHasDefault"}],"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"constructors":[{"html_id":"new(model_class:::Avram::Model.class)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":"::Avram::Model.class"}],"args_string":"(model_class : ::Avram::Model.class)","args_html":"(model_class : ::Avram::Model.class)","location":{"filename":"src/avram/schema_enforcer/validation.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/validation.cr#L4"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":"::Avram::Model.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":true,"location":{"filename":"src/avram/schema_enforcer/validation.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/schema_enforcer/validation.cr#L7"},"def":{"name":"validate!","visibility":"Public","body":""}}]}]},{"html_id":"avram/Avram/SchemaMismatchError","path":"Avram/SchemaMismatchError.html","kind":"class","full_name":"Avram::SchemaMismatchError","name":"SchemaMismatchError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L11"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised by Avram::SchemaEnforcer when columns or tables don't match the database.","summary":"

Raised by Avram::SchemaEnforcer when columns or tables don't match the database.

"},{"html_id":"avram/Avram/Slugify","path":"Avram/Slugify.html","kind":"module","full_name":"Avram::Slugify","name":"Slugify","abstract":false,"locations":[{"filename":"src/avram/slugify.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"extended_modules":[{"html_id":"avram/Avram/Slugify","kind":"module","full_name":"Avram::Slugify","name":"Slugify"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Converts a column value to a URL safe String that\ncan be used as a parameter for finding records. A\n`slug` is a `String` column you define on your model\nthat will be passed through the URL instead of an `id`.\n\ne.g. /articles/1 -> /articles/how-to-slugify\n\nUse this module in your `SaveOperation#before_save`.\n\n```\nclass Article < BaseModel\n table do\n column title : String\n column slug : String\n end\nend\n\nclass SaveArticle < Article::SaveOperation\n before_save do\n Avram::Slugify.set slug,\n using: title,\n query: ArticleQuery.new\n end\nend\n```\n\nThe `set` method will use `query` to determine if that `slug` has already\nbeen used, and fall back to appending a random UUID to the end. If the `slug`\nvalue has already been set, then no new slug will be generated. If you just need\nthe value to set on your own, you can use the `generate` method as an escape hatch.\nThis method returns the String value used in the `set` method.\n\n```\nclass SaveArticle < Article::SaveOperation\n before_save do\n if title.changed?\n slug_value = Avram::Slugify.generate(slug,\n using: title,\n query: ArticleQuery.new)\n slug.value = slug_value\n end\n end\nend\n```","summary":"

Converts a column value to a URL safe String that can be used as a parameter for finding records.

","instance_methods":[{"html_id":"generate(slug:Avram::Attribute(String),usingslug_candidate:Avram::Attribute(String)|String,query:Avram::Queryable):String|Nil-instance-method","name":"generate","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : String | Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : String | Nil","location":{"filename":"src/avram/slugify.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L62"},"def":{"name":"generate","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"String | ::Nil","visibility":"Public","body":"generate(slug, [slug_candidate], query)"}},{"html_id":"generate(slug:Avram::Attribute(String),usingslug_candidates:Array(String|Avram::Attribute(String)|Array(Avram::Attribute(String))),query:Avram::Queryable):String|Nil-instance-method","name":"generate","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : String | Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : String | Nil","location":{"filename":"src/avram/slugify.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L68"},"def":{"name":"generate","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"String | ::Nil","visibility":"Public","body":"slug_candidates = format_candidates(slug_candidates)\nresult = slug_candidates.find do |candidate|\n (query.where(slug.name, candidate)).none?\nend\nif result\n result\nelse\n if candidate = slug_candidates.first?\n \"#{candidate}-#{UUID.random}\"\n end\nend\n"}},{"html_id":"set(slug:Avram::Attribute(String),usingslug_candidate:Avram::Attribute(String)|String,query:Avram::Queryable):Nil-instance-method","name":"set","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : Nil","location":{"filename":"src/avram/slugify.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L48"},"def":{"name":"set","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"Nil","visibility":"Public","body":"set(slug, [slug_candidate], query)"}},{"html_id":"set(slug:Avram::Attribute(String),usingslug_candidates:Array(String|Avram::Attribute(String)|Array(Avram::Attribute(String))),query:Avram::Queryable):Nil-instance-method","name":"set","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : Nil","location":{"filename":"src/avram/slugify.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/slugify.cr#L54"},"def":{"name":"set","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"Nil","visibility":"Public","body":"if slug.value.blank?\n slug.value = generate(slug, slug_candidates, query)\nend"}}]},{"html_id":"avram/Avram/SoftDelete","path":"Avram/SoftDelete.html","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete","abstract":false,"locations":[{"filename":"src/avram/soft_delete/model.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/SoftDelete/Model","path":"Avram/SoftDelete/Model.html","kind":"module","full_name":"Avram::SoftDelete::Model","name":"Model","abstract":false,"locations":[{"filename":"src/avram/soft_delete/model.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SoftDelete","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete"},"doc":" table do\n column soft_deleted_at : Time?\n end\nend\n```\n\nYou should also add the `Avram::SoftDeleteQuery` to your query\n\n```\nclass ArticleQuery < Article::BaseQuery\n include Avram::SoftDelete::Query\nend\n```","summary":"

table do column soft_deleted_at : Time? end end ```

","instance_methods":[{"html_id":"restore:self-instance-method","name":"restore","doc":"Restore the record\n\nThis will set `soft_deleted_at` to `nil`","summary":"

Restore the record

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L38"},"def":{"name":"restore","return_type":"self","visibility":"Public","body":"save_operation_class.update!(self, soft_deleted_at: nil)"}},{"html_id":"save_operation_class-instance-method","name":"save_operation_class","abstract":true,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L42"},"def":{"name":"save_operation_class","visibility":"Public","body":""}},{"html_id":"soft_delete:self-instance-method","name":"soft_delete","doc":"Soft delete the record\n\nThis will set `soft_deleted_at` to the current time (`Time.utc`)","summary":"

Soft delete the record

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L31"},"def":{"name":"soft_delete","return_type":"self","visibility":"Public","body":"save_operation_class.update!(self, soft_deleted_at: Time.utc)"}},{"html_id":"soft_deleted?:Bool-instance-method","name":"soft_deleted?","doc":"Returns true if soft deleted, otherwise false\n\nIf the `soft_deleted_at` has a time value the record is \"soft deleted\".\nIf `soft_deleted_at` is `nil` the record has not been deleted yet.","summary":"

Returns true if soft deleted, otherwise false

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L48"},"def":{"name":"soft_deleted?","return_type":"Bool","visibility":"Public","body":"soft_deleted_at.present?"}},{"html_id":"soft_deleted_at:Time|Nil-instance-method","name":"soft_deleted_at","abstract":true,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/model.cr#L52"},"def":{"name":"soft_deleted_at","return_type":"Time | ::Nil","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/SoftDelete/Query","path":"Avram/SoftDelete/Query.html","kind":"module","full_name":"Avram::SoftDelete::Query","name":"Query","abstract":false,"locations":[{"filename":"src/avram/soft_delete/query.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L12"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SoftDelete","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete"},"doc":"Add methods for querying/updating soft deleted and kept records.\n\nFirst include the model module in your model: `Avram::SoftDelete::Model`\n\nThen add this module your query\n\n```\nclass ArticleQuery < Article::BaseQuery\n include Avram::SoftDelete::Query\nend\n```","summary":"

Add methods for querying/updating soft deleted and kept records.

","instance_methods":[{"html_id":"only_kept-instance-method","name":"only_kept","doc":"Only return kept records\n\nKept records are considered \"kept/not soft deleted\" if the\n`soft_deleted_at` column is `nil`","summary":"

Only return kept records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L17"},"def":{"name":"only_kept","visibility":"Public","body":"reset_where(&.soft_deleted_at).soft_deleted_at.is_nil"}},{"html_id":"only_soft_deleted-instance-method","name":"only_soft_deleted","doc":"Only return soft deleted records\n\nSoft deleted records are considered \"soft deleted\" if the\n`soft_deleted_at` column has a non-nil value","summary":"

Only return soft deleted records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L25"},"def":{"name":"only_soft_deleted","visibility":"Public","body":"reset_where(&.soft_deleted_at).soft_deleted_at.is_not_nil"}},{"html_id":"restore:Int64-instance-method","name":"restore","doc":"Bulk restore records\n\n## Example\n\nThis will restore `Article` records updated in the last week:\n\n```\nArticleQuery.new.updated_at.gt(1.week.ago).restore\n```","summary":"

Bulk restore records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L60"},"def":{"name":"restore","return_type":"Int64","visibility":"Public","body":"only_soft_deleted.update(soft_deleted_at: nil)"}},{"html_id":"soft_delete-instance-method","name":"soft_delete","doc":"Bulk soft delete records\n\n## Example\n\nThis will soft delete all `Article` record older than 1 year:\n\n```\nArticleQuery.new.created_at.lt(1.year.ago).soft_delete\n```","summary":"

Bulk soft delete records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L47"},"def":{"name":"soft_delete","visibility":"Public","body":"only_kept.update(soft_deleted_at: Time.utc)"}},{"html_id":"soft_deleted_at-instance-method","name":"soft_deleted_at","abstract":true,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L64"},"def":{"name":"soft_deleted_at","visibility":"Public","body":""}},{"html_id":"with_soft_deleted-instance-method","name":"with_soft_deleted","doc":"Returns all records\n\nThis works be removing where clauses for the `soft_deleted_at` column.\nThat means you can do `MyQuery.new.only_kept.with_soft_deleted` and you\nwill get all records, not just the kept ones.","summary":"

Returns all records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/soft_delete/query.cr#L34"},"def":{"name":"with_soft_deleted","visibility":"Public","body":"reset_where(&.soft_deleted_at)"}}]}]},{"html_id":"avram/Avram/SpecHelper","path":"Avram/SpecHelper.html","kind":"module","full_name":"Avram::SpecHelper","name":"SpecHelper","abstract":false,"locations":[{"filename":"src/avram/spec_helper.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/spec_helper.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"NO_CASCADE","name":"NO_CASCADE","value":"\"no_cascade\""},{"id":"NO_RESTART_IDENTITY","name":"NO_RESTART_IDENTITY","value":"\"no_restart_identity\""},{"id":"TRUNCATE","name":"TRUNCATE","value":"\"truncate\""}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"wrap_spec_in_transaction(spec:Spec::Example::Procsy,*databases)-class-method","name":"wrap_spec_in_transaction","abstract":false,"args":[{"name":"spec","external_name":"spec","restriction":"Spec::Example::Procsy"},{"name":"databases","external_name":"databases","restriction":""}],"args_string":"(spec : Spec::Example::Procsy, *databases)","args_html":"(spec : Spec::Example::Procsy, *databases)","location":{"filename":"src/avram/spec_helper.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/spec_helper.cr#L12"},"def":{"name":"wrap_spec_in_transaction","args":[{"name":"spec","external_name":"spec","restriction":"Spec::Example::Procsy"},{"name":"databases","external_name":"databases","restriction":""}],"splat_index":1,"visibility":"Public","body":"if named_args = use_truncation?(spec)\n spec.run\n return databases.each(&.truncate(**named_args))\nend\ntracked_transactions = [] of DB::Transaction\ndatabases.each do |database|\n database.lock_id = Fiber.current.object_id\n database.connections.values.each do |conn|\n tracked_transactions << conn.begin_transaction.tap(&._avram_joinable = false)\n end\n database.setup_connection do |conn|\n tracked_transactions << conn.begin_transaction.tap(&._avram_joinable = false)\n end\nend\nspec.run\ntracked_transactions.each do |transaction|\n if transaction.closed? || transaction.connection.closed?\n next\n end\n transaction.rollback\n transaction.connection.release\nend\ntracked_transactions.clear\ndatabases.each do |database|\n database.connections.clear\n database.setup_connection do\n end\nend\n"}}],"macros":[{"html_id":"use_transactional_specs(*databases)-macro","name":"use_transactional_specs","abstract":false,"args":[{"name":"databases","external_name":"databases","restriction":""}],"args_string":"(*databases)","args_html":"(*databases)","location":{"filename":"src/avram/spec_helper.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/spec_helper.cr#L6"},"def":{"name":"use_transactional_specs","args":[{"name":"databases","external_name":"databases","restriction":""}],"splat_index":0,"visibility":"Public","body":" Spec.around_each do |spec|\n Avram::SpecHelper.wrap_spec_in_transaction(spec, \n{{ databases.splat }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/TableFor","path":"Avram/TableFor.html","kind":"module","full_name":"Avram::TableFor","name":"TableFor","abstract":false,"locations":[{"filename":"src/avram/table_for.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/table_for.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"table_for(model)-macro","name":"table_for","doc":"Returns a `Symbol` representing the table name\nof the `model` passed in.\ne.g. `User` => `:users`","summary":"

Returns a Symbol representing the table name of the model passed in.

","abstract":false,"args":[{"name":"model","external_name":"model","restriction":""}],"args_string":"(model)","args_html":"(model)","location":{"filename":"src/avram/table_for.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/table_for.cr#L5"},"def":{"name":"table_for","args":[{"name":"model","external_name":"model","restriction":""}],"visibility":"Public","body":" Wordsmith::Inflector.pluralize(\n{{ model.stringify }}\n.gsub(\"::\", \"\").underscore)\n \n"}}]},{"html_id":"avram/Avram/TableName","path":"Avram/TableName.html","kind":"alias","full_name":"Avram::TableName","name":"TableName","abstract":false,"locations":[{"filename":"src/avram.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram.cr#L39"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(String | Symbol)","aliased_html":"String | Symbol","const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Type","path":"Avram/Type.html","kind":"module","full_name":"Avram::Type","name":"Type","abstract":false,"locations":[{"filename":"src/avram/type.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Uploadable/Lucky","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky"},{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"},{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"},{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"},{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"},{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"},{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"},{"html_id":"avram/JSON/Any/Lucky","kind":"module","full_name":"JSON::Any::Lucky","name":"Lucky"},{"html_id":"avram/JSON/Serializable/Lucky","kind":"module","full_name":"JSON::Serializable::Lucky(T)","name":"Lucky"},{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"},{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"},{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"},{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"from_db!(value)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L6"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"parse!(value)"}},{"html_id":"parse(value:Nil)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Nil"}],"args_string":"(value : Nil)","args_html":"(value : Nil)","location":{"filename":"src/avram/type.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L10"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Nil"}],"visibility":"Public","body":"SuccessfulCast(Nil).new(nil)"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/type.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L14"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"casts = values.map do |value|\n parse(value)\nend\nif casts.all?(SuccessfulCast)\n values = casts.map do |c|\n (c.as(SuccessfulCast)).value\n end\n parse(values)\nelse\n FailedCast.new\nend\n"}},{"html_id":"parse!(value)-instance-method","name":"parse!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L24"},"def":{"name":"parse!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"((parse(value)).as(SuccessfulCast)).value"}},{"html_id":"to_db(value:Nil)-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Nil"}],"args_string":"(value : Nil)","args_html":"(value : Nil)","location":{"filename":"src/avram/type.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L28"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Nil"}],"visibility":"Public","body":"nil"}},{"html_id":"to_db!(value)-instance-method","name":"to_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L32"},"def":{"name":"to_db!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"parsed_value = parse!(value)\nto_db(parsed_value)\n"}}],"types":[{"html_id":"avram/Avram/Type/FailedCast","path":"Avram/Type/FailedCast.html","kind":"class","full_name":"Avram::Type::FailedCast","name":"FailedCast","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/type.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L44"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"},"instance_methods":[{"html_id":"value-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/type.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L45"},"def":{"name":"value","visibility":"Public","body":"nil"}}]},{"html_id":"avram/Avram/Type/SuccessfulCast","path":"Avram/Type/SuccessfulCast.html","kind":"class","full_name":"Avram::Type::SuccessfulCast(T)","name":"SuccessfulCast","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/type.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L37"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"},"constructors":[{"html_id":"new(value:T)-class-method","name":"new","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T)","args_html":"(value : T)","location":{"filename":"src/avram/type.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L40"},"def":{"name":"new","args":[{"name":"value","external_name":"value","restriction":"T"}],"visibility":"Public","body":"_ = SuccessfulCast(T).allocate\n_.initialize(value)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"value-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/type.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/type.cr#L38"},"def":{"name":"value","visibility":"Public","body":"@value"}}]}]},{"html_id":"avram/Avram/UnsupportedQueryError","path":"Avram/UnsupportedQueryError.html","kind":"class","full_name":"Avram::UnsupportedQueryError","name":"UnsupportedQueryError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":76,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L76"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when an unimplemented or deprecated query is made.","summary":"

Raised when an unimplemented or deprecated query is made.

","constructors":[{"html_id":"new(message:String)-class-method","name":"new","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(message : String)","args_html":"(message : String)","location":{"filename":"src/avram/errors.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/errors.cr#L77"},"def":{"name":"new","args":[{"name":"message","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Uploadable","path":"Avram/Uploadable.html","kind":"module","full_name":"Avram::Uploadable","name":"Uploadable","abstract":false,"locations":[{"filename":"src/avram/uploadable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Lucky/UploadedFile","kind":"class","full_name":"Lucky::UploadedFile","name":"UploadedFile"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/uploadable.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L9"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","doc":"This should test if the filename is a blank string.","summary":"

This should test if the filename is a blank string.

","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L7"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":""}},{"html_id":"filename:String-instance-method","name":"filename","doc":"Typically, this should return the filename as found in the `metadata`.","summary":"

Typically, this should return the filename as found in the #metadata.

","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L5"},"def":{"name":"filename","return_type":"String","visibility":"Public","body":""}},{"html_id":"metadata:HTTP::FormData::FileMetadata-instance-method","name":"metadata","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L3"},"def":{"name":"metadata","return_type":"HTTP::FormData::FileMetadata","visibility":"Public","body":""}},{"html_id":"tempfile:File-instance-method","name":"tempfile","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L2"},"def":{"name":"tempfile","return_type":"File","visibility":"Public","body":""}}],"types":[{"html_id":"avram/Avram/Uploadable/Lucky","path":"Avram/Uploadable/Lucky.html","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/uploadable.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L13"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Avram/Uploadable/Lucky","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Avram/Uploadable","kind":"module","full_name":"Avram::Uploadable","name":"Uploadable"},"instance_methods":[{"html_id":"parse(value:Avram::Uploadable)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::Uploadable"}],"args_string":"(value : Avram::Uploadable)","args_html":"(value : Avram::Uploadable)","location":{"filename":"src/avram/uploadable.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L16"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Avram::Uploadable"}],"visibility":"Public","body":"SuccessfulCast(Avram::Uploadable).new(value)"}},{"html_id":"parse(values:Array(Avram::Uploadable))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Avram::Uploadable)"}],"args_string":"(values : Array(Avram::Uploadable))","args_html":"(values : Array(Avram::Uploadable))","location":{"filename":"src/avram/uploadable.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L20"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Avram::Uploadable)"}],"visibility":"Public","body":"SuccessfulCast.new(values)"}},{"html_id":"parse(value:String|Nil)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String | ::Nil"}],"args_string":"(value : String | Nil)","args_html":"(value : String | Nil)","location":{"filename":"src/avram/uploadable.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String | ::Nil"}],"visibility":"Public","body":"FailedCast.new"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/uploadable.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/uploadable.cr#L28"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"FailedCast.new"}}]}]},{"html_id":"avram/Avram/Upsert","path":"Avram/Upsert.html","kind":"module","full_name":"Avram::Upsert","name":"Upsert","abstract":false,"locations":[{"filename":"src/avram/upsert.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/upsert.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Adds the ability to \"create or update\" (upsert) to `Avram::SaveOperation`\n\nThis is included in SaveOperations by default. See `upsert_lookup_columns` for usage details.","summary":"

Adds the ability to "create or update" (upsert) to Avram::SaveOperation

","macros":[{"html_id":"upsert_lookup_columns(*attribute_names)-macro","name":"upsert_lookup_columns","doc":"Defines the columns Avram should use when performing an `upsert`\n\nAn \"upsert\" is short for \"update or insert\", or in Avram terminology a\n\"create or update\". If the values in an operation conflict with an existing\nrecord in the database, Avram updates that record. If there is no\nconflicting record, then Avram will create new one.\n\nIn Avram, you must define which columns Avram should look at when\ndetermining if a conflicting record exists. This is done using the macro\n`Avram::Upsert.upsert_lookup_columns`\n\n**Note:** In almost _every_ case the `upsert_lookup_columns` should have a **unique index** defined\nin the database to ensure no conflicting records are created, even from outside Avram.\n\n## Full Example\n\n```\nclass User < BaseModel\n table do\n column name : String\n column email : String # This column has a unique index\n end\nend\n\nclass SaveUser < User::SaveOperation\n # Can be one or more columns. In this case we choose just :email\n upsert_lookup_columns :email\nend\n\n# Will create a new row in the database since no row with\n# `email: \"bob@example.com\"` exists yet\nSaveUser.upsert!(name: \"Bobby\", email: \"bob@example.com\")\n\n# Will update the name on the row we just created since the email is\n# the same as one in the database\nSaveUser.upsert!(name: \"Bob\", email: \"bob@example.com\")\n```\n\n## Difference between `upsert` and `upsert!`\n\nThere is an `upsert` and `upsert!` that work similarly to `create` and `create!`.\n`upsert!` will raise an error if the operation is invalid. Whereas `upsert`\nwill yield the operation and the new record if the operation is valid, or\nthe operation and `nil` if it is invalid.\n\n```\n# Will raise because the name is blank\nSaveUser.upsert!(name: \"\", email: \"bob@example.com\")\n\n# Operation is invalid because name is blank\nSaveUser.upsert(name: \"\", email: \"bob@example.com\") do |operation, user|\n # `user` is `nil` because the operation is invalid.\n # If the `name` was valid `user` would be the newly created user\nend\n````","summary":"

Defines the columns Avram should use when performing an upsert

","abstract":false,"args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"args_string":"(*attribute_names)","args_html":"(*attribute_names)","location":{"filename":"src/avram/upsert.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/upsert.cr#L60"},"def":{"name":"upsert_lookup_columns","args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"splat_index":0,"visibility":"Public","body":" def self.upsert!(*args, **named_args) : T\n operation = new(*args, **named_args)\n \nexisting_record = find_existing_unique_record(operation)\n\n if \nexisting_record\n operation = new(\nexisting_record, *args, **named_args)\n \nend\n\n operation.save!\n \nend\n\n def self.upsert(*args, **named_args)\n operation = new(*args, **named_args)\n \nexisting_record = find_existing_unique_record(operation)\n\n if \nexisting_record\n operation = new(\nexisting_record, *args, **named_args)\n \nend\n\n operation.save\n yield operation, operation.record\n \nend\n\n def self.find_existing_unique_record(operation) : T?\n T::BaseQuery.new\n \n{% for attribute in attribute_names %}\n .{{ attribute.id }}.nilable_eq(operation.{{ attribute.id }}.value)\n {% end %}\n\n .first?\n \nend\n \n"}}]},{"html_id":"avram/Avram/Validations","path":"Avram/Validations.html","kind":"module","full_name":"Avram::Validations","name":"Validations","abstract":false,"locations":[{"filename":"src/avram/validations.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"extended_modules":[{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"A number of methods for validating Avram::Attributes\nAll validation methods return `Bool`. `false` if any error is added, otherwise `true`\n\nThis module is included in `Avram::Operation`, `Avram::SaveOperation`, and `Avram::DeleteOperation`","summary":"

A number of methods for validating Avram::Attributes All validation methods return Bool.

","instance_methods":[{"html_id":"validate_acceptance_of(attribute:Avram::Attribute(Bool),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_acceptance_of)):Bool-instance-method","name":"validate_acceptance_of","doc":"Validate whether an attribute was accepted (`true`)\n\nThis validation is only for Boolean Attributes. The attribute will be marked\nas invalid for any value other than `true`.","summary":"

Validate whether an attribute was accepted (true)

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Bool)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_acceptance_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(attribute : Avram::Attribute(Bool), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_acceptance_of)) : Bool","args_html":"(attribute : Avram::Attribute(Bool), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_acceptance_of)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":109,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L109"},"def":{"name":"validate_acceptance_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Bool)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_acceptance_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif attribute.value != true\n attribute.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_at_most_one_filled(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_at_most_one_filled)):Bool-instance-method","name":"validate_at_most_one_filled","doc":"Validates that at most one attribute is filled\n\nIf more than one attribute is filled it will mark all but the first filled\nfield invalid.","summary":"

Validates that at most one attribute is filled

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_at_most_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_at_most_one_filled)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_at_most_one_filled)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L39"},"def":{"name":"validate_at_most_one_filled","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_at_most_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = true\npresent_attributes = attributes.reject() do |__arg1|\n __arg1.value.blank?\nend\nif present_attributes.size > 1\n (present_attributes.skip(1)).each do |attr|\n attr.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_confirmation_of(attribute:Avram::Attribute(T),withconfirmation_attribute:Avram::Attribute(T),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_confirmation_of)):BoolforallT-instance-method","name":"validate_confirmation_of","doc":"Validates that the values of two attributes are the same\n\nTakes two attributes and if the values are different the second attribute\n(`with`/`confirmation_attribute`) will be marked as invalid\n\nExample:\n\n```\nvalidate_confirmation_of password, with: password_confirmation\n```\n\nIf `password_confirmation` does not match, it will be marked invalid.","summary":"

Validates that the values of two attributes are the same

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"confirmation_attribute","external_name":"with","restriction":"Avram::Attribute(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_confirmation_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(attribute : Avram::Attribute(T), with confirmation_attribute : Avram::Attribute(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_confirmation_of)) : Bool forall T","args_html":"(attribute : Avram::Attribute(T), with confirmation_attribute : Avram::Attribute(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_confirmation_of)) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":134,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L134"},"def":{"name":"validate_confirmation_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"confirmation_attribute","external_name":"with","restriction":"Avram::Attribute(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_confirmation_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif attribute.value != confirmation_attribute.value\n confirmation_attribute.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_exactly_one_filled(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_exactly_one_filled)):Bool-instance-method","name":"validate_exactly_one_filled","doc":"Validates that at exactly one attribute is filled\n\nThis validation is used by `Avram::Polymorphic.polymorphic` to ensure\nthat a required polymorphic association is set.\n\nIf more than one attribute is filled it will mark all but the first filled\nfield invalid.\n\nIf no field is filled, the first field will be marked as invalid.","summary":"

Validates that at exactly one attribute is filled

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exactly_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exactly_one_filled)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exactly_one_filled)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L65"},"def":{"name":"validate_exactly_one_filled","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exactly_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = validate_at_most_one_filled(*attributes)\npresent_attributes = attributes.reject() do |__arg2|\n __arg2.value.blank?\nend\nif present_attributes.size.zero?\n attributes.first.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_format_of(attribute:Avram::Attribute(String),withregex:Regex,match:Bool=true,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_format_of),allow_nil:Bool=false):Bool-instance-method","name":"validate_format_of","doc":"Validates that the passed in attributes matches the given regex\n\n```\nvalidate_format_of email, with: /[^@]+@[^\\.]+\\..+/\n```\n\nAlternatively, the `match` argument can be set to `false` to not match the\ngiven regex.","summary":"

Validates that the passed in attributes matches the given regex

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String)"},{"name":"regex","external_name":"with","restriction":"Regex"},{"name":"match","default_value":"true","external_name":"match","restriction":"Bool"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_format_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String), with regex : Regex, match : Bool = true, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_format_of), allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(String), with regex : Regex, match : Bool = true, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_format_of), allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":315,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L315"},"def":{"name":"validate_format_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String)"},{"name":"regex","external_name":"with","restriction":"Regex"},{"name":"match","default_value":"true","external_name":"match","restriction":"Bool"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_format_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"if allow_nil && attribute.value.nil?\nelse\n matching = attribute.value.to_s.match(regex)\n if (match && (!matching)) || ((!match) && matching)\n attribute.add_error(message)\n return false\n end\nend\ntrue\n"}},{"html_id":"validate_inclusion_of(attribute:Avram::Attribute(T),inallowed_values:Enumerable(T),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_inclusion_of),allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_inclusion_of","doc":"Validates that the attribute value is in a list of allowed values\n\n```\nvalidate_inclusion_of state, in: [\"NY\", \"MA\"]\n```\n\nThis will mark `state` as invalid unless the value is `\"NY\"`, or `\"MA\"`.","summary":"

Validates that the attribute value is in a list of allowed values

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"allowed_values","external_name":"in","restriction":"Enumerable(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_inclusion_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(T), in allowed_values : Enumerable(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_inclusion_of), allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(T), in allowed_values : Enumerable(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_inclusion_of), allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L155"},"def":{"name":"validate_inclusion_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"allowed_values","external_name":"in","restriction":"Enumerable(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_inclusion_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif value = attribute.value\n if !(allowed_values.includes?(value))\n attribute.add_error(message)\n no_errors = false\n end\nelse\n if !allow_nil\n attribute.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_numeric(attribute:Avram::Attribute(Number),greater_than=nil,less_than=nil,message=nil,allow_nil:Bool=false):Bool-instance-method","name":"validate_numeric","summary":"

DEPRECATED Use validate_numeric with at_least/no_more_than instead of greater_than/less_than

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"greater_than","default_value":"nil","external_name":"greater_than","restriction":""},{"name":"less_than","default_value":"nil","external_name":"less_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(Number), greater_than = nil, less_than = nil, message = nil, allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(Number), greater_than = nil, less_than = nil, message = nil, allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":246,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L246"},"def":{"name":"validate_numeric","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"greater_than","default_value":"nil","external_name":"greater_than","restriction":""},{"name":"less_than","default_value":"nil","external_name":"less_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"validate_numeric(attribute, at_least: greater_than, no_more_than: less_than, message: message, allow_nil: allow_nil)"}},{"html_id":"validate_numeric(attribute:Avram::Attribute(Number),*,at_least=nil,no_more_than=nil,message=nil,allow_nil:Bool=false):Bool-instance-method","name":"validate_numeric","doc":"Validate a number is `at_least` and/or `no_more_than`\n\n```\nvalidate_numeric age, at_least: 18\nvalidate_numeric count, at_least: 0, no_more_than: 1200\n```\nameba:disable Metrics/CyclomaticComplexity","summary":"

Validate a number is at_least and/or no_more_than

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"","external_name":"","restriction":""},{"name":"at_least","default_value":"nil","external_name":"at_least","restriction":""},{"name":"no_more_than","default_value":"nil","external_name":"no_more_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(Number), *, at_least = nil, no_more_than = nil, message = nil, allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(Number), *, at_least = nil, no_more_than = nil, message = nil, allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L263"},"def":{"name":"validate_numeric","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"","external_name":"","restriction":""},{"name":"at_least","default_value":"nil","external_name":"at_least","restriction":""},{"name":"no_more_than","default_value":"nil","external_name":"no_more_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"splat_index":1,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif (at_least && no_more_than) && at_least > no_more_than\n raise(ImpossibleValidation.new(attribute: attribute.name, message: \"number at least #{at_least} but no more than #{no_more_than}\"))\nend\nnumber = attribute.value\nif number.nil?\n if allow_nil\n else\n attribute.add_error(Avram.settings.i18n_backend.get(:validate_numeric_nil))\n no_errors = false\n end\n return no_errors\nend\nif at_least && number < at_least\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_numeric_min))) % at_least)\n no_errors = false\nend\nif no_more_than && number > no_more_than\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_numeric_max))) % no_more_than)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_required(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_required)):Bool-instance-method","name":"validate_required","doc":"Validates that the passed in attributes have values\n\nYou can pass in one or more attributes at a time. The attribute will be\nmarked as invalid if the value is `nil`, or \"blank\" (empty strings or strings with just whitespace)\n\n`false` is not considered invalid.\n\n```\nvalidate_required name, age, email\n```","summary":"

Validates that the passed in attributes have values

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_required)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_required)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_required)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L90"},"def":{"name":"validate_required","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_required)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nattributes.each do |attribute|\n if attribute.value.blank_for_validates_required? && (!attribute.allow_blank?)\n attribute.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_size_of(attribute:Avram::Attribute(String)|Avram::Attribute(Array(T)),min:Number|Nil=nil,max:Number|Nil=nil,message:Avram::Attribute::ErrorMessage|Nil=nil,allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_size_of","doc":"Validate the size of a `String` or `Array` is within a `min` and/or `max`\n\n```\nvalidate_size_of feedback, min: 18, max: 100\nvalidate_size_of password, min: 12\nvalidate_size_of options, max: 10\n```\nameba:disable Metrics/CyclomaticComplexity","summary":"

Validate the size of a String or Array is within a min and/or max

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"min","default_value":"nil","external_name":"min","restriction":"Number | ::Nil"},{"name":"max","default_value":"nil","external_name":"max","restriction":"Number | ::Nil"},{"name":"message","default_value":"nil","external_name":"message","restriction":"Avram::Attribute::ErrorMessage | ::Nil"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), min : Number | Nil = nil, max : Number | Nil = nil, message : Avram::Attribute::ErrorMessage | Nil = nil, allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), min : Number | Nil = nil, max : Number | Nil = nil, message : Avram::Attribute::ErrorMessage | Nil = nil, allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":210,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L210"},"def":{"name":"validate_size_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"min","default_value":"nil","external_name":"min","restriction":"Number | ::Nil"},{"name":"max","default_value":"nil","external_name":"max","restriction":"Number | ::Nil"},{"name":"message","default_value":"nil","external_name":"message","restriction":"Avram::Attribute::ErrorMessage | ::Nil"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif ((!min.nil?) && (!max.nil?)) && min > max\n raise(ImpossibleValidation.new(attribute: attribute.name, message: \"size greater than #{min} but less than #{max}\"))\nend\nif allow_nil && attribute.value.nil?\nelse\n size = attribute.value.try(&.size) || 0\n if (!min.nil?) && size < min\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_min_size_of))) % min)\n no_errors = false\n end\n if (!max.nil?) && size > max\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_max_size_of))) % max)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_size_of(attribute:Avram::Attribute(String)|Avram::Attribute(Array(T)),*,isexact_size:Number,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_exact_size_of),allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_size_of","doc":"Validate the size of a `String` or `Array` is exactly a certain size\n\n```\nvalidate_size_of api_key, is: 32\nvalidate_size_of theme_colors, is: 4\n```","summary":"

Validate the size of a String or Array is exactly a certain size

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"","external_name":"","restriction":""},{"name":"exact_size","external_name":"is","restriction":"Number"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exact_size_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), *, is exact_size : Number, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exact_size_of), allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), *, is exact_size : Number, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exact_size_of), allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":183,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L183"},"def":{"name":"validate_size_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"","external_name":"","restriction":""},{"name":"exact_size","external_name":"is","restriction":"Number"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exact_size_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"splat_index":1,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nsize = attribute.value.try(&.size) || 0\nif size != exact_size\n if !(allow_nil && attribute.value.nil?)\n attribute.add_error(message % exact_size)\n no_errors = false\n end\nend\nno_errors\n"}}],"macros":[{"html_id":"default_validations-macro","name":"default_validations","doc":"Defines an instance method that gets called\nduring validation of an operation. Define your default\nvalidations inside of the block.\n```\ndefault_validations do\n validate_required some_attribute\nend\n```","summary":"

Defines an instance method that gets called during validation of an operation.

","abstract":false,"location":{"filename":"src/avram/validations.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/validations.cr#L22"},"def":{"name":"default_validations","visibility":"Public","body":" \n# :nodoc:\n\n def default_validations\n \n{% if @type.methods.map(&.name).includes?((:default_validations).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/Where","path":"Avram/Where.html","kind":"module","full_name":"Avram::Where","name":"Where","abstract":false,"locations":[{"filename":"src/avram/where.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Where/Condition","path":"Avram/Where/Condition.html","kind":"class","full_name":"Avram::Where::Condition","name":"Condition","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L19"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/PrecedenceEnd","kind":"class","full_name":"Avram::Where::PrecedenceEnd","name":"PrecedenceEnd"},{"html_id":"avram/Avram/Where/PrecedenceStart","kind":"class","full_name":"Avram::Where::PrecedenceStart","name":"PrecedenceStart"},{"html_id":"avram/Avram/Where/Raw","kind":"class","full_name":"Avram::Where::Raw","name":"Raw"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L24"},"def":{"name":"clone","visibility":"Public","body":"self"}},{"html_id":"conjunction:Conjunction-instance-method","name":"conjunction","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L20"},"def":{"name":"conjunction","return_type":"Conjunction","visibility":"Public","body":"@conjunction"}},{"html_id":"conjunction=(conjunction:Conjunction)-instance-method","name":"conjunction=","abstract":false,"args":[{"name":"conjunction","external_name":"conjunction","restriction":"Conjunction"}],"args_string":"(conjunction : Conjunction)","args_html":"(conjunction : Conjunction)","location":{"filename":"src/avram/where.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L20"},"def":{"name":"conjunction=","args":[{"name":"conjunction","external_name":"conjunction","restriction":"Conjunction"}],"visibility":"Public","body":"@conjunction = conjunction"}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":true,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L22"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Where/Conjunction","path":"Avram/Where/Conjunction.html","kind":"enum","full_name":"Avram::Where::Conjunction","name":"Conjunction","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L2"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"And","name":"And","value":"0"},{"id":"Or","name":"Or","value":"1"},{"id":"None","name":"None","value":"2"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"and?-instance-method","name":"and?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L3"},"def":{"name":"and?","visibility":"Public","body":"self == And"}},{"html_id":"none?-instance-method","name":"none?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L5"},"def":{"name":"none?","visibility":"Public","body":"self == None"}},{"html_id":"or?-instance-method","name":"or?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L4"},"def":{"name":"or?","visibility":"Public","body":"self == Or"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"Returns a `String` representation of this enum member.\nIn the case of regular enums, this is just the name of the member.\nIn the case of flag enums, it's the names joined by vertical bars, or \"None\",\nif the value is zero.\n\nIf an enum's value doesn't match a member's value, the raw value\nis returned as a string.\n\n```\nColor::Red.to_s # => \"Red\"\nIOMode::None.to_s # => \"None\"\n(IOMode::Read | IOMode::Write).to_s # => \"Read | Write\"\n\nColor.new(10).to_s # => \"10\"\n```","summary":"

Returns a String representation of this enum member.

","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L7"},"def":{"name":"to_s","visibility":"Public","body":"case self\nwhen .and?\n \"AND\"\nwhen .or?\n \"OR\"\nelse\n \"\"\nend"}}]},{"html_id":"avram/Avram/Where/Equal","path":"Avram/Where/Equal.html","kind":"class","full_name":"Avram::Where::Equal","name":"Equal","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":92,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L92"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotEqual-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L97"},"def":{"name":"negated","return_type":"NotEqual","visibility":"Public","body":"NotEqual.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":93,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L93"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"=\""}}]},{"html_id":"avram/Avram/Where/Excludes","path":"Avram/Where/Excludes.html","kind":"class","full_name":"Avram::Where::Excludes","name":"Excludes","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":234,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L234"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Includes-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":239,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L239"},"def":{"name":"negated","return_type":"Includes","visibility":"Public","body":"Includes.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":235,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L235"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!= ALL\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":243,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L243"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{placeholder_supplier.call} #{operator} (#{column})\""}}]},{"html_id":"avram/Avram/Where/GreaterThan","path":"Avram/Where/GreaterThan.html","kind":"class","full_name":"Avram::Where::GreaterThan","name":"GreaterThan","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":112,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L112"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:LessThanOrEqualTo-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":117,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L117"},"def":{"name":"negated","return_type":"LessThanOrEqualTo","visibility":"Public","body":"LessThanOrEqualTo.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":113,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L113"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\">\""}}]},{"html_id":"avram/Avram/Where/GreaterThanOrEqualTo","path":"Avram/Where/GreaterThanOrEqualTo.html","kind":"class","full_name":"Avram::Where::GreaterThanOrEqualTo","name":"GreaterThanOrEqualTo","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":122,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L122"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:LessThan-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":127,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L127"},"def":{"name":"negated","return_type":"LessThan","visibility":"Public","body":"LessThan.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":123,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L123"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\">=\""}}]},{"html_id":"avram/Avram/Where/Ilike","path":"Avram/Where/Ilike.html","kind":"class","full_name":"Avram::Where::Ilike","name":"Ilike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L162"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotIlike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L167"},"def":{"name":"negated","return_type":"NotIlike","visibility":"Public","body":"NotIlike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":163,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L163"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"ILIKE\""}}]},{"html_id":"avram/Avram/Where/In","path":"Avram/Where/In.html","kind":"class","full_name":"Avram::Where::In","name":"In","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":192,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L192"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotIn-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":197,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L197"},"def":{"name":"negated","return_type":"NotIn","visibility":"Public","body":"NotIn.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L193"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"= ANY\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":201,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L201"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} (#{placeholder_supplier.call})\""}}]},{"html_id":"avram/Avram/Where/Includes","path":"Avram/Where/Includes.html","kind":"class","full_name":"Avram::Where::Includes","name":"Includes","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":220,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L220"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Excludes-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":225,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L225"},"def":{"name":"negated","return_type":"Excludes","visibility":"Public","body":"Excludes.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":221,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L221"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"= ANY\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":229,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L229"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{placeholder_supplier.call} #{operator} (#{column})\""}}]},{"html_id":"avram/Avram/Where/LessThan","path":"Avram/Where/LessThan.html","kind":"class","full_name":"Avram::Where::LessThan","name":"LessThan","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L132"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:GreaterThanOrEqualTo-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L137"},"def":{"name":"negated","return_type":"GreaterThanOrEqualTo","visibility":"Public","body":"GreaterThanOrEqualTo.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L133"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"<\""}}]},{"html_id":"avram/Avram/Where/LessThanOrEqualTo","path":"Avram/Where/LessThanOrEqualTo.html","kind":"class","full_name":"Avram::Where::LessThanOrEqualTo","name":"LessThanOrEqualTo","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L142"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:GreaterThan-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L147"},"def":{"name":"negated","return_type":"GreaterThan","visibility":"Public","body":"GreaterThan.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L143"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"<=\""}}]},{"html_id":"avram/Avram/Where/Like","path":"Avram/Where/Like.html","kind":"class","full_name":"Avram::Where::Like","name":"Like","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L152"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotLike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":157,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L157"},"def":{"name":"negated","return_type":"NotLike","visibility":"Public","body":"NotLike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L153"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"LIKE\""}}]},{"html_id":"avram/Avram/Where/NotEqual","path":"Avram/Where/NotEqual.html","kind":"class","full_name":"Avram::Where::NotEqual","name":"NotEqual","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":102,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L102"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Equal-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":107,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L107"},"def":{"name":"negated","return_type":"Equal","visibility":"Public","body":"Equal.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":103,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L103"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!=\""}}]},{"html_id":"avram/Avram/Where/NotIlike","path":"Avram/Where/NotIlike.html","kind":"class","full_name":"Avram::Where::NotIlike","name":"NotIlike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":182,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L182"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Ilike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":187,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L187"},"def":{"name":"negated","return_type":"Ilike","visibility":"Public","body":"Ilike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":183,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L183"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"NOT ILIKE\""}}]},{"html_id":"avram/Avram/Where/NotIn","path":"Avram/Where/NotIn.html","kind":"class","full_name":"Avram::Where::NotIn","name":"NotIn","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":206,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L206"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:In-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":211,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L211"},"def":{"name":"negated","return_type":"In","visibility":"Public","body":"In.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":207,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L207"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!= ALL\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":215,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L215"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} (#{placeholder_supplier.call})\""}}]},{"html_id":"avram/Avram/Where/NotLike","path":"Avram/Where/NotLike.html","kind":"class","full_name":"Avram::Where::NotLike","name":"NotLike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":172,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L172"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Like-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":177,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L177"},"def":{"name":"negated","return_type":"Like","visibility":"Public","body":"Like.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":173,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L173"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"NOT LIKE\""}}]},{"html_id":"avram/Avram/Where/NotNull","path":"Avram/Where/NotNull.html","kind":"class","full_name":"Avram::Where::NotNull","name":"NotNull","abstract":false,"superclass":{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L82"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Null-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L87"},"def":{"name":"negated","return_type":"Null","visibility":"Public","body":"Null.new(column)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":83,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L83"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"IS NOT\""}}]},{"html_id":"avram/Avram/Where/Null","path":"Avram/Where/Null.html","kind":"class","full_name":"Avram::Where::Null","name":"Null","abstract":false,"superclass":{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L72"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotNull-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L77"},"def":{"name":"negated","return_type":"NotNull","visibility":"Public","body":"NotNull.new(column)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":73,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L73"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"IS\""}}]},{"html_id":"avram/Avram/Where/NullSqlClause","path":"Avram/Where/NullSqlClause.html","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L66"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/NotNull","kind":"class","full_name":"Avram::Where::NotNull","name":"NotNull"},{"html_id":"avram/Avram/Where/Null","kind":"class","full_name":"Avram::Where::Null","name":"Null"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"prepare(_placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"_placeholder_supplier","external_name":"_placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(_placeholder_supplier : Proc(String)) : String","args_html":"(_placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L67"},"def":{"name":"prepare","args":[{"name":"_placeholder_supplier","external_name":"_placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} NULL\""}}]},{"html_id":"avram/Avram/Where/PrecedenceEnd","path":"Avram/Where/PrecedenceEnd.html","kind":"class","full_name":"Avram::Where::PrecedenceEnd","name":"PrecedenceEnd","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L39"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L40"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\")\""}}]},{"html_id":"avram/Avram/Where/PrecedenceStart","path":"Avram/Where/PrecedenceStart.html","kind":"class","full_name":"Avram::Where::PrecedenceStart","name":"PrecedenceStart","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L29"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L30"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L34"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"(\""}}]},{"html_id":"avram/Avram/Where/Raw","path":"Avram/Where/Raw.html","kind":"class","full_name":"Avram::Where::Raw","name":"Raw","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":248,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L248"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(statement:String,*bind_vars)-class-method","name":"new","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"args_string":"(statement : String, *bind_vars)","args_html":"(statement : String, *bind_vars)","location":{"filename":"src/avram/where.cr","line_number":251,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L251"},"def":{"name":"new","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"splat_index":1,"visibility":"Public","body":"new(statement, args: bind_vars.to_a)"}},{"html_id":"new(statement:String,*,argsbind_vars:Array)-class-method","name":"new","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"args_string":"(statement : String, *, args bind_vars : Array)","args_html":"(statement : String, *, args bind_vars : Array)","location":{"filename":"src/avram/where.cr","line_number":255,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L255"},"def":{"name":"new","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(statement, args: bind_vars)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":260,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L260"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"@clause"}}]},{"html_id":"avram/Avram/Where/SqlClause","path":"Avram/Where/SqlClause.html","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(column:String|Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::String | ::Symbol"}],"args_string":"(column : String | Symbol)","args_html":"(column : String | Symbol)","location":{"filename":"src/avram/where.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L48"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":"::String | ::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column:Symbol|String-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L46"},"def":{"name":"column","return_type":"Symbol | String","visibility":"Public","body":"@column"}},{"html_id":"negated:SqlClause-instance-method","name":"negated","abstract":true,"location":{"filename":"src/avram/where.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L52"},"def":{"name":"negated","return_type":"SqlClause","visibility":"Public","body":""}},{"html_id":"operator:String-instance-method","name":"operator","abstract":true,"location":{"filename":"src/avram/where.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L51"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L54"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} #{placeholder_supplier.call}\""}}]},{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","path":"Avram/Where/ValueHoldingSqlClause.html","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L59"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/Equal","kind":"class","full_name":"Avram::Where::Equal","name":"Equal"},{"html_id":"avram/Avram/Where/Excludes","kind":"class","full_name":"Avram::Where::Excludes","name":"Excludes"},{"html_id":"avram/Avram/Where/GreaterThan","kind":"class","full_name":"Avram::Where::GreaterThan","name":"GreaterThan"},{"html_id":"avram/Avram/Where/GreaterThanOrEqualTo","kind":"class","full_name":"Avram::Where::GreaterThanOrEqualTo","name":"GreaterThanOrEqualTo"},{"html_id":"avram/Avram/Where/Ilike","kind":"class","full_name":"Avram::Where::Ilike","name":"Ilike"},{"html_id":"avram/Avram/Where/In","kind":"class","full_name":"Avram::Where::In","name":"In"},{"html_id":"avram/Avram/Where/Includes","kind":"class","full_name":"Avram::Where::Includes","name":"Includes"},{"html_id":"avram/Avram/Where/LessThan","kind":"class","full_name":"Avram::Where::LessThan","name":"LessThan"},{"html_id":"avram/Avram/Where/LessThanOrEqualTo","kind":"class","full_name":"Avram::Where::LessThanOrEqualTo","name":"LessThanOrEqualTo"},{"html_id":"avram/Avram/Where/Like","kind":"class","full_name":"Avram::Where::Like","name":"Like"},{"html_id":"avram/Avram/Where/NotEqual","kind":"class","full_name":"Avram::Where::NotEqual","name":"NotEqual"},{"html_id":"avram/Avram/Where/NotIlike","kind":"class","full_name":"Avram::Where::NotIlike","name":"NotIlike"},{"html_id":"avram/Avram/Where/NotIn","kind":"class","full_name":"Avram::Where::NotIn","name":"NotIn"},{"html_id":"avram/Avram/Where/NotLike","kind":"class","full_name":"Avram::Where::NotLike","name":"NotLike"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(column,value:Array(Int32)|Array(String)|String)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":""},{"name":"value","external_name":"value","restriction":"::Array(::Int32) | ::Array(::String) | ::String"}],"args_string":"(column, value : Array(Int32) | Array(String) | String)","args_html":"(column, value : Array(Int32) | Array(String) | String)","location":{"filename":"src/avram/where.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L62"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":""},{"name":"value","external_name":"value","restriction":"::Array(::Int32) | ::Array(::String) | ::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column, value)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"value:String|Array(String)|Array(Int32)-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/where.cr#L60"},"def":{"name":"value","return_type":"String | Array(String) | Array(Int32)","visibility":"Public","body":"@value"}}]}]}]},{"html_id":"avram/BaseTask","path":"BaseTask.html","kind":"class","full_name":"BaseTask","name":"BaseTask","abstract":true,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"subclasses":[{"html_id":"avram/Db/Create","kind":"class","full_name":"Db::Create","name":"Create"},{"html_id":"avram/Db/Drop","kind":"class","full_name":"Db::Drop","name":"Drop"},{"html_id":"avram/Db/Migrate","kind":"class","full_name":"Db::Migrate","name":"Migrate"},{"html_id":"avram/Db/Migrate/One","kind":"class","full_name":"Db::Migrate::One","name":"One"},{"html_id":"avram/Db/Migrations/Status","kind":"class","full_name":"Db::Migrations::Status","name":"Status"},{"html_id":"avram/Db/Redo","kind":"class","full_name":"Db::Redo","name":"Redo"},{"html_id":"avram/Db/Reset","kind":"class","full_name":"Db::Reset","name":"Reset"},{"html_id":"avram/Db/Rollback","kind":"class","full_name":"Db::Rollback","name":"Rollback"},{"html_id":"avram/Db/RollbackAll","kind":"class","full_name":"Db::RollbackAll","name":"RollbackAll"},{"html_id":"avram/Db/RollbackTo","kind":"class","full_name":"Db::RollbackTo","name":"RollbackTo"},{"html_id":"avram/Db/Schema/Dump","kind":"class","full_name":"Db::Schema::Dump","name":"Dump"},{"html_id":"avram/Db/Schema/Restore","kind":"class","full_name":"Db::Schema::Restore","name":"Restore"},{"html_id":"avram/Db/Setup","kind":"class","full_name":"Db::Setup","name":"Setup"},{"html_id":"avram/Db/VerifyConnection","kind":"class","full_name":"Db::VerifyConnection","name":"VerifyConnection"}],"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"base_task\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L4"},"def":{"name":"call","visibility":"Public","body":"Avram::Migrator.run do\n run_task\nend"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":true,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/base_task.cr#L2"},"def":{"name":"run_task","visibility":"Public","body":""}}]},{"html_id":"avram/Bool","path":"Bool.html","kind":"struct","full_name":"Bool","name":"Bool","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/bool_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/bool_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L1"},{"filename":"src/avram/charms/bool_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"doc":"Bool has only two possible values: `true` and `false`. They are constructed using these literals:\n\n```\ntrue # A Bool that is true\nfalse # A Bool that is false\n```\n\nSee [`Bool` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/bool.html) in the language reference.","summary":"

Bool has only two possible values: true and false.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L2"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"false"}},{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L27"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"false"}}],"types":[{"html_id":"avram/Bool/Lucky","path":"Bool/Lucky.html","kind":"module","full_name":"Bool::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Bool","kind":"struct","full_name":"Bool","name":"Bool"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Bool).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"if ([\"true\", \"1\"] of ::String).includes?(value)\n SuccessfulCast(Bool).new(true)\nelse\n if ([\"false\", \"0\"] of ::String).includes?(value)\n SuccessfulCast(Bool).new(false)\n else\n FailedCast.new\n end\nend"}},{"html_id":"parse(value:Bool)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"SuccessfulCast(Bool).new(value)"}},{"html_id":"parse(values:Array(Bool))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"args_string":"(values : Array(Bool))","args_html":"(values : Array(Bool))","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L28"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"visibility":"Public","body":"SuccessfulCast(Array(Bool)).new(values)"}},{"html_id":"to_db(value:Bool):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool) : String","args_html":"(value : Bool) : String","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L32"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Bool))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"args_string":"(values : Array(Bool))","args_html":"(values : Array(Bool))","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Bool/Lucky/ColumnType","path":"Bool/Lucky/ColumnType.html","kind":"alias","full_name":"Bool::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Bool","aliased_html":"Bool","const":false,"namespace":{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"}},{"html_id":"avram/Bool/Lucky/Criteria","path":"Bool/Lucky/Criteria.html","kind":"class","full_name":"Bool::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/bool_extensions.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]},{"html_id":"avram/Char","path":"Char.html","kind":"struct","full_name":"Char","name":"Char","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/object.cr#L18"},{"filename":"src/avram/object_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L32"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"}],"doc":"A `Char` represents a [Unicode](http://en.wikipedia.org/wiki/Unicode) [code point](http://en.wikipedia.org/wiki/Code_point).\nIt occupies 32 bits.\n\nIt is created by enclosing an UTF-8 character in single quotes.\n\n```\n'a'\n'z'\n'0'\n'_'\n'あ'\n```\n\nYou can use a backslash to denote some characters:\n\n```\n'\\'' # single quote\n'\\\\' # backslash\n'\\e' # escape\n'\\f' # form feed\n'\\n' # newline\n'\\r' # carriage return\n'\\t' # tab\n'\\v' # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n'\\u0041' # == 'A'\n```\n\nOr you can use curly braces and specify up to four hexadecimal numbers:\n\n```\n'\\u{41}' # == 'A'\n```\n\nSee [`Char` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/char.html) in the language reference.","summary":"

A Char represents a Unicode code point.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L45"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/DB","path":"DB.html","kind":"module","full_name":"DB","name":"DB","abstract":false,"locations":[{"filename":"lib/db/src/db.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db.cr#L78"},{"filename":"lib/db/src/db/begin_transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/begin_transaction.cr#L1"},{"filename":"lib/db/src/db/connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/connection.cr#L1"},{"filename":"lib/db/src/db/connection_builder.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/connection_builder.cr#L1"},{"filename":"lib/db/src/db/connection_context.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/connection_context.cr#L1"},{"filename":"lib/db/src/db/database.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/database.cr#L4"},{"filename":"lib/db/src/db/disposable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/disposable.cr#L1"},{"filename":"lib/db/src/db/driver.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/driver.cr#L1"},{"filename":"lib/db/src/db/enumerable_concat.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/enumerable_concat.cr#L1"},{"filename":"lib/db/src/db/error.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/error.cr#L1"},{"filename":"lib/db/src/db/mapping.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/mapping.cr#L1"},{"filename":"lib/db/src/db/pool.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/pool.cr#L5"},{"filename":"lib/db/src/db/pool_prepared_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/pool_prepared_statement.cr#L1"},{"filename":"lib/db/src/db/pool_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/pool_statement.cr#L1"},{"filename":"lib/db/src/db/pool_unprepared_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/pool_unprepared_statement.cr#L1"},{"filename":"lib/db/src/db/query_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/query_methods.cr#L1"},{"filename":"lib/db/src/db/result_set.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/result_set.cr#L1"},{"filename":"lib/db/src/db/serializable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/serializable.cr#L1"},{"filename":"lib/db/src/db/session_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/session_methods.cr#L1"},{"filename":"lib/db/src/db/statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/statement.cr#L1"},{"filename":"lib/db/src/db/string_key_cache.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/string_key_cache.cr#L1"},{"filename":"lib/db/src/db/transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/transaction.cr#L1"},{"filename":"src/ext/db/connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/connection.cr#L1"},{"filename":"src/ext/db/transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"The DB module is a unified interface for database access.\nIndividual database systems are supported by specific database driver shards.\n\nAvailable drivers include:\n* [crystal-lang/crystal-sqlite3](https://github.com/crystal-lang/crystal-sqlite3) for SQLite\n* [crystal-lang/crystal-mysql](https://github.com/crystal-lang/crystal-mysql) for MySQL and MariaDB\n* [will/crystal-pg](https://github.com/will/crystal-pg) for PostgreSQL\n* [kaukas/crystal-cassandra](https://github.com/kaukas/crystal-cassandra) for Cassandra\n\nFor basic instructions on implementing a new database driver, check `Driver` and the existing drivers.\n\nDB manages a connection pool. The connection pool can be configured by query parameters to the\nconnection `URI` as described in `Database`.\n\n### Usage\n\nAssuming `crystal-sqlite3` is included a SQLite3 database can be opened with `#open`.\n\n```\ndb = DB.open \"sqlite3:./path/to/db/file.db\"\ndb.close\n```\n\nIf a block is given to `#open` the database is closed automatically\n\n```\nDB.open \"sqlite3:./file.db\" do |db|\n # work with db\nend # db is closed\n```\n\nIn the code above `db` is a `Database`. Methods available for querying it are described in `QueryMethods`.\n\nThree kind of statements can be performed:\n1. `Database#exec` waits no response from the database.\n2. `Database#scalar` reads a single value of the response.\n3. `Database#query` returns a ResultSet that allows iteration over the rows in the response and column information.\n\nAll of the above methods allows parametrised query. Either positional or named arguments.\n\nCheck a full working version:\n\nThe following example uses SQLite where `?` indicates the arguments. If PostgreSQL is used `$1`, `$2`, etc. should be used. `crystal-db` does not interpret the statements.\n\n```\nrequire \"db\"\nrequire \"sqlite3\"\n\nDB.open \"sqlite3:./file.db\" do |db|\n # When using the pg driver, use $1, $2, etc. instead of ?\n db.exec \"create table contacts (name text, age integer)\"\n db.exec \"insert into contacts values (?, ?)\", \"John Doe\", 30\n\n args = [] of DB::Any\n args << \"Sarah\"\n args << 33\n db.exec \"insert into contacts values (?, ?)\", args: args\n\n puts \"max age:\"\n puts db.scalar \"select max(age) from contacts\" # => 33\n\n puts \"contacts:\"\n db.query \"select name, age from contacts order by age desc\" do |rs|\n puts \"#{rs.column_name(0)} (#{rs.column_name(1)})\"\n # => name (age)\n rs.each do\n puts \"#{rs.read(String)} (#{rs.read(Int32)})\"\n # => Sarah (33)\n # => John Doe (30)\n end\n end\nend\n```\n","summary":"

The DB module is a unified interface for database access.

","types":[{"html_id":"avram/DB/Connection","path":"DB/Connection.html","kind":"class","full_name":"DB::Connection","name":"Connection","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/SessionMethods","kind":"module","full_name":"DB::SessionMethods","name":"SessionMethods"},{"html_id":"avram/DB/QueryMethods","kind":"module","full_name":"DB::QueryMethods","name":"QueryMethods"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/connection.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/connection.cr#L21"},{"filename":"lib/db/src/db/error.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/error.cr#L2"},{"filename":"src/ext/db/connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/connection.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/DB/SessionMethods","kind":"module","full_name":"DB::SessionMethods","name":"SessionMethods"}],"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"doc":"Database driver implementors must subclass `Connection`.\n\nRepresents one active connection to a database.\n\nUsers should never instantiate a `Connection` manually. Use `DB#open` or `Database#connection`.\n\nRefer to `QueryMethods` for documentation about querying the database through this connection.\n\n### Note to implementors\n\nThe connection must be initialized in `#initialize` and closed in `#do_close`.\n\nOverride `#build_prepared_statement` method in order to return a prepared `Statement` to allow querying.\nOverride `#build_unprepared_statement` method in order to return a unprepared `Statement` to allow querying.\nSee also `Statement` to define how the statements are executed.\n\nIf at any give moment the connection is lost a DB::ConnectionLost should be raised. This will\nallow the connection pool to try to reconnect or use another connection if available.\n","summary":"

Database driver implementors must subclass Connection.

"},{"html_id":"avram/DB/SavePointTransaction","path":"DB/SavePointTransaction.html","kind":"class","full_name":"DB::SavePointTransaction","name":"SavePointTransaction","abstract":false,"superclass":{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},"ancestors":[{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":94,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/transaction.cr#L94"},{"filename":"src/ext/db/transaction.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L20"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"constructors":[{"html_id":"new(parent:Transaction,savepoint_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"parent","external_name":"parent","restriction":"Transaction"},{"name":"savepoint_name","external_name":"savepoint_name","restriction":"String"}],"args_string":"(parent : Transaction, savepoint_name : String)","args_html":"(parent : Transaction, savepoint_name : String)","location":{"filename":"src/ext/db/transaction.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L21"},"def":{"name":"new","args":[{"name":"parent","external_name":"parent","restriction":"Transaction"},{"name":"savepoint_name","external_name":"savepoint_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(parent, savepoint_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/DB/TopLevelTransaction","path":"DB/TopLevelTransaction.html","kind":"class","full_name":"DB::TopLevelTransaction","name":"TopLevelTransaction","abstract":false,"superclass":{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},"ancestors":[{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/transaction.cr#L38"},{"filename":"src/ext/db/transaction.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"constructors":[{"html_id":"new(connection:Connection)-class-method","name":"new","abstract":false,"args":[{"name":"connection","external_name":"connection","restriction":"Connection"}],"args_string":"(connection : Connection)","args_html":"(connection : Connection)","location":{"filename":"src/ext/db/transaction.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L8"},"def":{"name":"new","args":[{"name":"connection","external_name":"connection","restriction":"Connection"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/DB/Transaction","path":"DB/Transaction.html","kind":"class","full_name":"DB::Transaction","name":"Transaction","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/transaction.cr#L14"},{"filename":"src/ext/db/transaction.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/ext/db/transaction.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"}],"subclasses":[{"html_id":"avram/DB/SavePointTransaction","kind":"class","full_name":"DB::SavePointTransaction","name":"SavePointTransaction"},{"html_id":"avram/DB/TopLevelTransaction","kind":"class","full_name":"DB::TopLevelTransaction","name":"TopLevelTransaction"}],"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"doc":"Transactions should be started from `DB#transaction`, `Connection#transaction`\nor `Connection#begin_transaction`.\n\nUse `Transaction#connection` to submit statements to the database.\n\nUse `Transaction#commit` or `Transaction#rollback` to close the ongoing transaction\nexplicitly. Or refer to `BeginTransaction#transaction` for documentation on how to\nuse `#transaction(&block)` methods in `DB` and `Connection`.\n\nNested transactions are supported by using sql `SAVEPOINT`. To start a nested\ntransaction use `Transaction#transaction` or `Transaction#begin_transaction`.\n","summary":"

Transactions should be started from DB#transaction, Connection#transaction or Connection#begin_transaction.

"}]},{"html_id":"avram/Db","path":"Db.html","kind":"module","full_name":"Db","name":"Db","abstract":false,"locations":[{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Db/Console","path":"Db/Console.html","kind":"class","full_name":"Db::Console","name":"Console","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nEnters the postgres REPL. Check config/database.cr\\nfor database configuration.\\n\\nExamples:\\n\\n lucky db.console\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.console\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Access PostgreSQL console\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L16"},"def":{"name":"call","visibility":"Public","body":"puts(banner_message)\nsystem(\"psql #{Avram::Migrator::Runner.credentials.url_without_query_params}\")\n"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/console.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}]},{"html_id":"avram/Db/Create","path":"Db/Create.html","kind":"class","full_name":"Db::Create","name":"Create","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe database name is usually found in config/database.cr\\n\\nExamples:\\n\\n lucky db.create\\n LUCKY_ENV=test lucky db.create # Create the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.create\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L3"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Create the database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/create.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L16"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L19"},"def":{"name":"run_task","visibility":"Public","body":"Migrator::Runner.create_db(@quiet)"}}],"types":[{"html_id":"avram/Db/Create/Migrator","path":"Db/Create/Migrator.html","kind":"alias","full_name":"Db::Create::Migrator","name":"Migrator","abstract":false,"locations":[{"filename":"src/avram/tasks/db/create.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/create.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Avram::Migrator","aliased_html":"Avram::Migrator","const":false,"namespace":{"html_id":"avram/Db/Create","kind":"class","full_name":"Db::Create","name":"Create"}}]},{"html_id":"avram/Db/Drop","path":"Db/Drop.html","kind":"class","full_name":"Db::Drop","name":"Drop","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe database name is usually found in config/database.cr\\n\\nExamples:\\n\\n lucky db.drop\\n LUCKY_ENV=test lucky db.drop # Drop the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.drop\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Drop the database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/drop.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L15"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/drop.cr#L18"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.drop_db(@quiet)"}}]},{"html_id":"avram/Db/Migrate","path":"Db/Migrate.html","kind":"class","full_name":"Db::Migrate","name":"Migrate","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExamples:\\n\\n lucky db.migrate\\n LUCKY_ENV=test lucky db.migrate # Runs migrations on the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrate\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Run any pending migrations\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L13"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate.cr#L16"},"def":{"name":"run_task","visibility":"Public","body":"(Avram::Migrator::Runner.new(@quiet)).run_pending_migrations"}}],"types":[{"html_id":"avram/Db/Migrate/One","path":"Db/Migrate/One.html","kind":"class","full_name":"Db::Migrate::One","name":"One","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Migrate","kind":"class","full_name":"Db::Migrate","name":"Migrate"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.migrate.one\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrate.one\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Run just the next pending migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrate_one.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.run_next_migration"}}]}]},{"html_id":"avram/Db/Migrations","path":"Db/Migrations.html","kind":"module","full_name":"Db::Migrations","name":"Migrations","abstract":false,"locations":[{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"types":[{"html_id":"avram/Db/Migrations/Status","path":"Db/Migrations/Status.html","kind":"class","full_name":"Db::Migrations::Status","name":"Status","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Migrations","kind":"module","full_name":"Db::Migrations","name":"Migrations"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L5"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Shows which migrations are pending and which have been run.\\n\\nExamples:\\n\\n lucky db.migrations.status\\n LUCKY_ENV=test lucky db.migrations.status # Show migration status for test db\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L3"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrations.status\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L4"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Print the current status of migrations\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L3"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/migrations_status.cr#L15"},"def":{"name":"run_task","visibility":"Public","body":"if migrations.none?\n puts(\"There are no migrations.\".colorize(:green))\nelse\n ensure_migration_tracking_tables_exist\n print_migration_statuses\nend"}}]}]},{"html_id":"avram/Db/Redo","path":"Db/Redo.html","kind":"class","full_name":"Db::Redo","name":"Redo","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.redo\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.redo\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback and run just the last migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/redo.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Db::Rollback.new.run_task\nDb::Migrate.new.run_task\n"}}]},{"html_id":"avram/Db/Reset","path":"Db/Reset.html","kind":"class","full_name":"Db::Reset","name":"Reset","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.reset\\n\\nTo drop the test database:\\n\\n LUCKY_ENV=test lucky db.reset\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.reset\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Drop, recreate, and run migrations.\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/reset.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L16"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/reset.cr#L19"},"def":{"name":"run_task","visibility":"Public","body":"(Db::Drop.new(@quiet)).run_task\n(Db::Create.new(@quiet)).run_task\n(Db::Migrate.new(@quiet)).run_task\n"}}]},{"html_id":"avram/Db/Rollback","path":"Db/Rollback.html","kind":"class","full_name":"Db::Rollback","name":"Rollback","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.rollback\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback the last migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.rollback_one"}}]},{"html_id":"avram/Db/RollbackAll","path":"Db/RollbackAll.html","kind":"class","full_name":"Db::RollbackAll","name":"RollbackAll","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou may also want to look at 'lucky db.drop'.\\n\\nExample:\\n\\n lucky db.rollback_all\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback_all\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback all migrations\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_all.cr#L15"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.rollback_all\nputs(\"Done rolling back all migrations\".colorize(:green))\n"}}]},{"html_id":"avram/Db/RollbackTo","path":"Db/RollbackTo.html","kind":"class","full_name":"Db::RollbackTo","name":"RollbackTo","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou can get the migration version from the filename or by running 'lucky db.migrations.status'\\n\\nExample:\\n\\n lucky db.rollback_to 20180802180356\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback_to\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback to a specific migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/rollback_to.cr#L14"},"def":{"name":"run_task","visibility":"Public","body":"version = ARGV.first?\nif version && version.to_i64?\n Avram::Migrator::Runner.new.rollback_to(version.to_i64)\nelse\n raise((\"Migration version is required. Example: lucky db.rollback_to 20180802180356\".colorize(:red)).to_s)\nend\n"}}]},{"html_id":"avram/Db/Schema","path":"Db/Schema.html","kind":"module","full_name":"Db::Schema","name":"Schema","abstract":false,"locations":[{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"types":[{"html_id":"avram/Db/Schema/Dump","path":"Db/Schema/Dump.html","kind":"class","full_name":"Db::Schema::Dump","name":"Dump","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[:dump_to] of Symbol"}],"namespace":{"html_id":"avram/Db/Schema","kind":"module","full_name":"Db::Schema","name":"Schema"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou must specify the path that you want Avram to dump the sql to. Note\\nthat this dumps the schema but does not dump any data.\\n\\nExample:\\n\\n lucky db.schema.dump structure.sql\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.schema.dump\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Export database schema to a sql file\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L17"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"dump_to:String-instance-method","name":"dump_to","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L15"},"def":{"name":"dump_to","return_type":"String","visibility":"Public","body":"if @dump_to.nil?\n raise(\"dump_to is required, but no value was passed.\")\nend\n@dump_to.as(String)\n"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L20"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.dump_db(dump_to, @quiet)"}},{"html_id":"set_opt_for_dump_to(args:Array(String))-instance-method","name":"set_opt_for_dump_to","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_dump.cr#L15"},"def":{"name":"set_opt_for_dump_to","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"value = args[@positional_arg_count]?\n@dump_to = value\n@positional_arg_count = @positional_arg_count + 1\n"}}]},{"html_id":"avram/Db/Schema/Restore","path":"Db/Schema/Restore.html","kind":"class","full_name":"Db::Schema::Restore","name":"Restore","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Schema","kind":"module","full_name":"Db::Schema","name":"Schema"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou must specify the path to the sql that you want Avram to restore from.\\n\\nExample:\\n\\n lucky db.schema.restore structure.sql\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.schema.restore\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Restore database from a sql dump file\""}}],"constructors":[{"html_id":"new(import_file_path:String|Nil=nil,quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"import_file_path","default_value":"nil","external_name":"import_file_path","restriction":"String | ::Nil"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(import_file_path : String | Nil = nil, quiet : Bool = false)","args_html":"(import_file_path : String | Nil = nil, quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L14"},"def":{"name":"new","args":[{"name":"import_file_path","default_value":"nil","external_name":"import_file_path","restriction":"String | ::Nil"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(import_file_path, quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/schema_restore.cr#L17"},"def":{"name":"run_task","visibility":"Public","body":"import_file_path = (@import_file_path || ARGV.first?) || (raise(\"A path to the import SQL file must be provided\"))\nAvram::Migrator::Runner.restore_db(import_file_path.as(String), @quiet)\n"}}]}]},{"html_id":"avram/Db/Setup","path":"Db/Setup.html","kind":"class","full_name":"Db::Setup","name":"Setup","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThis task will run the following:\\n * db.create - Create the database from config/database.cr\\n * db.migrate - Migrate all pending migrations from db/migrations/\\n\\n\\nExamples:\\n\\n lucky db.setup\\n LUCKY_ENV=test lucky db.setup # Setup test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.setup\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Runs a few tasks for setting up your database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/setup.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L18"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/setup.cr#L21"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.create_db(@quiet)\n(Avram::Migrator::Runner.new(@quiet)).run_pending_migrations\n"}}]},{"html_id":"avram/Db/VerifyConnection","path":"Db/VerifyConnection.html","kind":"class","full_name":"Db::VerifyConnection","name":"VerifyConnection","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe connection settings are typically defined in config/database.cr\\n\\nExamples:\\n\\n lucky db.verify_connection\\n LUCKY_ENV=test lucky db.verify_connection # Verify test db connection\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.verify_connection\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Verify connection to postgres\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L17"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"quiet?:Bool-instance-method","name":"quiet?","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L15"},"def":{"name":"quiet?","visibility":"Public","body":"@quiet"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/db/verify_connection.cr#L20"},"def":{"name":"run_task","visibility":"Public","body":"begin\n Avram.settings.database_to_migrate.verify_connection\n if quiet?\n else\n puts(\"✔ Connection verified\")\n end\nrescue Avram::ConnectionError\n raise(\"Unable to connect to Postgres for database '#{Avram.settings.database_to_migrate}'.\\n\\nThis is what we tried to connect to:\\n\\n * host: #{Avram::Migrator::Runner.db_host}\\n * port: #{Avram::Migrator::Runner.db_port}\\n * database: #{Avram::Migrator::Runner.db_name}\\n * username: #{Avram::Migrator::Runner.db_user}\\n * password: check config/database.cr\\n\\nTo fix, try this...\\n\\n ▸ Make sure Postgres is running.\\n ▸ Check connection settings in config/database.cr.\\n ▸ If the database has not been created yet, run 'lucky db.create'\\n ▸ Then run 'lucky db.verify_connection' to make sure it can connect.\\n\")\nend"}}]}]},{"html_id":"avram/Enum","path":"Enum.html","kind":"struct","full_name":"Enum","name":"Enum","abstract":true,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/result_set.cr","line_number":156,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/db/src/db/result_set.cr#L156"},{"filename":"src/avram/charms/enum_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"Enum is the base type of all enums.\n\nAn enum is a set of integer values, where each value has an associated name. For example:\n\n```\nenum Color\n Red # 0\n Green # 1\n Blue # 2\nend\n```\n\nValues start with the value `0` and are incremented by one, but can be overwritten.\n\nTo get the underlying value you invoke value on it:\n\n```\nColor::Green.value # => 1\n```\n\nEach constant (member) in the enum has the type of the enum:\n\n```\ntypeof(Color::Red) # => Color\n```\n\n### Flags enum\n\nAn enum can be marked with the `@[Flags]` annotation. This changes the default values:\n\n```\n@[Flags]\nenum IOMode\n Read # 1\n Write # 2\n Async # 4\nend\n```\n\nAdditionally, some methods change their behaviour.\n\n### Enums from integers\n\nAn enum can be created from an integer:\n\n```\nColor.new(1).to_s # => \"Green\"\n```\n\nValues that don't correspond to enum's constants are allowed: the value\nwill still be of type Color, but when printed you will get the underlying value:\n\n```\nColor.new(10).to_s # => \"10\"\n```\n\nThis method is mainly intended to convert integers from C to enums in Crystal.\n\n### Question methods\n\nAn enum automatically defines question methods for each member, using\n`String#underscore` for the method name.\n* In the case of regular enums, this compares by equality (`==`).\n* In the case of flags enums, this invokes `includes?`.\n\nFor example:\n\n```\ncolor = Color::Blue\ncolor.red? # => false\ncolor.blue? # => true\n\nmode = IOMode::Read | IOMode::Async\nmode.read? # => true\nmode.write? # => false\nmode.async? # => true\n```\n\nThis is very convenient in `case` expressions:\n\n```\ncase color\nwhen .red?\n puts \"Got red\"\nwhen .blue?\n puts \"Got blue\"\nend\n```\n\n### Changing the Base Type\n\nThe type of the underlying enum value is `Int32` by default, but it can be changed to any type in `Int::Primitive`.\n\n```\nenum Color : UInt8\n Red\n Green\n Blue\nend\n\nColor::Red.value # : UInt8\n```","summary":"

Enum is the base type of all enums.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L4"},"def":{"name":"adapter","visibility":"Public","body":"Lucky(self)"}}],"types":[{"html_id":"avram/Enum/Lucky","path":"Enum/Lucky.html","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},"instance_methods":[{"html_id":"criteria(query:V,column)forallV-instance-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"V"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : V, column) forall V","args_html":"(query : V, column) forall V","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L39"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"V"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(V, T).new(query, column)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L12"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"is_int = value.to_i?\nif is_int\n return parse(is_int)\nend\nif result = T.parse?(value)\n SuccessfulCast.new(result)\nelse\n FailedCast.new\nend\n"}},{"html_id":"parse(value:Int)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int"}],"args_string":"(value : Int)","args_html":"(value : Int)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L23"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int"}],"visibility":"Public","body":"if result = T.from_value?(value)\n SuccessfulCast.new(result)\nelse\n FailedCast.new\nend"}},{"html_id":"parse(value:T)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T)","args_html":"(value : T)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L31"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"T"}],"visibility":"Public","body":"SuccessfulCast.new(value)"}},{"html_id":"to_db(value:T):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T) : String","args_html":"(value : T) : String","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L35"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"T"}],"return_type":"String","visibility":"Public","body":"value.value.to_s"}}],"types":[{"html_id":"avram/Enum/Lucky/ColumnType","path":"Enum/Lucky/ColumnType.html","kind":"alias","full_name":"Enum::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L10"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Int32 | Int64)","aliased_html":"Int32 | Int64","const":false,"namespace":{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"}},{"html_id":"avram/Enum/Lucky/Criteria","path":"Enum/Lucky/Criteria.html","kind":"class","full_name":"Enum::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria","name":"Criteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L43"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"select_max:V|Nil-instance-method","name":"select_max","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L50"},"def":{"name":"select_max","return_type":"V | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_max(column)).as(Int32 | ::Nil)).try do |max|\n V.adapter.parse!(max)\nend"}},{"html_id":"select_min:V|Nil-instance-method","name":"select_min","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/enum_extensions.cr#L44"},"def":{"name":"select_min","return_type":"V | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_min(column)).as(Int32 | ::Nil)).try do |min|\n V.adapter.parse!(min)\nend"}}]}]}]},{"html_id":"avram/Fiber","path":"Fiber.html","kind":"class","full_name":"Fiber","name":"Fiber","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/fiber.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/fiber.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"https://crystal-lang.org/api/latest/Fiber.html","summary":"

https://crystal-lang.org/api/latest/Fiber.html

","instance_methods":[{"html_id":"query_cache:LuckyCache::BaseStore-instance-method","name":"query_cache","doc":"This is stored on Fiber so it's released after each\nHTTP Request.","summary":"

This is stored on Fiber so it's released after each HTTP Request.

","abstract":false,"location":{"filename":"src/avram/charms/fiber.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/fiber.cr#L5"},"def":{"name":"query_cache","return_type":"LuckyCache::BaseStore","visibility":"Public","body":"if (value = @query_cache).nil?\n @query_cache = (if Avram.settings.query_cache_enabled\n LuckyCache::MemoryStore.new\n else\n LuckyCache::NullStore.new\n end)\nelse\n value\nend"}},{"html_id":"query_cache=(query_cache:LuckyCache::BaseStore)-instance-method","name":"query_cache=","doc":"This is stored on Fiber so it's released after each\nHTTP Request.","summary":"

This is stored on Fiber so it's released after each HTTP Request.

","abstract":false,"args":[{"name":"query_cache","external_name":"query_cache","restriction":"LuckyCache::BaseStore"}],"args_string":"(query_cache : LuckyCache::BaseStore)","args_html":"(query_cache : LuckyCache::BaseStore)","location":{"filename":"src/avram/charms/fiber.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/fiber.cr#L5"},"def":{"name":"query_cache=","args":[{"name":"query_cache","external_name":"query_cache","restriction":"LuckyCache::BaseStore"}],"visibility":"Public","body":"@query_cache = query_cache"}}]},{"html_id":"avram/Float64","path":"Float64.html","kind":"struct","full_name":"Float64","name":"Float64","abstract":false,"superclass":{"html_id":"avram/Float","kind":"struct","full_name":"Float","name":"Float"},"ancestors":[{"html_id":"avram/Float","kind":"struct","full_name":"Float","name":"Float"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L31"},{"filename":"src/avram/charms/float64_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L32"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Float64/Lucky","path":"Float64/Lucky.html","kind":"module","full_name":"Float64::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Float64","kind":"struct","full_name":"Float64","name":"Float64"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Float64).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Float64)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64)","args_html":"(value : Float64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"visibility":"Public","body":"value"}},{"html_id":"from_db!(value:PG::Numeric)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"args_string":"(value : PG::Numeric)","args_html":"(value : PG::Numeric)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L18"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"visibility":"Public","body":"value.to_f"}},{"html_id":"parse(value:Float64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64)","args_html":"(value : Float64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value)"}},{"html_id":"parse(values:Array(Float64))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"args_string":"(values : Array(Float64))","args_html":"(values : Array(Float64))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"visibility":"Public","body":"SuccessfulCast(Array(Float64)).new(values)"}},{"html_id":"parse(value:PG::Numeric)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"args_string":"(value : PG::Numeric)","args_html":"(value : PG::Numeric)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L30"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f)"}},{"html_id":"parse(values:Array(PG::Numeric))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(PG::Numeric)"}],"args_string":"(values : Array(PG::Numeric))","args_html":"(values : Array(PG::Numeric))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L34"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(PG::Numeric)"}],"visibility":"Public","body":"SuccessfulCast(Array(Float64)).new(values.map(&.to_f))"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L38"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Float64).new(value.to_f64)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L44"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f64)"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L48"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f64)"}},{"html_id":"to_db(value:Float64):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64) : String","args_html":"(value : Float64) : String","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L52"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Float64))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"args_string":"(values : Array(Float64))","args_html":"(values : Array(Float64))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L56"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Float64/Lucky/ColumnType","path":"Float64/Lucky/ColumnType.html","kind":"alias","full_name":"Float64::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Float64 | PG::Numeric)","aliased_html":"Float64 | PG::Numeric","const":false,"namespace":{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"}},{"html_id":"avram/Float64/Lucky/Criteria","path":"Float64/Lucky/Criteria.html","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L60"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"}],"namespace":{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L61"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"select_sum:Float64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L63"},"def":{"name":"select_sum","return_type":"Float64 | ::Nil","visibility":"Public","body":"if sum = super()\n (sum.as(PG::Numeric)).to_f\nend"}},{"html_id":"select_sum!:Float64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/float64_extensions.cr#L69"},"def":{"name":"select_sum!","return_type":"Float64","visibility":"Public","body":"select_sum || 0_f64"}}]}]}]},{"html_id":"avram/Gen","path":"Gen.html","kind":"module","full_name":"Gen","name":"Gen","abstract":false,"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Gen/Migration","path":"Gen/Migration.html","kind":"class","full_name":"Gen::Migration","name":"Migration","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"HABITAT_SETTINGS","name":"HABITAT_SETTINGS","value":"[{decl: io : IO = STDOUT, example: nil, validation: nil}] of Nil"},{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"configure(&)-class-method","name":"configure","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"configure","yields":1,"block_arity":1,"visibility":"Public","body":"yield settings"}},{"html_id":"settings-class-method","name":"settings","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}},{"html_id":"silence_output(&)-class-method","name":"silence_output","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L22"},"def":{"name":"silence_output","yields":0,"block_arity":0,"visibility":"Public","body":"temp_config(io: IO::Memory.new) do\n yield\nend"}},{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L5"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Generate a new migration using the passed in migration name.\\n\\nThe migration name must be CamelCase. No other options are available.\\n\\nExamples:\\n\\n lucky gen.migration CreateUsers\\n lucky gen.migration AddAgeToUsers\\n lucky gen.migration MakeUserNameOptional\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L3"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.migration\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L4"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a new migration\""}}],"instance_methods":[{"html_id":"call(name:String|Nil=nil)-instance-method","name":"call","abstract":false,"args":[{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil"}],"args_string":"(name : String | Nil = nil)","args_html":"(name : String | Nil = nil)","location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L28"},"def":{"name":"call","args":[{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil"}],"visibility":"Public","body":"Avram::Migrator.run do\n name = name || ARGV.first?\n if name\n Avram::Migrator::MigrationGenerator.new(name: name).generate\n else\n raise((\"Migration name is required. Example: lucky gen.migration CreateUsers\".colorize(:red)).to_s)\n end\nend"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L3"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"settings-instance-method","name":"settings","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"types":[{"html_id":"avram/Gen/Migration/HabitatSettings","path":"Gen/Migration/HabitatSettings.html","kind":"class","full_name":"Gen::Migration::HabitatSettings","name":"HabitatSettings","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/tasks/gen/migration.cr#L18"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen/Migration","kind":"class","full_name":"Gen::Migration","name":"Migration"},"class_methods":[{"html_id":"io:IO-class-method","name":"io","abstract":false,"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@@io.not_nil!"}},{"html_id":"io=(value:IO)-class-method","name":"io=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"IO"}],"args_string":"(value : IO)","args_html":"(value : IO)","def":{"name":"io=","args":[{"name":"value","external_name":"value","restriction":"IO"}],"visibility":"Public","body":"@@io = value"}},{"html_id":"io?-class-method","name":"io?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use io in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use io in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"io?","visibility":"Public","body":"@@io"}},{"html_id":"to_h-class-method","name":"to_h","doc":"Generates a hash using the provided values","summary":"

Generates a hash using the provided values

","abstract":false,"def":{"name":"to_h","visibility":"Public","body":"{\"io\" => io}"}}]}]},{"html_id":"avram/Gen/Mixins","path":"Gen/Mixins.html","kind":"module","full_name":"Gen::Mixins","name":"Mixins","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"types":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","path":"Gen/Mixins/MigrationWithColumns.html","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SUPPORTED_TYPES","name":"SUPPORTED_TYPES","value":"{\"Bool\", \"Float64\", \"Int16\", \"Int32\", \"Int64\", \"String\", \"Time\", \"UUID\", \"JSON::Any\"}"}],"including_types":[{"html_id":"avram/Gen/Model","kind":"class","full_name":"Gen::Model","name":"Model"},{"html_id":"avram/Gen/Resource/Browser","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser"}],"namespace":{"html_id":"avram/Gen/Mixins","kind":"module","full_name":"Gen::Mixins","name":"Mixins"},"instance_methods":[{"html_id":"create_migration-instance-method","name":"create_migration","abstract":false,"location":{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L4"},"def":{"name":"create_migration","visibility":"Public","body":"(Avram::Migrator::MigrationGenerator.new(\"Create#{pluralized_name}\", migrate_contents: migrate_contents, rollback_contents: rollback_contents)).generate"}}]}]},{"html_id":"avram/Gen/Model","path":"Gen/Model.html","kind":"class","full_name":"Gen::Model","name":"Model","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"}],"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.model\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L11"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a model, query, and operations (save and delete)\""}}],"instance_methods":[{"html_id":"call(io:IO=STDOUT)-instance-method","name":"call","abstract":false,"args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"args_string":"(io : IO = STDOUT)","args_html":"(io : IO = STDOUT)","location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L14"},"def":{"name":"call","args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"@io = io\nif valid?\n template.render(\"./src/\")\n create_migration\n display_success_messages\nelse\n io.puts(@error.colorize(:red))\nend\n"}},{"html_id":"help_message-instance-method","name":"help_message","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L24"},"def":{"name":"help_message","visibility":"Public","body":"\"#{summary}\\n\\nExample:\\n\\n lucky gen.model Project title:String description:String? completed:Bool priority:Int32\""}},{"html_id":"io:IO-instance-method","name":"io","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L12"},"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@io"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}]},{"html_id":"avram/Gen/Resource","path":"Gen/Resource.html","kind":"module","full_name":"Gen::Resource","name":"Resource","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"types":[{"html_id":"avram/Gen/Resource/Browser","path":"Gen/Resource/Browser.html","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"}],"namespace":{"html_id":"avram/Gen/Resource","kind":"module","full_name":"Gen::Resource","name":"Resource"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.resource.browser\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L11"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a resource (model, operation, query, actions, and pages)\""}}],"instance_methods":[{"html_id":"call(io:IO=STDOUT)-instance-method","name":"call","abstract":false,"args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"args_string":"(io : IO = STDOUT)","args_html":"(io : IO = STDOUT)","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L34"},"def":{"name":"call","args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"begin\n @io = io\n validate!\n generate_resource\n io.puts(\"\\nYou will need to run the #{\"lucky db.migrate\".colorize.green} task next\")\n display_path_to_resource\nrescue e : InvalidOption\n io.puts(e.message.colorize.red)\nend"}},{"html_id":"help_message-instance-method","name":"help_message","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L20"},"def":{"name":"help_message","visibility":"Public","body":"\"#{summary}\\n\\nRequires the name of the resource and list of database columns. Columns\\nare passed as column_name:ColumnType. Where ColumnType are one of the\\nsupported Avram datatypes.\\n\\nExample:\\n\\n lucky gen.resource.browser Project title:String description:String? completed:Bool priority:Int32\""}},{"html_id":"io:IO-instance-method","name":"io","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L12"},"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@io"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}],"types":[{"html_id":"avram/Gen/Resource/Browser/InvalidOption","path":"Gen/Resource/Browser/InvalidOption.html","kind":"class","full_name":"Gen::Resource::Browser::InvalidOption","name":"InvalidOption","abstract":false,"superclass":{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L14"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen/Resource/Browser","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser"},"constructors":[{"html_id":"new(message:String)-class-method","name":"new","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(message : String)","args_html":"(message : String)","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/lucky/tasks/gen/resource/browser.cr#L15"},"def":{"name":"new","args":[{"name":"message","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]}]},{"html_id":"avram/Int16","path":"Int16.html","kind":"struct","full_name":"Int16","name":"Int16","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int16_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/int16_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L13"},{"filename":"src/avram/charms/int16_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L14"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int16/Lucky","path":"Int16/Lucky.html","kind":"module","full_name":"Int16::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int16","kind":"struct","full_name":"Int16","name":"Int16"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int16).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int16)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16)","args_html":"(value : Int16)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:Int16)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16)","args_html":"(value : Int16)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"visibility":"Public","body":"SuccessfulCast(Int16).new(value)"}},{"html_id":"parse(values:Array(Int16))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"args_string":"(values : Array(Int16))","args_html":"(values : Array(Int16))","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int16)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int16).new(value.to_i16)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L32"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int16).new(value.to_i16)\nrescue OverflowError\n FailedCast.new\nend"}},{"html_id":"to_db(value:Int16):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16) : String","args_html":"(value : Int16) : String","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L38"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int16))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"args_string":"(values : Array(Int16))","args_html":"(values : Array(Int16))","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L42"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int16/Lucky/ColumnType","path":"Int16/Lucky/ColumnType.html","kind":"alias","full_name":"Int16::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int16","aliased_html":"Int16","const":false,"namespace":{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"}},{"html_id":"avram/Int16/Lucky/Criteria","path":"Int16/Lucky/Criteria.html","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L46"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"}],"namespace":{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L47"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L49"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int16_extensions.cr#L58"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Int32","path":"Int32.html","kind":"struct","full_name":"Int32","name":"Int32","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int32_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/int32_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L19"},{"filename":"src/avram/charms/int32_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L20"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int32/Lucky","path":"Int32/Lucky.html","kind":"module","full_name":"Int32::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int32","kind":"struct","full_name":"Int32","name":"Int32"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int32).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int32)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int32).new(value.to_i)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Int32).new(value)"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L28"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int32).new(value.to_i32)\nrescue OverflowError\n FailedCast.new\nend"}},{"html_id":"parse(values:Array(Int32))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"args_string":"(values : Array(Int32))","args_html":"(values : Array(Int32))","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L34"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int32)).new(values)"}},{"html_id":"to_db(value:Int32):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32) : String","args_html":"(value : Int32) : String","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L38"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int32))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"args_string":"(values : Array(Int32))","args_html":"(values : Array(Int32))","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L42"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int32/Lucky/ColumnType","path":"Int32/Lucky/ColumnType.html","kind":"alias","full_name":"Int32::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int32","aliased_html":"Int32","const":false,"namespace":{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"}},{"html_id":"avram/Int32/Lucky/Criteria","path":"Int32/Lucky/Criteria.html","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L46"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"subclasses":[{"html_id":"avram/Enum/Lucky/Criteria","kind":"class","full_name":"Enum::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L47"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L48"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L50"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int32_extensions.cr#L59"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Int64","path":"Int64.html","kind":"struct","full_name":"Int64","name":"Int64","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int64_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/int64_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L25"},{"filename":"src/avram/charms/int64_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L26"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int64/Lucky","path":"Int64/Lucky.html","kind":"module","full_name":"Int64::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int64","kind":"struct","full_name":"Int64","name":"Int64"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int64).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int64)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"SuccessfulCast(Int64).new(value)"}},{"html_id":"parse(values:Array(Int64))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"args_string":"(values : Array(Int64))","args_html":"(values : Array(Int64))","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int64)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int64).new(value.to_i64)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L32"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Int64).new(value.to_i64)"}},{"html_id":"to_db(value:Int64):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64) : String","args_html":"(value : Int64) : String","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int64))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"args_string":"(values : Array(Int64))","args_html":"(values : Array(Int64))","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L40"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int64/Lucky/ColumnType","path":"Int64/Lucky/ColumnType.html","kind":"alias","full_name":"Int64::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int64","aliased_html":"Int64","const":false,"namespace":{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"}},{"html_id":"avram/Int64/Lucky/Criteria","path":"Int64/Lucky/Criteria.html","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L44"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L45"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L46"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L48"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/int64_extensions.cr#L57"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Nil","path":"Nil.html","kind":"struct","full_name":"Nil","name":"Nil","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/object.cr#L32"},{"filename":"src/avram/blank_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L37"},{"filename":"src/avram/object_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L50"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"The `Nil` type has only one possible value: `nil`.\n\n`nil` is commonly used to represent the absence of a value.\nFor example, `String#index` returns the position of the character or `nil` if it's not\nin the string:\n\n```\nstr = \"Hello world\"\nstr.index 'e' # => 1\nstr.index 'a' # => nil\n```\n\nIn the above example, trying to invoke a method on the returned value will\ngive a compile time error unless both `Int32` and `Nil` define that method:\n\n```\nstr = \"Hello world\"\nidx = str.index 'e'\nidx + 1 # Error: undefined method '+' for Nil\n```\n\nThe language and the standard library provide short, readable, easy ways to deal with `nil`,\nsuch as `Object#try` and `Object#not_nil!`:\n\n```\nstr = \"Hello world\"\n\n# The index of 'e' in str or 0 if not found\nidx1 = str.index('e') || 0\n\nidx2 = str.index('a')\nif idx2\n # Compiles: idx2 can't be nil here\n idx2 + 1\nend\n\n# Tell the compiler that we are sure the returned\n# value is not nil: raises a runtime exception\n# if our assumption doesn't hold.\nidx3 = str.index('o').not_nil!\n```\n\nSee [`Nil` literal](https://crystal-lang.org/reference/syntax_and_semantics/literals/nil.html) in the language reference.","summary":"

The Nil type has only one possible value: nil.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L55"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/Object","path":"Object.html","kind":"class","full_name":"Object","name":"Object","abstract":true,"ancestors":[{"html_id":"avram/Lucky/Memoizable","kind":"module","full_name":"Lucky::Memoizable","name":"Memoizable"},{"html_id":"avram/Lucky/QuickDef","kind":"module","full_name":"Lucky::QuickDef","name":"QuickDef"},{"html_id":"avram/Colorize/ObjectExtensions","kind":"module","full_name":"Colorize::ObjectExtensions","name":"ObjectExtensions"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/object.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Colorize/ObjectExtensions","kind":"module","full_name":"Colorize::ObjectExtensions","name":"ObjectExtensions"},{"html_id":"avram/Lucky/Memoizable","kind":"module","full_name":"Lucky::Memoizable","name":"Memoizable"},{"html_id":"avram/Lucky/QuickDef","kind":"module","full_name":"Lucky::QuickDef","name":"QuickDef"}],"doc":"`Object` is the base type of all Crystal objects.","summary":"

Object is the base type of all Crystal objects.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/object_extensions.cr#L14"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/Slice","path":"Slice.html","kind":"struct","full_name":"Slice(T)","name":"Slice","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"},{"html_id":"avram/Indexable","kind":"module","full_name":"Indexable","name":"Indexable"},{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"},{"html_id":"avram/Iterable","kind":"module","full_name":"Iterable","name":"Iterable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L61"},{"filename":"src/avram/charms/slice_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"}],"doc":"A `Slice` is a `Pointer` with an associated size.\n\nWhile a pointer is unsafe because no bound checks are performed when reading from and writing to it,\nreading from and writing to a slice involve bound checks.\nIn this way, a slice is a safe alternative to `Pointer`.\n\nA Slice can be created as read-only: trying to write to it\nwill raise. For example the slice of bytes returned by\n`String#to_slice` is read-only.","summary":"

A Slice is a Pointer with an associated size.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L62"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"empty?"}}],"types":[{"html_id":"avram/Slice/Lucky","path":"Slice/Lucky.html","kind":"module","full_name":"Slice::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Slice","kind":"struct","full_name":"Slice(T)","name":"Slice"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Bytes).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Bytes)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"parse(value.to_slice)"}},{"html_id":"parse(value:Bytes)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"SuccessfulCast(Bytes).new(value)"}},{"html_id":"to_db(value:Bytes)-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L26"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"ssize = (value.size * 2) + 2\nString.new(ssize) do |buffer|\n buffer[0] = '\\\\'.ord.to_u8\n buffer[1] = 'x'.ord.to_u8\n value.hexstring(buffer + 2)\n {ssize, ssize}\nend\n"}},{"html_id":"to_db(value:String):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"value"}}],"types":[{"html_id":"avram/Slice/Lucky/ColumnType","path":"Slice/Lucky/ColumnType.html","kind":"alias","full_name":"Slice::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Slice(UInt8)","aliased_html":"Slice(UInt8)","const":false,"namespace":{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"}},{"html_id":"avram/Slice/Lucky/Criteria","path":"Slice/Lucky/Criteria.html","kind":"class","full_name":"Slice::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/slice_extensions.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]},{"html_id":"avram/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/string_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/string_extensions.cr#L1"},{"filename":"src/avram/charms/string_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nA string might end up being composed of bytes which form an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but every\nbyte that doesn't start a valid UTF-8 byte sequence is interpreted as though\nit encodes the Unicode replacement character (U+FFFD) by itself. For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.\n\nNote that this interpretation only applies to methods inside Crystal; calling\n`#to_slice` or `#to_unsafe`, e.g. when passing a string to a C library, will\nexpose the invalid UTF-8 byte sequences. In particular, `Regex`'s underlying\nengine may reject strings that are not valid UTF-8, or it may invoke undefined\nbehavior on invalid strings. If this is undesired, `#scrub` could be used to\nremove the offending byte sequences first.","summary":"

A String represents an immutable sequence of UTF-8 characters.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"types":[{"html_id":"avram/String/Lucky","path":"String/Lucky.html","kind":"module","full_name":"String::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/String","kind":"class","full_name":"String","name":"String"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, String).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"SuccessfulCast(String).new(value)"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"SuccessfulCast(Array(String)).new(values)"}},{"html_id":"to_db(value:String):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L22"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"value"}},{"html_id":"to_db(values:Array(String))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L26"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/String/Lucky/ColumnType","path":"String/Lucky/ColumnType.html","kind":"alias","full_name":"String::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"String","aliased_html":"String","const":false,"namespace":{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"}},{"html_id":"avram/String/Lucky/Criteria","path":"String/Lucky/Criteria.html","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L30"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"ilike(value:String):T-instance-method","name":"ilike","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : T","args_html":"(value : String) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L37"},"def":{"name":"ilike","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Ilike.new(column, value))"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L31"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"like(value:String):T-instance-method","name":"like","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : T","args_html":"(value : String) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L33"},"def":{"name":"like","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Like.new(column, value))"}},{"html_id":"lower-instance-method","name":"lower","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L42"},"def":{"name":"lower","visibility":"Public","body":"Criteria(T, V).new(rows, \"LOWER(#{column})\")"}},{"html_id":"trim-instance-method","name":"trim","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L43"},"def":{"name":"trim","visibility":"Public","body":"Criteria(T, String).new(rows, \"TRIM(#{column})\")"}},{"html_id":"upper-instance-method","name":"upper","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/string_extensions.cr#L41"},"def":{"name":"upper","visibility":"Public","body":"Criteria(T, V).new(rows, \"UPPER(#{column})\")"}}]}]}]},{"html_id":"avram/Time","path":"Time.html","kind":"struct","full_name":"Time","name":"Time","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L7"},{"filename":"src/avram/charms/time_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"}],"doc":"`Time` represents a date-time instant in\n[incremental time](https://www.w3.org/International/articles/definitions-time/#incremental_time)\nobserved in a specific time zone.\n\nThe calendaric calculations are based on the rules of the proleptic Gregorian\ncalendar as specified in [ISO 8601](http://xml.coverpages.org/ISO-FDIS-8601.pdf).\nLeap seconds are ignored.\n\nInternally, the time is stored as an `Int64` representing seconds from epoch\n(`0001-01-01 00:00:00.0 UTC`) and an `Int32` representing\nnanosecond-of-second with value range `0..999_999_999`.\n\nThe supported date range is `0001-01-01 00:00:00.0` to\n`9999-12-31 23:59:59.999_999_999` in any local time zone.\n\n### Telling the Time\n\nThere are several methods to retrieve a `Time` instance representing the\ncurrent time:\n\n```\nTime.utc # returns the current time in UTC\nTime.local Time::Location.load(\"Europe/Berlin\") # returns the current time in time zone Europe/Berlin\nTime.local # returns the current time in current time zone\n```\n\nIt is generally recommended to keep instances in UTC and only apply a\nlocal time zone when formatting for user display, unless the domain logic\nrequires having a specific time zone (for example for calendaric operations).\n\n### Creating a Specific Instant\n\n`Time` instances representing a specific instant can be created by\n`.utc` or `.new` with the date-time specified as individual arguments:\n\n```\ntime = Time.utc(2016, 2, 15, 10, 20, 30)\ntime.to_s # => \"2016-02-15 10:20:30 UTC\"\ntime = Time.local(2016, 2, 15, 10, 20, 30, location: Time::Location.load(\"Europe/Berlin\"))\ntime.to_s # => \"2016-02-15 10:20:30 +01:00\"\n# The time-of-day can be omitted and defaults to midnight (start of day):\ntime = Time.utc(2016, 2, 15)\ntime.to_s # => \"2016-02-15 00:00:00 UTC\"\n```\n\n### Retrieving Time Information\n\nEach `Time` instance allows querying calendar data:\n\n```\ntime = Time.utc(2016, 2, 15, 10, 20, 30)\ntime.year # => 2016\ntime.month # => 2\ntime.day # => 15\ntime.hour # => 10\ntime.minute # => 20\ntime.second # => 30\ntime.millisecond # => 0\ntime.nanosecond # => 0\ntime.day_of_week # => Time::DayOfWeek::Monday\ntime.day_of_year # => 46\ntime.monday? # => true\ntime.time_of_day # => 10:20:30\n```\n\nFor querying if a time is at a specific day of week, `Time` offers named\npredicate methods, delegating to `#day_of_week`:\n\n```\ntime.monday? # => true\n# ...\ntime.sunday? # => false\n```\n\n### Time Zones\n\nEach time is attached to a specific time zone, represented by a `Location`\n(see `#location`).\n`#zone` returns the time zone observed in this location at the current time\n(i.e. the instant represented by this `Time`).\n`#offset` returns the offset of the current zone in seconds.\n\n```\ntime = Time.local(2018, 3, 8, 22, 5, 13, location: Time::Location.load(\"Europe/Berlin\"))\ntime # => 2018-03-08 22:05:13 +01:00 Europe/Berlin\ntime.location # => #\ntime.zone # => #\ntime.offset # => 3600\n```\n\nUsing `.utc`, the location is `Time::Location::UTC`:\n\n```\ntime = Time.utc(2018, 3, 8, 22, 5, 13)\ntime # => 2018-03-08 22:05:13.0 UTC\ntime.location # => #\ntime.zone # => #\ntime.offset # => 0\n```\n\nA `Time` instance can be transformed to a different time zone while retaining\nthe same instant using `#in`:\n\n```\ntime_de = Time.local(2018, 3, 8, 22, 5, 13, location: Time::Location.load(\"Europe/Berlin\"))\ntime_ar = time_de.in Time::Location.load(\"America/Buenos_Aires\")\ntime_de # => 2018-03-08 22:05:13 +01:00 Europe/Berlin\ntime_ar # => 2018-03-08 18:05:13 -03:00 America/Buenos_Aires\n```\n\nBoth `Time` instances show a different local date-time, but they represent\nthe same date-time in the instant time-line, therefore they are considered\nequal:\n\n```\ntime_de.to_utc # => 2018-03-08 21:05:13 UTC\ntime_ar.to_utc # => 2018-03-08 21:05:13 UTC\ntime_de == time_ar # => true\n```\n\nThere are also two special methods for converting to UTC and local time zone:\n\n```\ntime.to_utc # equals time.in(Location::UTC)\ntime.to_local # equals time.in(Location.local)\n```\n\n`#to_local_in` allows changing the time zone while keeping\nthe same local date-time (wall clock) which results in a different instant\non the time line.\n\n### Formatting and Parsing Time\n\nTo make date-time instances exchangeable between different computer systems\nor readable to humans, they are usually converted to and from a string\nrepresentation.\n\nThe method `#to_s` formats the date-time according to a specified pattern.\n\n```\ntime = Time.utc(2015, 10, 12, 10, 30, 0)\ntime.to_s(\"%Y-%m-%d %H:%M:%S %:z\") # => \"2015-10-12 10:30:00 +00:00\"\n```\n\nSimilarly, `Time.parse` and `Time.parse!` are used to construct a `Time` instance from date-time\ninformation in a string, according to a specified pattern:\n\n```\nTime.parse(\"2015-10-12 10:30:00 +00:00\", \"%Y-%m-%d %H:%M:%S %z\", Time::Location::UTC)\nTime.parse!(\"2015-10-12 10:30:00 +00:00\", \"%Y-%m-%d %H:%M:%S %z\")\n```\n\nSee `Time::Format` for all directives.\n\n### Calculations\n\n```\nTime.utc(2015, 10, 10) - 5.days # => 2015-10-05 00:00:00 +00:00\n\nspan = Time.utc(2015, 10, 10) - Time.utc(2015, 9, 10)\nspan.days # => 30\nspan.total_hours # => 720\nspan.total_minutes # => 43200\n```\n\n## Measuring Time\n\nThe typical time representation provided by the operating system is based on\na \"wall clock\" which is subject to changes for clock synchronization.\nThis can result in discontinuous jumps in the time-line making it not\nsuitable for accurately measuring elapsed time.\n\nInstances of `Time` are focused on telling time – using a \"wall clock\".\nWhen `Time.local` is called multiple times, the difference between the\nreturned instances is not guaranteed to equal to the time elapsed between\nmaking the calls; even the order of the returned `Time` instances might\nnot reflect invocation order.\n\n```\nt1 = Time.utc\n# operation that takes 1 minute\nt2 = Time.utc\nt2 - t1 # => ?\n```\n\nThe resulting `Time::Span` could be anything, even negative, if the\ncomputer's wall clock has changed between both calls.\n\nAs an alternative, the operating system also provides a monotonic clock.\nIts time-line has no specified starting point but is strictly linearly\nincreasing.\n\nThis monotonic clock should always be used for measuring elapsed time.\n\nA reading from this clock can be taken using `.monotonic`:\n\n```\nt1 = Time.monotonic\n# operation that takes 1 minute\nt2 = Time.monotonic\nt2 - t1 # => 1.minute (approximately)\n```\n\nThe execution time of a block can be measured using `.measure`:\n\n```\nelapsed_time = Time.measure do\n # operation that takes 20 milliseconds\nend\nelapsed_time # => 20.milliseconds (approximately)\n```","summary":"

Time represents a date-time instant in incremental time observed in a specific time zone.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L8"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Time/Lucky","path":"Time/Lucky.html","kind":"module","full_name":"Time::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"TIME_FORMATS","name":"TIME_FORMATS","value":"[Time::Format::ISO_8601_DATE_TIME, Time::Format::RFC_2822, Time::Format::RFC_3339, Time::Format.new(\"%Y-%m-%dT%H:%M:%S\", Time::Location::UTC), Time::Format.new(\"%Y-%m-%dT%H:%M\", Time::Location::UTC), Time::Format::HTTP_DATE, Time::Format::ISO_8601_DATE, Time::Format::ISO_8601_TIME]"}],"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Time","kind":"struct","full_name":"Time","name":"Time"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L25"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Time).new(query, column)"}},{"html_id":"try_parsing_with_default_formatters(value:String)-class-method","name":"try_parsing_with_default_formatters","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L42"},"def":{"name":"try_parsing_with_default_formatters","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"TIME_FORMATS.find do |format|\n begin\n format.parse(value)\n rescue e : Time::Format::Error\n nil\n end\nend.try do |format|\n SuccessfulCast.new((format.parse(value)).to_utc)\nend"}},{"html_id":"try_parsing_with_string_formats(value)-class-method","name":"try_parsing_with_string_formats","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L54"},"def":{"name":"try_parsing_with_string_formats","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"Avram.settings.time_formats.find do |format|\n begin\n Time.parse(value, format, Time::Location.load(\"UTC\"))\n rescue e : Time::Format::Error\n nil\n end\nend.try do |format|\n SuccessfulCast.new((Time.parse(value, format, Time::Location.load(\"UTC\"))).to_utc)\nend"}}],"instance_methods":[{"html_id":"from_db!(value:Time)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time)","args_html":"(value : Time)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L29"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Time"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String):SuccessfulCast(Time)|FailedCast-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : SuccessfulCast(Time) | FailedCast","args_html":"(value : String) : SuccessfulCast(Time) | FailedCast","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L33"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"SuccessfulCast(Time) | FailedCast","visibility":"Public","body":"((try_parsing_with_string_formats(value)) || (try_parsing_with_default_formatters(value))) || FailedCast.new"}},{"html_id":"parse(value:Time)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time)","args_html":"(value : Time)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L66"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Time"}],"visibility":"Public","body":"SuccessfulCast(Time).new(value)"}},{"html_id":"parse(values:Array(Time))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Time)"}],"args_string":"(values : Array(Time))","args_html":"(values : Array(Time))","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L70"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Time)"}],"visibility":"Public","body":"SuccessfulCast(Array(Time)).new(values)"}},{"html_id":"to_db(value:Time):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time) : String","args_html":"(value : Time) : String","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L74"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Time"}],"return_type":"String","visibility":"Public","body":"value.to_s(\"%F %X.%6N %z\")"}}],"types":[{"html_id":"avram/Time/Lucky/ColumnType","path":"Time/Lucky/ColumnType.html","kind":"alias","full_name":"Time::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Time","aliased_html":"Time","const":false,"namespace":{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"}},{"html_id":"avram/Time/Lucky/Criteria","path":"Time/Lucky/Criteria.html","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/ExtractCriteria","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L78"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/ExtractCriteria","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria"}],"namespace":{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"as_date-instance-method","name":"as_date","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L82"},"def":{"name":"as_date","visibility":"Public","body":"Criteria(T, String).new(rows, \"DATE(#{column})\")"}},{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L79"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"extract(chrono_unit:Avram::ChronoUnits)-instance-method","name":"extract","abstract":false,"args":[{"name":"chrono_unit","external_name":"chrono_unit","restriction":"Avram::ChronoUnits"}],"args_string":"(chrono_unit : Avram::ChronoUnits)","args_html":"(chrono_unit : Avram::ChronoUnits)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract","args":[{"name":"chrono_unit","external_name":"chrono_unit","restriction":"Avram::ChronoUnits"}],"visibility":"Public","body":"chrono_unit_in_sql_format = chrono_unit.to_s.underscore\napplied_operation = \"extract(#{chrono_unit_in_sql_format} from #{@column})\"\ncase chrono_unit\nwhen .julian?, .second?, .milliseconds?, .epoch?\n Criteria(T, Float64).new(rows, applied_operation)\nelse\n Criteria(T, Int32).new(rows, applied_operation)\nend\n"}},{"html_id":"extract(symbol:Symbol)-instance-method","name":"extract","abstract":false,"args":[{"name":"symbol","external_name":"symbol","restriction":"Symbol"}],"args_string":"(symbol : Symbol)","args_html":"(symbol : Symbol)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract","args":[{"name":"symbol","external_name":"symbol","restriction":"Symbol"}],"visibility":"Public","body":"if \"[century, day, decade, dow, doy, epoch, hour, isodow, isoyear, julian, microseconds, millennium, milliseconds, minute, month, quarter, second, timezone, timezone_hour, timezone_minute, week, year]\".includes?(symbol.to_s)\nelse\n raise(ArgumentError.new(\"Illegal value #{symbol} as a chrono unit. Allowed values are [century, day, decade, dow, doy, epoch, hour, isodow, isoyear, julian, microseconds, millennium, milliseconds, minute, month, quarter, second, timezone, timezone_hour, timezone_minute, week, year]\"))\nend\nchrono_unit_enum_member = symbol.to_s.camelcase\nextract(Avram::ChronoUnits.parse(chrono_unit_enum_member))\n"}},{"html_id":"extract_century-instance-method","name":"extract_century","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_century","visibility":"Public","body":"extract(:century)"}},{"html_id":"extract_day-instance-method","name":"extract_day","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_day","visibility":"Public","body":"extract(:day)"}},{"html_id":"extract_decade-instance-method","name":"extract_decade","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_decade","visibility":"Public","body":"extract(:decade)"}},{"html_id":"extract_dow-instance-method","name":"extract_dow","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_dow","visibility":"Public","body":"extract(:dow)"}},{"html_id":"extract_doy-instance-method","name":"extract_doy","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_doy","visibility":"Public","body":"extract(:doy)"}},{"html_id":"extract_epoch-instance-method","name":"extract_epoch","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_epoch","visibility":"Public","body":"extract(:epoch)"}},{"html_id":"extract_hour-instance-method","name":"extract_hour","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_hour","visibility":"Public","body":"extract(:hour)"}},{"html_id":"extract_isodow-instance-method","name":"extract_isodow","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_isodow","visibility":"Public","body":"extract(:isodow)"}},{"html_id":"extract_isoyear-instance-method","name":"extract_isoyear","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_isoyear","visibility":"Public","body":"extract(:isoyear)"}},{"html_id":"extract_julian-instance-method","name":"extract_julian","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_julian","visibility":"Public","body":"extract(:julian)"}},{"html_id":"extract_microseconds-instance-method","name":"extract_microseconds","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_microseconds","visibility":"Public","body":"extract(:microseconds)"}},{"html_id":"extract_millennium-instance-method","name":"extract_millennium","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_millennium","visibility":"Public","body":"extract(:millennium)"}},{"html_id":"extract_milliseconds-instance-method","name":"extract_milliseconds","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_milliseconds","visibility":"Public","body":"extract(:milliseconds)"}},{"html_id":"extract_minute-instance-method","name":"extract_minute","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_minute","visibility":"Public","body":"extract(:minute)"}},{"html_id":"extract_month-instance-method","name":"extract_month","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_month","visibility":"Public","body":"extract(:month)"}},{"html_id":"extract_quarter-instance-method","name":"extract_quarter","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_quarter","visibility":"Public","body":"extract(:quarter)"}},{"html_id":"extract_second-instance-method","name":"extract_second","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_second","visibility":"Public","body":"extract(:second)"}},{"html_id":"extract_timezone-instance-method","name":"extract_timezone","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone","visibility":"Public","body":"extract(:timezone)"}},{"html_id":"extract_timezone_hour-instance-method","name":"extract_timezone_hour","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone_hour","visibility":"Public","body":"extract(:timezone_hour)"}},{"html_id":"extract_timezone_minute-instance-method","name":"extract_timezone_minute","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone_minute","visibility":"Public","body":"extract(:timezone_minute)"}},{"html_id":"extract_week-instance-method","name":"extract_week","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_week","visibility":"Public","body":"extract(:week)"}},{"html_id":"extract_year-instance-method","name":"extract_year","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_year","visibility":"Public","body":"extract(:year)"}}]}]}]},{"html_id":"avram/UUID","path":"UUID.html","kind":"struct","full_name":"UUID","name":"UUID","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/uuid_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/lib/lucky/src/charms/uuid_extensions.cr#L1"},{"filename":"src/avram/blank_extensions.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L49"},{"filename":"src/avram/charms/uuid_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"doc":"Represents a UUID (Universally Unique IDentifier).\n\nNOTE: To use `UUID`, you must explicitly import it with `require \"uuid\"`","summary":"

Represents a UUID (Universally Unique IDentifier).

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/blank_extensions.cr#L50"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"false"}}],"types":[{"html_id":"avram/UUID/Lucky","path":"UUID/Lucky.html","kind":"module","full_name":"UUID::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/UUID","kind":"struct","full_name":"UUID","name":"UUID"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, UUID).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:UUID)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"UUID"}],"args_string":"(value : UUID)","args_html":"(value : UUID)","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"UUID"}],"visibility":"Public","body":"SuccessfulCast(UUID).new(value)"}},{"html_id":"parse(values:Array(UUID))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"args_string":"(values : Array(UUID))","args_html":"(values : Array(UUID))","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"visibility":"Public","body":"SuccessfulCast(Array(UUID)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(UUID).new(UUID.new(value))\nrescue\n FailedCast.new\nend"}},{"html_id":"to_db(value:UUID):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"UUID"}],"args_string":"(value : UUID) : String","args_html":"(value : UUID) : String","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L28"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"UUID"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(UUID))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"args_string":"(values : Array(UUID))","args_html":"(values : Array(UUID))","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L32"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/UUID/Lucky/ColumnType","path":"UUID/Lucky/ColumnType.html","kind":"alias","full_name":"UUID::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"UUID","aliased_html":"UUID","const":false,"namespace":{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}},{"html_id":"avram/UUID/Lucky/Criteria","path":"UUID/Lucky/Criteria.html","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L36"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/f5b000c26a5d04f54d166939cb1e7c1a3830da83/src/avram/charms/uuid_extensions.cr#L37"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}}]}]}]}]}}) \ No newline at end of file +crystal_doc_search_index_callback({"repository_name":"avram","body":"# Avram\n\n[![API Documentation Website](https://img.shields.io/website?down_color=red&down_message=Offline&label=API%20Documentation&up_message=Online&url=https%3A%2F%2Fluckyframework.github.io%2Favram%2F)](https://luckyframework.github.io/avram)\n\n### Why Avram?\n\nThe name comes from [Henriette Avram](https://en.wikipedia.org/wiki/Henriette_Avram).\n\n> Henriette Davidson Avram (October 7, 1919 – April 22, 2006) was a computer programmer and systems analyst who developed the MARC format (Machine Readable Cataloging), the international data standard for bibliographic and holdings information in libraries.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n avram:\n github: luckyframework/avram\n```\n\n## Usage\n\n```crystal\nrequire \"avram\"\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/luckyframework/avram/fork )\n1. Create your feature branch (git checkout -b my-new-feature)\n1. Install docker and docker-compose: https://docs.docker.com/compose/install/\n1. Run `script/setup`\n1. Make your changes\n1. Run `script/test` to run the specs, build shards, and check formatting\n1. Commit your changes (git commit -am 'Add some feature')\n1. Push to the branch (git push origin my-new-feature)\n1. Create a new Pull Request\n\n## Testing\n\nTo run the tests:\n\n1. Install docker and docker-compose: https://docs.docker.com/compose/install/\n1. Run `script/setup` to set up the docker environment\n1. Run `script/test` to run the specs, build shards, and check formatting\n\nYou can run individual tests like this: `docker-compose run --rm app crystal spec path/to/spec.cr`\n\n> Remember to run `docker-compose down` when you're done. This will stop the\n> Crystal container.\n\n## Contributors\n\n- [paulcsmith](https://github.com/paulcsmith) Paul Smith - creator, maintainer\n- [mikeeus](https://github.com/mikeeus) Mikias Abera - contributor\n","program":{"html_id":"avram/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"avram","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Array","path":"Array.html","kind":"class","full_name":"Array(T)","name":"Array","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"},{"html_id":"avram/Indexable","kind":"module","full_name":"Indexable","name":"Indexable"},{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"},{"html_id":"avram/Iterable","kind":"module","full_name":"Iterable","name":"Iterable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L55"},{"filename":"src/avram/charms/array_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/array_extensions.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L19"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"}],"doc":"An `Array` is an ordered, integer-indexed collection of objects of type T.\n\nArray indexing starts at 0. A negative index is assumed to be\nrelative to the end of the array: -1 indicates the last element,\n-2 is the next to last element, and so on.\n\nAn `Array` can be created using the usual `new` method (several are provided), or with an array literal:\n\n```\nArray(Int32).new # => []\n[1, 2, 3] # Array(Int32)\n[1, \"hello\", 'x'] # Array(Int32 | String | Char)\n```\n\nSee [`Array` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/array.html) in the language reference.\n\nAn `Array` can have mixed types, meaning T will be a union of types, but these are determined\nwhen the array is created, either by specifying T or by using an array literal. In the latter\ncase, T will be set to the union of the array literal elements' types.\n\nWhen creating an empty array you must always specify T:\n\n```\n[] of Int32 # same as Array(Int32)\n[] # syntax error\n```\n\nAn `Array` is implemented using an internal buffer of some capacity\nand is reallocated when elements are pushed to it when more capacity\nis needed. This is normally known as a [dynamic array](http://en.wikipedia.org/wiki/Dynamic_array).\n\nYou can use a special array literal syntax with other types too, as long as they define an argless\n`new` method and a `<<` method. `Set` is one such type:\n\n```\nset = Set{1, 2, 3} # => Set{1, 2, 3}\nset.class # => Set(Int32)\n```\n\nThe above is the same as this:\n\n```\nset = Set(typeof(1, 2, 3)).new\nset << 1\nset << 2\nset << 3\n```","summary":"

An Array is an ordered, integer-indexed collection of objects of type T.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","doc":"Proxy to the `T`'s adapter so we can call methods like\n`Array(String).adapter.to_db([\"test\"])`","summary":"

Proxy to the T's adapter so we can call methods like Array(String).adapter.to_db(["test"])

","abstract":false,"location":{"filename":"src/avram/charms/array_extensions.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/array_extensions.cr#L4"},"def":{"name":"adapter","visibility":"Public","body":"T.adapter"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L56"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"empty?"}},{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","doc":"Arrays of any size should be considered present","summary":"

Arrays of any size should be considered present

","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L21"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"false"}}]},{"html_id":"avram/Avram","path":"Avram.html","kind":"module","full_name":"Avram","name":"Avram","abstract":false,"ancestors":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"locations":[{"filename":"src/avram.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L25"},{"filename":"src/avram/chrono_units.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L1"},{"filename":"src/avram/criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L1"},{"filename":"src/avram/database/column_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L1"},{"filename":"src/avram/database/database_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L1"},{"filename":"src/avram/database/table_info.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L1"},{"filename":"src/avram/errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L1"},{"filename":"src/avram/order_by_clause.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L1"},{"filename":"src/avram/order_by_clause/order_by.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L1"},{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L1"},{"filename":"src/avram/version.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/version.cr#L1"},{"filename":"src/lucky/ext/avram/errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"FailedQueryLog","name":"FailedQueryLog","value":"Log.for(\"failed_query\")"},{"id":"HABITAT_SETTINGS","name":"HABITAT_SETTINGS","value":"[{decl: lazy_load_enabled : Bool = true, example: nil, validation: nil}, {decl: database_to_migrate : Avram::Database.class, example: \"AppDatabase\", validation: nil}, {decl: time_formats : Array(String) = [] of String, example: nil, validation: nil}, {decl: i18n_backend : Avram::I18nBackend = Avram::I18n.new, example: \"Avram::I18n.new\", validation: nil}, {decl: query_cache_enabled : Bool = false, example: nil, validation: nil}] of Nil"},{"id":"Log","name":"Log","value":"::Log.for(Avram)"},{"id":"QueryLog","name":"QueryLog","value":"Log.for(\"query\")"},{"id":"SaveFailedLog","name":"SaveFailedLog","value":"Log.for(\"save_failed\")"},{"id":"VERSION","name":"VERSION","value":"\"1.1.1\""}],"included_modules":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"class_methods":[{"html_id":"configure(&)-class-method","name":"configure","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L26"},"def":{"name":"configure","yields":1,"block_arity":1,"visibility":"Public","body":"yield settings"}},{"html_id":"initialize_logging-class-method","name":"initialize_logging","doc":"This subscribes to several `Pulsar` events.\nThese events are triggered during query and\noperation events","summary":"

This subscribes to several Pulsar events.

","abstract":false,"location":{"filename":"src/avram.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L44"},"def":{"name":"initialize_logging","visibility":"Public","body":"Avram::Events::QueryEvent.subscribe do |event, duration|\n if event.query.starts_with?(\"TRUNCATE\")\n next\n end\n Avram::QueryLog.dexter.info do\n queryable = event.queryable\n log_data = {query: event.query, args: event.args, duration: Pulsar.elapsed_text(duration)}\n if queryable\n {model: queryable}.merge(log_data)\n else\n log_data\n end\n end\nend\nAvram::Events::FailedQueryEvent.subscribe do |event|\n Avram::FailedQueryLog.dexter.error do\n queryable = event.queryable\n log_data = {error_message: event.error_message, query: event.query, args: \"[FILTERED]\"}\n if queryable\n {model: queryable}.merge(log_data)\n else\n log_data\n end\n end\nend\nAvram::Events::SaveFailedEvent.subscribe do |event|\n Avram::SaveFailedLog.dexter.warn do\n {failed_to_save: event.operation_class, validation_errors: event.error_messages_as_string}\n end\nend\n"}},{"html_id":"settings-class-method","name":"settings","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L26"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"instance_methods":[{"html_id":"settings-instance-method","name":"settings","abstract":false,"location":{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L26"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"types":[{"html_id":"avram/Avram/AddColumnAttributes","path":"Avram/AddColumnAttributes.html","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes","abstract":false,"locations":[{"filename":"src/avram/add_column_attributes.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/add_column_attributes.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"This module creates methods for each column in a model that map\nto an `Avram::Attribute` as well as methods that fill those attributes\nwith values that comes from params.","summary":"

This module creates methods for each column in a model that map to an Avram::Attribute as well as methods that fill those attributes with values that comes from params.

"},{"html_id":"avram/Avram/Associations","path":"Avram/Associations.html","kind":"module","full_name":"Avram::Associations","name":"Associations","abstract":false,"ancestors":[{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"}],"locations":[{"filename":"src/avram/associations.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations.cr#L3"},{"filename":"src/avram/associations/belongs_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/belongs_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"}],"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Associations/BelongsTo","path":"Avram/Associations/BelongsTo.html","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo","abstract":false,"locations":[{"filename":"src/avram/associations/belongs_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/belongs_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"belongs_to(type_declaration,foreign_key=nil)-macro","name":"belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, foreign_key = nil)","args_html":"(type_declaration, foreign_key = nil)","location":{"filename":"src/avram/associations/belongs_to.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/belongs_to.cr#L2"},"def":{"name":"belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if type_declaration.type.is_a?(Union) %}\n {% model = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% model = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n\n \n{% if !foreign_key %}\n {% foreign_key = \"#{assoc_name}_id\".id %}\n {% end %}\n\n\n column \n{{ foreign_key.id }}\n : \n{{ model }}\n::PrimaryKeyType\n{% if nilable %}?{% end %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name.id }}\n,\n type: \n{{ model }}\n,\n foreign_key: :\n{{ foreign_key.id }}\n,\n relationship_type: :belongs_to\n\n define_belongs_to_private_assoc_getter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key.id }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_public_preloaded_getters(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_preloaded_setter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n define_belongs_to_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key.id }}\n)\n \n"}}]},{"html_id":"avram/Avram/Associations/HasMany","path":"Avram/Associations/HasMany.html","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany","abstract":false,"locations":[{"filename":"src/avram/associations/has_many.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/has_many.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"has_many(type_declaration,through=nil,foreign_key=nil)-macro","name":"has_many","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, through = nil, foreign_key = nil)","args_html":"(type_declaration, through = nil, foreign_key = nil)","location":{"filename":"src/avram/associations/has_many.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/has_many.cr#L2"},"def":{"name":"has_many","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% if (!through.is_a?(NilLiteral)) && ((!through.is_a?(ArrayLiteral)) || through.any? do |item|\n !item.is_a?(SymbolLiteral)\nend) %}\n {% through.raise(\"'through' on #{@type.name} must be given an Array(Symbol). Instead, got: #{through}\\n\\nExample...\\n has_many comments : Comment\\n has_many related_authors : User, through: [:comments, :author]\\n\\nLearn more about associations: https://luckyframework.org/guides/database/models#model-associations\") %}\n {% end %}\n\n \n{% if (!through.is_a?(NilLiteral)) && through.size < 2 %}\n {% through.raise(\"'through' on #{@type.name} must be given at least two items. Instead, got: #{through}\\n\\nExample...\\n has_many comments : Comment\\n has_many related_authors : User, through: [:comments, :author]\\n\\nLearn more about associations: https://luckyframework.org/guides/database/models#model-associations\") %}\n {% end %}\n\n \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if foreign_key %}{% else %}\n {% foreign_key = \"#{(@type.name.underscore.split(\"::\")).last.id}_id\".id %}\n {% end %}\n\n\n \n{% foreign_key = foreign_key.id %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name }}\n,\n type: \n{{ type_declaration.type }}\n,\n foreign_key: :\n{{ foreign_key }}\n,\n through: \n{{ through }}\n,\n relationship_type: :has_many\n\n \n{% model = type_declaration.type %}\n\n\n define_has_many_lazy_loading(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ through }}\n)\n define_has_many_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ through }}\n)\n \n"}}]},{"html_id":"avram/Avram/Associations/HasOne","path":"Avram/Associations/HasOne.html","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne","abstract":false,"locations":[{"filename":"src/avram/associations/has_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/has_one.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"}],"namespace":{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},"macros":[{"html_id":"has_one(type_declaration,foreign_key=nil)-macro","name":"has_one","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"args_string":"(type_declaration, foreign_key = nil)","args_html":"(type_declaration, foreign_key = nil)","location":{"filename":"src/avram/associations/has_one.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/associations/has_one.cr#L2"},"def":{"name":"has_one","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""}],"visibility":"Public","body":" \n{% assoc_name = type_declaration.var %}\n\n\n \n{% if type_declaration.type.is_a?(Union) %}\n {% model = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% model = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n\n \n{% if foreign_key %}{% else %}\n {% foreign_key = \"#{(@type.name.underscore.split(\"::\")).last.id}_id\".id %}\n {% end %}\n\n\n \n{% foreign_key = foreign_key.id %}\n\n\n association \\\n assoc_name: :\n{{ assoc_name.id }}\n,\n type: \n{{ model }}\n,\n foreign_key: :\n{{ foreign_key.id }}\n,\n relationship_type: :has_one\n\n Avram::Associations.__define_public_preloaded_getters(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n Avram::Associations.__define_preloaded_setter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ nilable }}\n)\n define_has_one_private_assoc_getter(\n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n, \n{{ nilable }}\n)\n define_has_one_base_query(\n{{ @type }}\n, \n{{ assoc_name }}\n, \n{{ model }}\n, \n{{ foreign_key }}\n)\n \n"}}]}]},{"html_id":"avram/Avram/Attribute","path":"Avram/Attribute.html","kind":"class","full_name":"Avram::Attribute(T)","name":"Attribute","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/attribute.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/PermittedAttribute","kind":"class","full_name":"Avram::PermittedAttribute(T)","name":"PermittedAttribute"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(name:Symbol,value:T|Nil,param_key:String,param:Array(String)|Avram::Uploadable|String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::Symbol"},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"::String"},{"name":"param","default_value":"nil","external_name":"param","restriction":"::Array(::String) | ::Avram::Uploadable | ::String | ::Nil"}],"args_string":"(name : Symbol, value : T | Nil, param_key : String, param : Array(String) | Avram::Uploadable | String | Nil = nil)","args_html":"(name : Symbol, value : T | Nil, param_key : String, param : Array(String) | Avram::Uploadable | String | Nil = nil)","location":{"filename":"src/avram/attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::Symbol"},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"::String"},{"name":"param","default_value":"nil","external_name":"param","restriction":"::Array(::String) | ::Avram::Uploadable | ::String | ::Nil"}],"visibility":"Public","body":"_ = Attribute(T).allocate\n_.initialize(name, value, param_key, param)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"[](key)-instance-method","name":"[]","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/attribute.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L167"},"def":{"name":"[]","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":"call_value_instead_error_message(\".[key]\")"}},{"html_id":"[]?(key)-instance-method","name":"[]?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/attribute.cr","line_number":171,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L171"},"def":{"name":"[]?","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":"call_value_instead_error_message(\".[key]?\")"}},{"html_id":"add_error(message:String=\"isinvalid\")-instance-method","name":"add_error","abstract":false,"args":[{"name":"message","default_value":"\"is invalid\"","external_name":"message","restriction":"String"}],"args_string":"(message : String = \"is invalid\")","args_html":"(message : String = "is invalid")","location":{"filename":"src/avram/attribute.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L34"},"def":{"name":"add_error","args":[{"name":"message","default_value":"\"is invalid\"","external_name":"message","restriction":"String"}],"visibility":"Public","body":"@errors << message"}},{"html_id":"add_error(message:Proc|Avram::CallableErrorMessage)-instance-method","name":"add_error","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"Proc | Avram::CallableErrorMessage"}],"args_string":"(message : Proc | Avram::CallableErrorMessage)","args_html":"(message : Proc | Avram::CallableErrorMessage)","location":{"filename":"src/avram/attribute.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L38"},"def":{"name":"add_error","args":[{"name":"message","external_name":"message","restriction":"Proc | Avram::CallableErrorMessage"}],"visibility":"Public","body":"message_string = message.call(@name.to_s, @value.to_s)\nadd_error(message_string)\n"}},{"html_id":"allow_blank=(allow_blank:Bool)-instance-method","name":"allow_blank=","doc":"This can be used as an escape hatch when you\nmay have a blank string that's allowed to be saved.","summary":"

This can be used as an escape hatch when you may have a blank string that's allowed to be saved.

","abstract":false,"args":[{"name":"allow_blank","external_name":"allow_blank","restriction":"Bool"}],"args_string":"(allow_blank : Bool)","args_html":"(allow_blank : Bool)","location":{"filename":"src/avram/attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L11"},"def":{"name":"allow_blank=","args":[{"name":"allow_blank","external_name":"allow_blank","restriction":"Bool"}],"visibility":"Public","body":"@allow_blank = allow_blank"}},{"html_id":"allow_blank?:Bool-instance-method","name":"allow_blank?","doc":"This can be used as an escape hatch when you\nmay have a blank string that's allowed to be saved.","summary":"

This can be used as an escape hatch when you may have a blank string that's allowed to be saved.

","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L11"},"def":{"name":"allow_blank?","return_type":"Bool","visibility":"Public","body":"@allow_blank"}},{"html_id":"changed?(from:T|Nil|Nothing=Nothing.new,to:T|Nil|Nothing=Nothing.new):Bool-instance-method","name":"changed?","abstract":false,"args":[{"name":"from","default_value":"Nothing.new","external_name":"from","restriction":"T | ::Nil | Nothing"},{"name":"to","default_value":"Nothing.new","external_name":"to","restriction":"T | ::Nil | Nothing"}],"args_string":"(from : T | Nil | Nothing = Nothing.new, to : T | Nil | Nothing = Nothing.new) : Bool","args_html":"(from : T | Nil | Nothing = Nothing.new, to : T | Nil | Nothing = Nothing.new) : Bool","location":{"filename":"src/avram/attribute.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L79"},"def":{"name":"changed?","args":[{"name":"from","default_value":"Nothing.new","external_name":"from","restriction":"T | ::Nil | Nothing"},{"name":"to","default_value":"Nothing.new","external_name":"to","restriction":"T | ::Nil | Nothing"}],"return_type":"Bool","visibility":"Public","body":"from = from.is_a?(Nothing) ? true : from == original_value\nto = to.is_a?(Nothing) ? true : to == value\n((value != original_value) && from) && to\n"}},{"html_id":"errors:Array(String)-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L47"},"def":{"name":"errors","return_type":"Array(String)","visibility":"Public","body":"@errors.uniq"}},{"html_id":"extract(params:Avram::Paramable)-instance-method","name":"extract","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/attribute.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L85"},"def":{"name":"extract","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"}],"visibility":"Public","body":"extract(params, type: T)"}},{"html_id":"name:Symbol-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L3"},"def":{"name":"name","return_type":"Symbol","visibility":"Public","body":"@name"}},{"html_id":"original_value:T|Nil-instance-method","name":"original_value","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L59"},"def":{"name":"original_value","return_type":"T | ::Nil","visibility":"Public","body":"if allow_blank?\n @original_value\nelse\n ensure_no_blank(@original_value)\nend"}},{"html_id":"param:Avram::Uploadable|Array(String)|String-instance-method","name":"param","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L30"},"def":{"name":"param","return_type":"Avram::Uploadable | Array(String) | String","visibility":"Public","body":"@param || value.to_s"}},{"html_id":"param_key:String-instance-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L5"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"@param_key"}},{"html_id":"permitted-instance-method","name":"permitted","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L19"},"def":{"name":"permitted","visibility":"Public","body":"@_permitted || (@_permitted = (Avram::PermittedAttribute(T).new(name: @name, param: @param, value: @value, param_key: @param_key).tap do |attribute|\n attribute.allow_blank = allow_blank?\n errors.each do |error|\n attribute.add_error(error)\n end\nend))"}},{"html_id":"reset_errors-instance-method","name":"reset_errors","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L43"},"def":{"name":"reset_errors","visibility":"Public","body":"@errors = [] of String"}},{"html_id":"to_f-instance-method","name":"to_f","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":159,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L159"},"def":{"name":"to_f","visibility":"Public","body":"call_value_instead_error_message(\".to_f\")"}},{"html_id":"to_f64-instance-method","name":"to_f64","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":163,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L163"},"def":{"name":"to_f64","visibility":"Public","body":"call_value_instead_error_message(\".to_f64\")"}},{"html_id":"to_i-instance-method","name":"to_i","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L147"},"def":{"name":"to_i","visibility":"Public","body":"call_value_instead_error_message(\".to_i\")"}},{"html_id":"to_i32-instance-method","name":"to_i32","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":151,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L151"},"def":{"name":"to_i32","visibility":"Public","body":"call_value_instead_error_message(\".to_i32\")"}},{"html_id":"to_i64-instance-method","name":"to_i64","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L155"},"def":{"name":"to_i64","visibility":"Public","body":"call_value_instead_error_message(\".to_i64\")"}},{"html_id":"to_s(time_format:String)-instance-method","name":"to_s","doc":"NOTE: to_s(io : IO) is used when passing an object\nin to string interpolation. Don't override that method.","summary":"

NOTE to_s(io : IO) is used when passing an object in to string interpolation.

","abstract":false,"args":[{"name":"time_format","external_name":"time_format","restriction":"String"}],"args_string":"(time_format : String)","args_html":"(time_format : String)","location":{"filename":"src/avram/attribute.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L143"},"def":{"name":"to_s","args":[{"name":"time_format","external_name":"time_format","restriction":"String"}],"visibility":"Public","body":"call_value_instead_error_message(\".to_s(...)\")"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"These methods may accidentally get called on attributes\ninside of operations. Since these methods don't exist,\nchances are, you meant to call them on the value.\n```\nusername.to_s\n# VS\nusername.value.to_s\n```","summary":"

These methods may accidentally get called on attributes inside of operations.

","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L137"},"def":{"name":"to_s","visibility":"Public","body":"call_value_instead_error_message(\".to_s\")"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L75"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"errors.empty?"}},{"html_id":"value:T|Nil-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/attribute.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L51"},"def":{"name":"value","return_type":"T | ::Nil","visibility":"Public","body":"if allow_blank?\n @value\nelse\n ensure_no_blank(@value)\nend"}},{"html_id":"value=(value:T|Nil)-instance-method","name":"value=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T | ::Nil"}],"args_string":"(value : T | Nil)","args_html":"(value : T | Nil)","location":{"filename":"src/avram/attribute.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L4"},"def":{"name":"value=","args":[{"name":"value","external_name":"value","restriction":"T | ::Nil"}],"visibility":"Public","body":"@value = value"}}],"macros":[{"html_id":"call_value_instead_error_message(method)-macro","name":"call_value_instead_error_message","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""}],"args_string":"(method)","args_html":"(method)","location":{"filename":"src/avram/attribute.cr","line_number":175,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L175"},"def":{"name":"call_value_instead_error_message","args":[{"name":"method","external_name":"method","restriction":""}],"visibility":"Public","body":" \n{% raise(\"\\nThe #{method.id} method should not be called directly on attributes (#{@type}).\\nDid you mean to call it on the value property?\\n\\nTry this...\\n\\n ▸ attribute.value#{method.id}\\n\") %}\n\n \n"}}],"types":[{"html_id":"avram/Avram/Attribute/ErrorMessage","path":"Avram/Attribute/ErrorMessage.html","kind":"alias","full_name":"Avram::Attribute::ErrorMessage","name":"ErrorMessage","abstract":false,"locations":[{"filename":"src/avram/attribute.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Avram::CallableErrorMessage | Proc(String, String, String) | String)","aliased_html":"Avram::CallableErrorMessage | String, String -> String | String","const":false,"namespace":{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute(T)","name":"Attribute"}}]},{"html_id":"avram/Avram/AvramError","path":"Avram/AvramError.html","kind":"class","full_name":"Avram::AvramError","name":"AvramError","abstract":false,"superclass":{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/ConnectionError","kind":"class","full_name":"Avram::ConnectionError","name":"ConnectionError"},{"html_id":"avram/Avram/FailedMigration","kind":"class","full_name":"Avram::FailedMigration","name":"FailedMigration"},{"html_id":"avram/Avram/FailedOperation","kind":"class","full_name":"Avram::FailedOperation","name":"FailedOperation"},{"html_id":"avram/Avram/ImpossibleValidation","kind":"class","full_name":"Avram::ImpossibleValidation","name":"ImpossibleValidation"},{"html_id":"avram/Avram/InvalidDatabaseNameError","kind":"class","full_name":"Avram::InvalidDatabaseNameError","name":"InvalidDatabaseNameError"},{"html_id":"avram/Avram/InvalidOperationError","kind":"class","full_name":"Avram::InvalidOperationError","name":"InvalidOperationError"},{"html_id":"avram/Avram/InvalidQueryError","kind":"class","full_name":"Avram::InvalidQueryError","name":"InvalidQueryError"},{"html_id":"avram/Avram/LazyLoadError","kind":"class","full_name":"Avram::LazyLoadError","name":"LazyLoadError"},{"html_id":"avram/Avram/MissingRequiredAssociationError","kind":"class","full_name":"Avram::MissingRequiredAssociationError","name":"MissingRequiredAssociationError"},{"html_id":"avram/Avram/PGClientNotInstalledError","kind":"class","full_name":"Avram::PGClientNotInstalledError","name":"PGClientNotInstalledError"},{"html_id":"avram/Avram/PGNotRunningError","kind":"class","full_name":"Avram::PGNotRunningError","name":"PGNotRunningError"},{"html_id":"avram/Avram/RecordNotFoundError","kind":"class","full_name":"Avram::RecordNotFoundError","name":"RecordNotFoundError"},{"html_id":"avram/Avram/Rollback","kind":"class","full_name":"Avram::Rollback","name":"Rollback"},{"html_id":"avram/Avram/SchemaMismatchError","kind":"class","full_name":"Avram::SchemaMismatchError","name":"SchemaMismatchError"},{"html_id":"avram/Avram/UnsupportedQueryError","kind":"class","full_name":"Avram::UnsupportedQueryError","name":"UnsupportedQueryError"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Generic Avram exception class.","summary":"

Generic Avram exception class.

"},{"html_id":"avram/Avram/BaseQueryTemplate","path":"Avram/BaseQueryTemplate.html","kind":"class","full_name":"Avram::BaseQueryTemplate","name":"BaseQueryTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/base_query_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/base_query_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,associations,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, associations, *args, **named_args)","args_html":"(type, columns, associations, *args, **named_args)","location":{"filename":"src/avram/base_query_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/base_query_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":3,"visibility":"Public","body":" class ::\n{{ type }}\n::BaseQuery\n def_clone\n include Avram::Queryable(\n{{ type }}\n)\n\n \n{% if type.resolve.has_constant?(\"PRIMARY_KEY_NAME\") %}\n include Avram::PrimaryKeyQueryable({{ type }})\n {% end %}\n\n\n macro generate_criteria_method(name, type)\n def \n\\{\n{ name }}\n \n\\{\n{ type }}.adapter.criteria(self, \"#{table_name}.\n\\{\n{ name }}\")\n \nend\n \nend\n\n def update(\n \n{% for column in columns %}\n {{ column[:name] }} : {{ column[:type] }} | Avram::Nothing{% if column[:nilable] %} | Nil{% end %} = Avram::Nothing.new,\n {% end %}\n\n ) : Int64\n\n _changes = \n{} of Symbol => String?\n\n \n{% for column in columns %}\n if {{ column[:name] }}.nil?\n _changes[:{{ column[:name] }}] = nil\n elsif {{ column[:name] }}.is_a?(Avram::Nothing)\n nil\n else\n value = {{ column[:name] }}.not_nil!.class.adapter.to_db({{ column[:name] }}).to_s\n _changes[:{{ column[:name] }}] = value\n end\n {% end %}\n\n\n database.exec(\n query.statement_for_update(_changes, return_columns: false),\n args: query.args_for_update(_changes)\n ).rows_affected\n \nend\n\n \n{% for column in columns %}\n def {{ column[:name] }}(value)\n {{ column[:name] }}.eq(value)\n end\n\n generate_criteria_method({{ column[:name] }}, {{ column[:type] }})\n\n macro inherited\n generate_criteria_method({{ column[:name] }}, {{ column[:type] }})\n end\n {% end %}\n\n\n \n{% for assoc in associations %}\n def join_{{ assoc[:assoc_name] }}\n inner_join_{{ assoc[:assoc_name] }}\n end\n\n {% for join_type in [\"Inner\", \"Left\", \"Right\", \"Full\"] %}\n def {{ join_type.downcase.id }}_join_{{ assoc[:assoc_name] }}\n {% if assoc[:relationship_type] == (:belongs_to) %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n primary_key: {{ assoc[:foreign_key].id.symbolize }},\n foreign_key: {{ assoc[:type] }}::PRIMARY_KEY_NAME\n )\n )\n {% else %}{% if assoc[:relationship_type] == (:has_one) %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n foreign_key: {{ assoc[:foreign_key].id.symbolize }},\n primary_key: primary_key_name\n )\n )\n {% else %}{% if assoc[:through] %}\n {{ join_type.downcase.id }}_join_{{ assoc[:through].first.id }}\n .__yield_where_{{ assoc[:through].first.id }} do |join_query|\n join_query.{{ join_type.downcase.id }}_join_{{ assoc[:through][1].id }}\n end\n {% else %}\n join(\n Avram::Join::{{ join_type.id }}.new(\n from: table_name,\n to: {{ assoc[:type] }}.table_name,\n foreign_key: {{ assoc[:foreign_key] }},\n primary_key: primary_key_name\n )\n )\n {% end %}{% end %}{% end %}\n end\n {% end %}\n\n\n def where_{{ assoc[:assoc_name] }}(assoc_query : {{ assoc[:type] }}::BaseQuery, auto_inner_join : Bool = true)\n if auto_inner_join\n join_{{ assoc[:assoc_name] }}.merge_query(assoc_query.query)\n else\n merge_query(assoc_query.query)\n end\n end\n\n # :nodoc:\n # Used internally for has_many through queries\n def __yield_where_{{ assoc[:assoc_name] }}\n assoc_query = yield {{ assoc[:type] }}::BaseQuery.new\n merge_query(assoc_query.query)\n end\n {% end %}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/BetweenCriteria","path":"Avram/BetweenCriteria.html","kind":"module","full_name":"Avram::BetweenCriteria(T, V)","name":"BetweenCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/between_criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria_extensions/between_criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Float64/Lucky/Criteria","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int16/Lucky/Criteria","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/CallableErrorMessage","path":"Avram/CallableErrorMessage.html","kind":"module","full_name":"Avram::CallableErrorMessage","name":"CallableErrorMessage","abstract":false,"locations":[{"filename":"src/avram/validations/callable_error_message.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations/callable_error_message.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"call(attribute_name,attribute_value)-instance-method","name":"call","abstract":true,"args":[{"name":"attribute_name","external_name":"attribute_name","restriction":""},{"name":"attribute_value","external_name":"attribute_value","restriction":""}],"args_string":"(attribute_name, attribute_value)","args_html":"(attribute_name, attribute_value)","location":{"filename":"src/avram/validations/callable_error_message.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations/callable_error_message.cr#L2"},"def":{"name":"call","args":[{"name":"attribute_name","external_name":"attribute_name","restriction":""},{"name":"attribute_value","external_name":"attribute_value","restriction":""}],"visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Callbacks","path":"Avram/Callbacks.html","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks","abstract":false,"locations":[{"filename":"src/avram/callbacks.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"after_commit(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_commit","doc":"Run the given method after save and after successful transaction commit\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_commit notify_post_author\n\n private def notify_post_author(comment : Comment)\n NewCommentNotificationEmail.new(comment, to: comment.author!).deliver_now\n end\nend\n```\n","summary":"

Run the given method after save and after successful transaction commit

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":439,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L439"},"def":{"name":"after_commit","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_commit, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_commit, {{ method_name }}, :unless)\n {% end %}\n\n after_commit(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_commit(if_if=nil,unless_unless=nil,&block)-macro","name":"after_commit","doc":"Run the given block after save and after successful transaction commit\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_commit do |comment|\n NewCommentNotificationEmail.new(comment, to: comment.author!).deliver_now\n end\nend\n```","summary":"

Run the given block after save and after successful transaction commit

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":462,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L462"},"def":{"name":"after_commit","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_commit callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_commit, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_commit, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_commit' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_commit do |saved_user|\\n some_method(saved_user)\\n end\")\nend %}\n\n def after_commit(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_commit).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"after_delete(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_delete","doc":"Same as `after_save` but with a different name","summary":"

Same as after_save but with a different name

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":243,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L243"},"def":{"name":"after_delete","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_delete, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_delete, {{ method_name }}, :unless)\n {% end %}\n\n after_delete(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_delete(if_if=nil,unless_unless=nil,&block)-macro","name":"after_delete","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":323,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L323"},"def":{"name":"after_delete","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_delete callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_delete, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_delete, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_delete' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_delete do |deleted_user|\\n some_method(deleted_user)\\n end\")\nend %}\n\n def after_delete(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_delete).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"after_run(method_name)-macro","name":"after_run","doc":"Run the given method after `run` is called on an `Operation`.\nThe return value of the `run` method is passed to `method_name`.\n\n```\nafter_run :log_entry\n\nprivate def log_entry(value)\n log_stuff(value)\nend\n```","summary":"

Run the given method after run is called on an Operation.

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/avram/callbacks.cr","line_number":378,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L378"},"def":{"name":"after_run","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" after_run do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_run(&block)-macro","name":"after_run","doc":"Run the given block after the operation runs\n\nThe return value from `run` will be passed to this block.\n\n```\nclass GenerateReport < Avram::Operation\n after_run do |value|\n value == \"some report\"\n end\n\n def run\n \"some report\"\n end\nend\n```","summary":"

Run the given block after the operation runs

","abstract":false,"location":{"filename":"src/avram/callbacks.cr","line_number":399,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L399"},"def":{"name":"after_run","block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if block.args.size != 1\n raise(\"The 'after_run' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_run { |value| some_method(value) }\")\nend %}\n\n def after_run(\n%object\n)\n \n{% if @type.methods.map(&.name).includes?((:after_run).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ block.args.first }}\n = \n%object\n\n \n{{ block.body }}\n\n \nend\n \n"}},{"html_id":"after_save(method_name,if_if=nil,unless_unless=nil)-macro","name":"after_save","doc":"Run the given method after save, but before transaction is committed\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThis is a great place to do other database saves because if something goes\nwrong the whole transaction would be rolled back.\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_save touch_post\n\n private def touch_post(comment : Comment)\n SavePost.update!(comment.post!, updated_at: Time.utc)\n end\nend\n```\n\n> This is *not* a good place to do things like send messages, enqueue\n> background jobs, or charge payments. Since the transaction could be rolled\n> back the record may not be persisted to the database.\n> Instead use `after_commit`","summary":"

Run the given method after save, but before transaction is committed

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":230,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L230"},"def":{"name":"after_save","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_save, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:after_save, {{ method_name }}, :unless)\n {% end %}\n\n after_save(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_save(if_if=nil,unless_unless=nil,&block)-macro","name":"after_save","doc":"Run the given block after save, but before transaction is committed\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\nThis is a great place to do other database saves because if something goes\nwrong the whole transaction would be rolled back.\n\nThe newly saved record will be passed to the method.\n\n```\nclass SaveComment < Comment::SaveOperation\n after_save do |comment|\n SavePost.update!(comment.post!, updated_at: Time.utc)\n end\nend\n```\n\n> This is *not* a good place to do things like send messages, enqueue\n> background jobs, or charge payments. Since the transaction could be rolled\n> back the record may not be persisted to the database.\n> Instead use `after_commit`","summary":"

Run the given block after save, but before transaction is committed

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil, &block)","args_html":"(if _if = nil, unless _unless = nil, &block)","location":{"filename":"src/avram/callbacks.cr","line_number":278,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L278"},"def":{"name":"after_save","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your after_save callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_save, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:after_save, :unless)\n {% end %}\n\n \n{% if block.args.size != 1\n raise(\"The 'after_save' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_save do |saved_user|\\n some_method(saved_user)\\n end\")\nend %}\n\n def after_save(\n%object\n : T)\n \n{% if @type.methods.map(&.name).includes?((:after_save).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ block.args.first }} = %object\n {{ block.body }}\n end\n {% else %}\n {{ block.args.first }} = %object\n {{ block.body }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"before_delete(method_name,if_if=nil,unless_unless=nil)-macro","name":"before_delete","doc":"Same as `before_save`, but with a different name","summary":"

Same as before_save, but with a different name

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":76,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L76"},"def":{"name":"before_delete","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_delete, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_delete, {{ method_name }}, :unless)\n {% end %}\n\n before_delete(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_delete(if_if=nil,unless_unless=nil)-macro","name":"before_delete","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil)","args_html":"(if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":154,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L154"},"def":{"name":"before_delete","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your before_delete callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_delete, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_delete, :unless)\n {% end %}\n\n\n def before_delete\n \n{% if @type.methods.map(&.name).includes?((:before_delete).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ yield }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ yield }}\n end\n {% else %}\n {{ yield }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"before_run(method_name)-macro","name":"before_run","doc":"Run the given method before `run` is called on an `Operation`.\n\n```\nbefore_run :validate_inputs\n\nprivate def validate_inputs\n validate_required data\nend\n```","summary":"

Run the given method before run is called on an Operation.

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/avram/callbacks.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L97"},"def":{"name":"before_run","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" before_run do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_run-macro","name":"before_run","doc":"Run the given block before `run` is called on an `Operation`.\n\n```\nbefore_run do\n validate_required data\nend\n```","summary":"

Run the given block before run is called on an Operation.

","abstract":false,"location":{"filename":"src/avram/callbacks.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L193"},"def":{"name":"before_run","visibility":"Public","body":" def before_run\n \n{% if @type.methods.map(&.name).includes?((:before_run).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}},{"html_id":"before_save(method_name,if_if=nil,unless_unless=nil)-macro","name":"before_save","doc":"Run the given method before saving or creating for `SaveOperation`\n\nThis runs before saving and before the database transaction is started.\nYou can set defaults, validate, or perform any other setup necessary for\nsaving.\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\n```\nbefore_save :run_validations\nbefore_save :validate_can_internet, unless: :too_cool_for_school?\n\nprivate def run_validations\n validate_required name, age\nend\n\nprivate def validate_can_internet\n validate_size_of age, min: 13\nend\n\nprivate def too_cool_for_school?\n [true, false].sample\nend\n```","summary":"

Run the given method before saving or creating for SaveOperation

","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(method_name, if _if = nil, unless _unless = nil)","args_html":"(method_name, if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L63"},"def":{"name":"before_save","args":[{"name":"method_name","external_name":"method_name","restriction":""},{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_save, {{ method_name }}, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_inline_callbacks(:before_save, {{ method_name }}, :unless)\n {% end %}\n\n before_save(if: \n{{ _if }}\n, unless: \n{{ _unless }}\n) do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_save(if_if=nil,unless_unless=nil)-macro","name":"before_save","doc":"Run the given block before saving or creating for `SaveOperation`\n\nThis runs before saving and before the database transaction is started.\nYou can set defaults, validate, or perform any other setup necessary for\nsaving.\n\nOptionally you can pass an `if` or `unless` argument which allows you to\nrun this conditionally. The symbol should reference a method you've defined\nthat returns a truthy/falsey value\n\n```\nbefore_save(unless: :skip_callback?) do\n validate_required name, age\nend\n\nprivate def skip_callback?\n false\nend\n```","summary":"

Run the given block before saving or creating for SaveOperation

","abstract":false,"args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"args_string":"(if _if = nil, unless _unless = nil)","args_html":"(if _if = nil, unless _unless = nil)","location":{"filename":"src/avram/callbacks.cr","line_number":122,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L122"},"def":{"name":"before_save","args":[{"name":"_if","default_value":"nil","external_name":"if","restriction":""},{"name":"_unless","default_value":"nil","external_name":"unless","restriction":""}],"visibility":"Public","body":" \n{% if (_if != nil) && (_unless != nil) %}\n {% raise(\"Your before_save callbacks should only specify `if` or `unless`, but not both.\") %}\n {% end %}\n\n \n{% if _if.is_a?(SymbolLiteral) || _if.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_save, :if)\n {% end %}\n\n \n{% if _unless.is_a?(SymbolLiteral) || _unless.is_a?(NilLiteral) %}{% else %}\n conditional_error_for_block_callbacks(:before_save, :unless)\n {% end %}\n\n\n def before_save\n \n{% if @type.methods.map(&.name).includes?((:before_save).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{% if _if %}\n if {{ _if.id }}\n {{ yield }}\n end\n {% else %}{% if _unless %}\n unless {{ _unless.id }}\n {{ yield }}\n end\n {% else %}\n {{ yield }}\n {% end %}{% end %}\n\n \nend\n \n"}},{"html_id":"conditional_error_for_block_callbacks(callback,condition)-macro","name":"conditional_error_for_block_callbacks","abstract":false,"args":[{"name":"callback","external_name":"callback","restriction":""},{"name":"condition","external_name":"condition","restriction":""}],"args_string":"(callback, condition)","args_html":"(callback, condition)","location":{"filename":"src/avram/callbacks.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/callbacks.cr#L19"},"def":{"name":"conditional_error_for_block_callbacks","args":[{"name":"callback","external_name":"callback","restriction":""},{"name":"condition","external_name":"condition","restriction":""}],"visibility":"Public","body":" \n\\{%\n \nraise <<-ERROR\n You must pass a Symbol to `\n{{ condition.id }}\n` in \n{{ @type }}\n. The Symbol will reference a method you define.\n\n Try this...\n\n \n{{ callback.id }}\n(\n{{ condition.id }}\n: :check_condition?) do\n # your callback block\n end\n\n def check_condition?\n # return your bool value here\n end\n ERROR\n %}\n \n"}}]},{"html_id":"avram/Avram/ChronoUnits","path":"Avram/ChronoUnits.html","kind":"enum","full_name":"Avram::ChronoUnits","name":"ChronoUnits","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/chrono_units.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L2"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Century","name":"Century","value":"0"},{"id":"Day","name":"Day","value":"1"},{"id":"Decade","name":"Decade","value":"2"},{"id":"Dow","name":"Dow","value":"3"},{"id":"Doy","name":"Doy","value":"4"},{"id":"Epoch","name":"Epoch","value":"5"},{"id":"Hour","name":"Hour","value":"6"},{"id":"Isodow","name":"Isodow","value":"7"},{"id":"Isoyear","name":"Isoyear","value":"8"},{"id":"Julian","name":"Julian","value":"9"},{"id":"Microseconds","name":"Microseconds","value":"10"},{"id":"Millennium","name":"Millennium","value":"11"},{"id":"Milliseconds","name":"Milliseconds","value":"12"},{"id":"Minute","name":"Minute","value":"13"},{"id":"Month","name":"Month","value":"14"},{"id":"Quarter","name":"Quarter","value":"15"},{"id":"Second","name":"Second","value":"16"},{"id":"Timezone","name":"Timezone","value":"17"},{"id":"TimezoneHour","name":"TimezoneHour","value":"18"},{"id":"TimezoneMinute","name":"TimezoneMinute","value":"19"},{"id":"Week","name":"Week","value":"20"},{"id":"Year","name":"Year","value":"21"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"century?-instance-method","name":"century?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L3"},"def":{"name":"century?","visibility":"Public","body":"self == Century"}},{"html_id":"day?-instance-method","name":"day?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L4"},"def":{"name":"day?","visibility":"Public","body":"self == Day"}},{"html_id":"decade?-instance-method","name":"decade?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L5"},"def":{"name":"decade?","visibility":"Public","body":"self == Decade"}},{"html_id":"dow?-instance-method","name":"dow?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L6"},"def":{"name":"dow?","visibility":"Public","body":"self == Dow"}},{"html_id":"doy?-instance-method","name":"doy?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L7"},"def":{"name":"doy?","visibility":"Public","body":"self == Doy"}},{"html_id":"epoch?-instance-method","name":"epoch?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L8"},"def":{"name":"epoch?","visibility":"Public","body":"self == Epoch"}},{"html_id":"hour?-instance-method","name":"hour?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L9"},"def":{"name":"hour?","visibility":"Public","body":"self == Hour"}},{"html_id":"isodow?-instance-method","name":"isodow?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L10"},"def":{"name":"isodow?","visibility":"Public","body":"self == Isodow"}},{"html_id":"isoyear?-instance-method","name":"isoyear?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L11"},"def":{"name":"isoyear?","visibility":"Public","body":"self == Isoyear"}},{"html_id":"julian?-instance-method","name":"julian?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L12"},"def":{"name":"julian?","visibility":"Public","body":"self == Julian"}},{"html_id":"microseconds?-instance-method","name":"microseconds?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L13"},"def":{"name":"microseconds?","visibility":"Public","body":"self == Microseconds"}},{"html_id":"millennium?-instance-method","name":"millennium?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L14"},"def":{"name":"millennium?","visibility":"Public","body":"self == Millennium"}},{"html_id":"milliseconds?-instance-method","name":"milliseconds?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L15"},"def":{"name":"milliseconds?","visibility":"Public","body":"self == Milliseconds"}},{"html_id":"minute?-instance-method","name":"minute?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L16"},"def":{"name":"minute?","visibility":"Public","body":"self == Minute"}},{"html_id":"month?-instance-method","name":"month?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L17"},"def":{"name":"month?","visibility":"Public","body":"self == Month"}},{"html_id":"quarter?-instance-method","name":"quarter?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L18"},"def":{"name":"quarter?","visibility":"Public","body":"self == Quarter"}},{"html_id":"second?-instance-method","name":"second?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L19"},"def":{"name":"second?","visibility":"Public","body":"self == Second"}},{"html_id":"timezone?-instance-method","name":"timezone?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L20"},"def":{"name":"timezone?","visibility":"Public","body":"self == Timezone"}},{"html_id":"timezone_hour?-instance-method","name":"timezone_hour?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L21"},"def":{"name":"timezone_hour?","visibility":"Public","body":"self == TimezoneHour"}},{"html_id":"timezone_minute?-instance-method","name":"timezone_minute?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L22"},"def":{"name":"timezone_minute?","visibility":"Public","body":"self == TimezoneMinute"}},{"html_id":"week?-instance-method","name":"week?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L23"},"def":{"name":"week?","visibility":"Public","body":"self == Week"}},{"html_id":"year?-instance-method","name":"year?","abstract":false,"location":{"filename":"src/avram/chrono_units.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/chrono_units.cr#L24"},"def":{"name":"year?","visibility":"Public","body":"self == Year"}}]},{"html_id":"avram/Avram/Connection","path":"Avram/Connection.html","kind":"class","full_name":"Avram::Connection","name":"Connection","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Handles the connection to the DB.","summary":"

Handles the connection to the DB.

","constructors":[{"html_id":"new(connection_string:String,database_class:Avram::Database.class)-class-method","name":"new","abstract":false,"args":[{"name":"connection_string","external_name":"connection_string","restriction":"String"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"args_string":"(connection_string : String, database_class : Avram::Database.class)","args_html":"(connection_string : String, database_class : Avram::Database.class)","location":{"filename":"src/avram/connection.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L5"},"def":{"name":"new","args":[{"name":"connection_string","external_name":"connection_string","restriction":"String"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection_string, database_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"close:Nil-instance-method","name":"close","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L12"},"def":{"name":"close","return_type":"Nil","visibility":"Public","body":"@db.try(&.close)\n@db = nil\n"}},{"html_id":"connect_listen(*channels:String,&block:PQ::Notification->):Nil-instance-method","name":"connect_listen","abstract":false,"args":[{"name":"channels","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String, &block : PQ::Notification -> ) : Nil","args_html":"(*channels : String, &block : PQ::Notification -> ) : Nil","location":{"filename":"src/avram/connection.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L17"},"def":{"name":"connect_listen","args":[{"name":"channels","external_name":"channels","restriction":"String"}],"splat_index":0,"yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(PQ::Notification ->)"},"return_type":"Nil","visibility":"Public","body":"begin\n PG.connect_listen(@connection_string, *channels, &block)\nrescue DB::ConnectionRefused\n raise(ConnectionError.new(connection_uri, database_class: @database_class))\nend"}},{"html_id":"open:DB::Database-instance-method","name":"open","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L8"},"def":{"name":"open","return_type":"DB::Database","visibility":"Public","body":"@db = try_connection!"}},{"html_id":"try_connection!:DB::Database-instance-method","name":"try_connection!","abstract":false,"location":{"filename":"src/avram/connection.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/connection.cr#L23"},"def":{"name":"try_connection!","return_type":"DB::Database","visibility":"Public","body":"begin\n DB.open(@connection_string)\nrescue DB::ConnectionRefused\n raise(ConnectionError.new(connection_uri, database_class: @database_class))\nend"}}]},{"html_id":"avram/Avram/ConnectionError","path":"Avram/ConnectionError.html","kind":"class","full_name":"Avram::ConnectionError","name":"ConnectionError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L82"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"DEFAULT_PG_PORT","name":"DEFAULT_PG_PORT","value":"5432"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(connection_details:URI,database_class:Avram::Database.class)-class-method","name":"new","abstract":false,"args":[{"name":"connection_details","external_name":"connection_details","restriction":"URI"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"args_string":"(connection_details : URI, database_class : Avram::Database.class)","args_html":"(connection_details : URI, database_class : Avram::Database.class)","location":{"filename":"src/avram/errors.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L88"},"def":{"name":"new","args":[{"name":"connection_details","external_name":"connection_details","restriction":"URI"},{"name":"database_class","external_name":"database_class","restriction":"Avram::Database.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection_details, database_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"connection_details:URI-instance-method","name":"connection_details","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L85"},"def":{"name":"connection_details","return_type":"URI","visibility":"Public","body":"@connection_details"}},{"html_id":"database_class:Avram::Database.class-instance-method","name":"database_class","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L86"},"def":{"name":"database_class","return_type":"Avram::Database.class","visibility":"Public","body":"@database_class"}}]},{"html_id":"avram/Avram/Credentials","path":"Avram/Credentials.html","kind":"class","full_name":"Avram::Credentials","name":"Credentials","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/credentials.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"parse?(connection_url:String|Nil):Credentials|Nil-class-method","name":"parse?","doc":"Parse a postgres connection string URL. This may come from an\nenvironment variable.\nReturns `nil` if no `connection_url` is provided.\n\n```\nAvram::Credentials.parse?(ENV[\"DB_URL\"]?)\n```","summary":"

Parse a postgres connection string URL.

","abstract":false,"args":[{"name":"connection_url","external_name":"connection_url","restriction":"String | ::Nil"}],"args_string":"(connection_url : String | Nil) : Credentials | Nil","args_html":"(connection_url : String | Nil) : Credentials | Nil","location":{"filename":"src/avram/credentials.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L28"},"def":{"name":"parse?","args":[{"name":"connection_url","external_name":"connection_url","restriction":"String | ::Nil"}],"return_type":"Credentials | ::Nil","visibility":"Public","body":"if connection_url.nil?\n return nil\nend\nparse(connection_url.as(String))\n"}}],"constructors":[{"html_id":"new(database:String,hostname:String|Nil=nil,username:String|Nil=nil,password:String|Nil=nil,port:Int32|Nil=nil,query:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"String"},{"name":"hostname","default_value":"nil","external_name":"hostname","restriction":"String | ::Nil"},{"name":"username","default_value":"nil","external_name":"username","restriction":"String | ::Nil"},{"name":"password","default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"port","default_value":"nil","external_name":"port","restriction":"Int32 | ::Nil"},{"name":"query","default_value":"nil","external_name":"query","restriction":"String | ::Nil"}],"args_string":"(database : String, hostname : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil, port : Int32 | Nil = nil, query : String | Nil = nil)","args_html":"(database : String, hostname : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil, port : Int32 | Nil = nil, query : String | Nil = nil)","location":{"filename":"src/avram/credentials.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L4"},"def":{"name":"new","args":[{"name":"database","external_name":"database","restriction":"String"},{"name":"hostname","default_value":"nil","external_name":"hostname","restriction":"String | ::Nil"},{"name":"username","default_value":"nil","external_name":"username","restriction":"String | ::Nil"},{"name":"password","default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"port","default_value":"nil","external_name":"port","restriction":"Int32 | ::Nil"},{"name":"query","default_value":"nil","external_name":"query","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(database, hostname, username, password, port, query)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"parse(connection_url:String):Credentials-class-method","name":"parse","doc":"Parse a postgres connection string URL. This may come from an\nenvironment variable.\n\n```\nAvram::Credentials.parse(ENV[\"DB_URL\"])\n```","summary":"

Parse a postgres connection string URL.

","abstract":false,"args":[{"name":"connection_url","external_name":"connection_url","restriction":"String"}],"args_string":"(connection_url : String) : Credentials","args_html":"(connection_url : String) : Credentials","location":{"filename":"src/avram/credentials.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L39"},"def":{"name":"parse","args":[{"name":"connection_url","external_name":"connection_url","restriction":"String"}],"return_type":"Credentials","visibility":"Public","body":"uri = URI.parse(connection_url)\nnew(database: uri.path.to_s, hostname: uri.host, username: uri.user, password: uri.password, port: uri.port, query: uri.query)\n"}},{"html_id":"void:Credentials-class-method","name":"void","doc":"Used when you need to configure credentials,\nbut no database connection is made.","summary":"

Used when you need to configure credentials, but no database connection is made.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L17"},"def":{"name":"void","return_type":"Credentials","visibility":"Public","body":"new(database: \"unused\")"}}],"instance_methods":[{"html_id":"connection_string:String-instance-method","name":"connection_string","doc":"This is the full connection string used\nto connect to the PostgreSQL server.","summary":"

This is the full connection string used to connect to the PostgreSQL server.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L85"},"def":{"name":"connection_string","return_type":"String","visibility":"Public","body":"String.build do |io|\n set_url_protocol(io)\n set_url_creds(io)\n set_url_host(io)\n set_url_port(io)\nend"}},{"html_id":"database:String-instance-method","name":"database","doc":"The name of the database you want to connect to","summary":"

The name of the database you want to connect to

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L52"},"def":{"name":"database","return_type":"String","visibility":"Public","body":"@database = @database.strip\nif @database.starts_with?('/')\n @database = @database[1..-1]\nend\nif @database.empty?\n raise(InvalidDatabaseNameError.new(\"The database name specified was blank. Be sure to set a value.\"))\nend\n@database\n"}},{"html_id":"hostname:String|Nil-instance-method","name":"hostname","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L63"},"def":{"name":"hostname","return_type":"String | ::Nil","visibility":"Public","body":"@hostname.try(&.strip).presence"}},{"html_id":"password:String|Nil-instance-method","name":"password","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L71"},"def":{"name":"password","return_type":"String | ::Nil","visibility":"Public","body":"@password.try(&.strip).presence"}},{"html_id":"port:Int32|Nil-instance-method","name":"port","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L75"},"def":{"name":"port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@port"}},{"html_id":"query:String|Nil-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L79"},"def":{"name":"query","return_type":"String | ::Nil","visibility":"Public","body":"@query.try(&.strip).presence"}},{"html_id":"url:String-instance-method","name":"url","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L2"},"def":{"name":"url","return_type":"String","visibility":"Public","body":"@url"}},{"html_id":"url_without_query_params:String-instance-method","name":"url_without_query_params","doc":"Returns the postgres connection string without\nany query params.","summary":"

Returns the postgres connection string without any query params.

","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":96,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L96"},"def":{"name":"url_without_query_params","return_type":"String","visibility":"Public","body":"url.sub(\"?#{@query}\", \"\")"}},{"html_id":"username:String|Nil-instance-method","name":"username","abstract":false,"location":{"filename":"src/avram/credentials.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/credentials.cr#L67"},"def":{"name":"username","return_type":"String | ::Nil","visibility":"Public","body":"@username.try(&.strip).presence"}}]},{"html_id":"avram/Avram/Criteria","path":"Avram/Criteria.html","kind":"class","full_name":"Avram::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Bool/Lucky/Criteria","kind":"class","full_name":"Bool::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Float64/Lucky/Criteria","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int16/Lucky/Criteria","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/JSON/Any/Lucky/Criteria","kind":"class","full_name":"JSON::Any::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/JSON/Serializable/Lucky/Criteria","kind":"class","full_name":"JSON::Serializable::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Slice/Lucky/Criteria","kind":"class","full_name":"Slice::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/String/Lucky/Criteria","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/UUID/Lucky/Criteria","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"asc_order(null_sorting:Avram::OrderBy::NullSorting=:default):T-instance-method","name":"asc_order","abstract":false,"args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"args_string":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","args_html":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","location":{"filename":"src/avram/criteria.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L14"},"def":{"name":"asc_order","args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderBy.new(column, :asc, null_sorting))"}},{"html_id":"column:Symbol|String-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L3"},"def":{"name":"column","return_type":"Symbol | String","visibility":"Public","body":"@column"}},{"html_id":"column=(column:Symbol|String)-instance-method","name":"column=","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(column : Symbol | String)","args_html":"(column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L3"},"def":{"name":"column=","args":[{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"@column = column"}},{"html_id":"desc_order(null_sorting:Avram::OrderBy::NullSorting=:default):T-instance-method","name":"desc_order","abstract":false,"args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"args_string":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","args_html":"(null_sorting : Avram::OrderBy::NullSorting = :default) : T","location":{"filename":"src/avram/criteria.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L10"},"def":{"name":"desc_order","args":[{"name":"null_sorting","default_value":":default","external_name":"null_sorting","restriction":"Avram::OrderBy::NullSorting"}],"return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderBy.new(column, :desc, null_sorting))"}},{"html_id":"eq(value):T-instance-method","name":"eq","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L22"},"def":{"name":"eq","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"check_just_nil!(typeof(value))\ncheck_nilable!(value)\nperform_eq(value)\n"}},{"html_id":"gt(value):T-instance-method","name":"gt","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":116,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L116"},"def":{"name":"gt","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::GreaterThan.new(column, V.adapter.to_db!(value)))"}},{"html_id":"gte(value):T-instance-method","name":"gte","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":120,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L120"},"def":{"name":"gte","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::GreaterThanOrEqualTo.new(column, V.adapter.to_db!(value)))"}},{"html_id":"in(values):T-instance-method","name":"in","abstract":false,"args":[{"name":"values","external_name":"values","restriction":""}],"args_string":"(values) : T","args_html":"(values) : T","location":{"filename":"src/avram/criteria.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L152"},"def":{"name":"in","args":[{"name":"values","external_name":"values","restriction":""}],"return_type":"T","visibility":"Public","body":"values = values.map do |value|\n V.adapter.to_db!(value)\nend\nadd_clause(Avram::Where::In.new(column, values))\n"}},{"html_id":"is_nil:T-instance-method","name":"is_nil","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":102,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L102"},"def":{"name":"is_nil","return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Null.new(column))"}},{"html_id":"is_not_nil:T-instance-method","name":"is_not_nil","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L106"},"def":{"name":"is_not_nil","return_type":"T","visibility":"Public","body":"not()\nis_nil\n"}},{"html_id":"lt(value):T-instance-method","name":"lt","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":124,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L124"},"def":{"name":"lt","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::LessThan.new(column, V.adapter.to_db!(value)))"}},{"html_id":"lte(value):T-instance-method","name":"lte","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":128,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L128"},"def":{"name":"lte","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::LessThanOrEqualTo.new(column, V.adapter.to_db!(value)))"}},{"html_id":"nilable_eq(value):T-instance-method","name":"nilable_eq","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/criteria.cr","line_number":92,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L92"},"def":{"name":"nilable_eq","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"check_just_nil!(typeof(value))\nif value.nil?\n is_nil\nelse\n perform_eq(value)\nend\n"}},{"html_id":"not:Avram::Criteria-instance-method","name":"not","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":111,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L111"},"def":{"name":"not","return_type":"Avram::Criteria","visibility":"Public","body":"@negate_next_criteria = true\nself\n"}},{"html_id":"random_order:T-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L18"},"def":{"name":"random_order","return_type":"T","visibility":"Public","body":"rows.order_by(Avram::OrderByRandom.new)"}},{"html_id":"rows:T-instance-method","name":"rows","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L2"},"def":{"name":"rows","return_type":"T","visibility":"Public","body":"@rows"}},{"html_id":"rows=(rows:T)-instance-method","name":"rows=","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"}],"args_string":"(rows : T)","args_html":"(rows : T)","location":{"filename":"src/avram/criteria.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L2"},"def":{"name":"rows=","args":[{"name":"rows","external_name":"rows","restriction":"T"}],"visibility":"Public","body":"@rows = rows"}},{"html_id":"select_average:Float64|Nil-instance-method","name":"select_average","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L140"},"def":{"name":"select_average","return_type":"Float64 | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_average(column)).as(PG::Numeric | ::Nil)).try(&.to_f64)"}},{"html_id":"select_average!:Float64-instance-method","name":"select_average!","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":144,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L144"},"def":{"name":"select_average!","return_type":"Float64","visibility":"Public","body":"select_average || 0_f64"}},{"html_id":"select_max:V|Nil-instance-method","name":"select_max","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":136,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L136"},"def":{"name":"select_max","return_type":"V | ::Nil","visibility":"Public","body":"rows.exec_scalar(&.select_max(column)).as(V | ::Nil)"}},{"html_id":"select_min:V|Nil-instance-method","name":"select_min","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L132"},"def":{"name":"select_min","return_type":"V | ::Nil","visibility":"Public","body":"rows.exec_scalar(&.select_min(column)).as(V | ::Nil)"}},{"html_id":"select_sum-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/criteria.cr","line_number":148,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L148"},"def":{"name":"select_sum","visibility":"Public","body":"rows.exec_scalar(&.select_sum(column))"}}],"macros":[{"html_id":"define_function_criteria(name,output_type=V,sql_name=nil)-macro","name":"define_function_criteria","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"output_type","default_value":"V","external_name":"output_type","restriction":""},{"name":"sql_name","default_value":"nil","external_name":"sql_name","restriction":""}],"args_string":"(name, output_type = V, sql_name = nil)","args_html":"(name, output_type = V, sql_name = nil)","location":{"filename":"src/avram/criteria.cr","line_number":190,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L190"},"def":{"name":"define_function_criteria","args":[{"name":"name","external_name":"name","restriction":""},{"name":"output_type","default_value":"V","external_name":"output_type","restriction":""},{"name":"sql_name","default_value":"nil","external_name":"sql_name","restriction":""}],"visibility":"Public","body":" \n{% sql_name = sql_name ? sql_name.id : name.id.upcase %}\n\n def \n{{ name }}\n\n Criteria(T,\n{{ output_type }}\n).new(rows, \"\n{{ sql_name }}\n(#{column})\")\n \nend\n \n"}}]},{"html_id":"avram/Avram/Database","path":"Avram/Database.html","kind":"class","full_name":"Avram::Database","name":"Database","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L1"},{"filename":"src/avram/database/column_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L2"},{"filename":"src/avram/database/database_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L2"},{"filename":"src/avram/database/table_info.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"close_connections!-class-method","name":"close_connections!","doc":"Close all available connections as well as the DB","summary":"

Close all available connections as well as the DB

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L162"},"def":{"name":"close_connections!","visibility":"Public","body":"connections.values.map(&.close)\n@@db.try(&.close)\n"}},{"html_id":"connections-class-method","name":"connections","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L6"},"def":{"name":"connections","visibility":"Public","body":"@@connections"}},{"html_id":"credentials-class-method","name":"credentials","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L140"},"def":{"name":"credentials","visibility":"Public","body":"settings.credentials"}},{"html_id":"database_info:DatabaseInfo-class-method","name":"database_info","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L69"},"def":{"name":"database_info","return_type":"DatabaseInfo","visibility":"Public","body":"@@database_info || (@@database_info = DatabaseInfo.load(self))"}},{"html_id":"delete-class-method","name":"delete","doc":"Run a SQL `DELETE` on all tables in the database","summary":"

Run a SQL DELETE on all tables in the database

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L49"},"def":{"name":"delete","visibility":"Public","body":"new.delete"}},{"html_id":"exec(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"exec","doc":"Same as crystal-db's `DB::QueryMethods#exec` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#exec but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"exec","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.exec(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"listen(*channels:String,&block:PQ::Notification->):Nil-class-method","name":"listen","doc":"Listens for `pg_notify()` calls on each channel in `channels`\nYields a `PQ::Notification` object with `channel`, `payload`, and `pid`.\n\n```\n# pg_notify(\"callback\", \"123\")\nAppDatabase.listen(\"callback\", \"jobs\") do |notification|\n notification.channel # => \"callback\"\n notification.payload # => \"123\"\nend\n```","summary":"

Listens for pg_notify() calls on each channel in channels Yields a PQ::Notification object with channel, payload, and pid.

","abstract":false,"args":[{"name":"channels","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String, &block : PQ::Notification -> ) : Nil","args_html":"(*channels : String, &block : PQ::Notification -> ) : Nil","location":{"filename":"src/avram/database.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L63"},"def":{"name":"listen","args":[{"name":"channels","external_name":"channels","restriction":"String"}],"splat_index":0,"yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(PQ::Notification ->)"},"return_type":"Nil","visibility":"Public","body":"new.listen(*channels, &block)"}},{"html_id":"lock_id:UInt64|Nil-class-method","name":"lock_id","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L7"},"def":{"name":"lock_id","return_type":"UInt64 | ::Nil","visibility":"Public","body":"@@lock_id"}},{"html_id":"lock_id=(lock_id:UInt64|Nil)-class-method","name":"lock_id=","abstract":false,"args":[{"name":"lock_id","external_name":"lock_id","restriction":"UInt64 | ::Nil"}],"args_string":"(lock_id : UInt64 | Nil)","args_html":"(lock_id : UInt64 | Nil)","location":{"filename":"src/avram/database.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L7"},"def":{"name":"lock_id=","args":[{"name":"lock_id","external_name":"lock_id","restriction":"UInt64 | ::Nil"}],"visibility":"Public","body":"@@lock_id = lock_id"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#:query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_all(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#:query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_all(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_each(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_each","doc":"Same as crystal-db's `DB::QueryMethods#:query_each` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_each but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_each","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_each(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_one(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#:query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_one(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#query_one?` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one? but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.query_one?(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-class-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#:\"query_one?\"` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:"query_one?" but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"new.query_one?(query, *args_, args: args, queryable: queryable) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"rollback-class-method","name":"rollback","doc":"Rollback the current transaction","summary":"

Rollback the current transaction

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L39"},"def":{"name":"rollback","visibility":"Public","body":"new.rollback"}},{"html_id":"run(&)-class-method","name":"run","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":148,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L148"},"def":{"name":"run","yields":1,"block_arity":1,"visibility":"Public","body":"new.run do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"scalar(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-class-method","name":"scalar","doc":"Same as crystal-db's `DB::QueryMethods#scalar` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#scalar but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"scalar","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"new.scalar(query, *args_, **named_args, args: args, queryable: queryable)"}},{"html_id":"setup_connection(&block:DB::Connection->Nil)-class-method","name":"setup_connection","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L28"},"def":{"name":"setup_connection","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(DB::Connection -> Nil)"},"visibility":"Public","body":"new.db.setup_connection do |conn|\n block.call(conn)\nend"}},{"html_id":"transaction(&)-class-method","name":"transaction","doc":"Wrap the block in a database transaction\n\n```\nAppDatabase.transaction do\n # Create, read, update\n # Force a rollback with AppDatabase.rollback\nend\n```","summary":"

Wrap the block in a database transaction

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L81"},"def":{"name":"transaction","yields":1,"block_arity":1,"visibility":"Public","body":"new.transaction do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"truncate(**named_args)-class-method","name":"truncate","doc":"Run a SQL `TRUNCATE` on all tables in the database","summary":"

Run a SQL TRUNCATE on all tables in the database

","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L44"},"def":{"name":"truncate","double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"visibility":"Public","body":"new.truncate(**named_args)"}},{"html_id":"verify_connection-class-method","name":"verify_connection","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L34"},"def":{"name":"verify_connection","visibility":"Public","body":"new.connection.open.close"}}],"instance_methods":[{"html_id":"exec(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"exec","doc":"Same as crystal-db's `DB::QueryMethods#exec` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#exec but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"exec","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.exec(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"publish_query_event(query,args_,args,queryable,&)-instance-method","name":"publish_query_event","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","external_name":"args","restriction":""},{"name":"queryable","external_name":"queryable","restriction":""}],"args_string":"(query, args_, args, queryable, &)","args_html":"(query, args_, args, queryable, &)","location":{"filename":"src/avram/database.cr","line_number":125,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L125"},"def":{"name":"publish_query_event","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","external_name":"args","restriction":""},{"name":"queryable","external_name":"queryable","restriction":""}],"yields":0,"block_arity":0,"visibility":"Public","body":"begin\n logging_args = (DB::EnumerableConcat.build(args_, args)).to_s\n Avram::Events::QueryEvent.publish(query: query, args: logging_args, queryable: queryable) do\n yield\n end\nrescue e : PQ::PQError\n Avram::Events::FailedQueryEvent.publish(error_message: e.message.to_s, query: query, queryable: queryable, args: logging_args)\n raise(e)\nend"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query","doc":"Same as crystal-db's `DB::QueryMethods#:query` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_all(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_all(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_all","doc":"Same as crystal-db's `DB::QueryMethods#:query_all` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_all but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_all","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_all(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_each(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_each","doc":"Same as crystal-db's `DB::QueryMethods#:query_each` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_each but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_each","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_each(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_one(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_one","doc":"Same as crystal-db's `DB::QueryMethods#:query_one` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:query_one but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_one","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#query_one?` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#query_one? but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one?(query, *args_, **named_args, args: args)\n end\nend"}},{"html_id":"query_one?(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args,&)-instance-method","name":"query_one?","doc":"Same as crystal-db's `DB::QueryMethods#:\"query_one?\"` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#:"query_one?" but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args, &)","location":{"filename":"src/avram/database.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L105"},"def":{"name":"query_one?","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":1,"block_arity":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.query_one?(query, *args_, args: args) do |*yield_args|\n yield *yield_args\n end\n end\nend"}},{"html_id":"scalar(query,*args_,args:Array|Nil=nil,queryable:String|Nil=nil,**named_args)-instance-method","name":"scalar","doc":"Same as crystal-db's `DB::QueryMethods#scalar` but with instrumentation","summary":"

Same as crystal-db's DB::QueryMethods#scalar but with instrumentation

","abstract":false,"args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","args_html":"(query, *args_, args : Array | Nil = nil, queryable : String | Nil = nil, **named_args)","location":{"filename":"src/avram/database.cr","line_number":88,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L88"},"def":{"name":"scalar","args":[{"name":"query","external_name":"query","restriction":""},{"name":"args_","external_name":"args_","restriction":""},{"name":"args","default_value":"nil","external_name":"args","restriction":"Array | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"publish_query_event(query, args_, args, queryable) do\n run do |db|\n db.scalar(query, *args_, **named_args, args: args)\n end\nend"}}],"types":[{"html_id":"avram/Avram/Database/ColumnInfo","path":"Avram/Database/ColumnInfo.html","kind":"struct","full_name":"Avram::Database::ColumnInfo","name":"ColumnInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/DB/Mappable","kind":"module","full_name":"DB::Mappable","name":"Mappable"},{"html_id":"avram/DB/Serializable","kind":"module","full_name":"DB::Serializable","name":"Serializable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/column_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/Mappable","kind":"module","full_name":"DB::Mappable","name":"Mappable"},{"html_id":"avram/DB/Serializable","kind":"module","full_name":"DB::Serializable","name":"Serializable"}],"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"class_methods":[{"html_id":"from_rs(rs:DB::ResultSet)-class-method","name":"from_rs","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/database/column_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L4"},"def":{"name":"from_rs","args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"visibility":"Public","body":"begin\n objs = Array(self).new\n rs.each do\n objs << (self.new(rs))\n end\n objs\nensure\n rs.close\nend"}}],"constructors":[{"html_id":"new(rs:DB::ResultSet)-class-method","name":"new","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/database/column_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L4"},"def":{"name":"new","args":[{"name":"rs","external_name":"rs","restriction":"::DB::ResultSet"}],"visibility":"Public","body":"instance = allocate\ninstance.initialize(__set_for_db_serializable: rs)\nif instance.responds_to?(:finalize)\n GC.add_finalizer(instance)\nend\ninstance\n"}}],"instance_methods":[{"html_id":"column_default:String|Nil-instance-method","name":"column_default","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L12"},"def":{"name":"column_default","return_type":"String | ::Nil","visibility":"Public","body":"@column_default"}},{"html_id":"column_default=(column_default:String|Nil)-instance-method","name":"column_default=","abstract":false,"args":[{"name":"column_default","external_name":"column_default","restriction":"String | ::Nil"}],"args_string":"(column_default : String | Nil)","args_html":"(column_default : String | Nil)","location":{"filename":"src/avram/database/column_info.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L12"},"def":{"name":"column_default=","args":[{"name":"column_default","external_name":"column_default","restriction":"String | ::Nil"}],"visibility":"Public","body":"@column_default = column_default"}},{"html_id":"column_name:String-instance-method","name":"column_name","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L10"},"def":{"name":"column_name","return_type":"String","visibility":"Public","body":"@column_name"}},{"html_id":"column_name=(column_name:String)-instance-method","name":"column_name=","abstract":false,"args":[{"name":"column_name","external_name":"column_name","restriction":"String"}],"args_string":"(column_name : String)","args_html":"(column_name : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L10"},"def":{"name":"column_name=","args":[{"name":"column_name","external_name":"column_name","restriction":"String"}],"visibility":"Public","body":"@column_name = column_name"}},{"html_id":"data_type:String-instance-method","name":"data_type","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L13"},"def":{"name":"data_type","return_type":"String","visibility":"Public","body":"@data_type"}},{"html_id":"data_type=(data_type:String)-instance-method","name":"data_type=","abstract":false,"args":[{"name":"data_type","external_name":"data_type","restriction":"String"}],"args_string":"(data_type : String)","args_html":"(data_type : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L13"},"def":{"name":"data_type=","args":[{"name":"data_type","external_name":"data_type","restriction":"String"}],"visibility":"Public","body":"@data_type = data_type"}},{"html_id":"is_nullable:String-instance-method","name":"is_nullable","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L11"},"def":{"name":"is_nullable","return_type":"String","visibility":"Public","body":"@is_nullable"}},{"html_id":"is_nullable=(is_nullable:String)-instance-method","name":"is_nullable=","abstract":false,"args":[{"name":"is_nullable","external_name":"is_nullable","restriction":"String"}],"args_string":"(is_nullable : String)","args_html":"(is_nullable : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L11"},"def":{"name":"is_nullable=","args":[{"name":"is_nullable","external_name":"is_nullable","restriction":"String"}],"visibility":"Public","body":"@is_nullable = is_nullable"}},{"html_id":"nilable?:Bool-instance-method","name":"nilable?","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L15"},"def":{"name":"nilable?","return_type":"Bool","visibility":"Public","body":"is_nullable == \"YES\""}},{"html_id":"table:Avram::Database::TableInfo-instance-method","name":"table","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L19"},"def":{"name":"table","return_type":"Avram::Database::TableInfo","visibility":"Public","body":"TableInfo.new(table_name, table_type, table_schema)"}},{"html_id":"table_catalog:String-instance-method","name":"table_catalog","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L6"},"def":{"name":"table_catalog","return_type":"String","visibility":"Public","body":"@table_catalog"}},{"html_id":"table_catalog=(table_catalog:String)-instance-method","name":"table_catalog=","abstract":false,"args":[{"name":"table_catalog","external_name":"table_catalog","restriction":"String"}],"args_string":"(table_catalog : String)","args_html":"(table_catalog : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L6"},"def":{"name":"table_catalog=","args":[{"name":"table_catalog","external_name":"table_catalog","restriction":"String"}],"visibility":"Public","body":"@table_catalog = table_catalog"}},{"html_id":"table_name:String-instance-method","name":"table_name","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L8"},"def":{"name":"table_name","return_type":"String","visibility":"Public","body":"@table_name"}},{"html_id":"table_name=(table_name:String)-instance-method","name":"table_name=","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"String"}],"args_string":"(table_name : String)","args_html":"(table_name : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L8"},"def":{"name":"table_name=","args":[{"name":"table_name","external_name":"table_name","restriction":"String"}],"visibility":"Public","body":"@table_name = table_name"}},{"html_id":"table_schema:String-instance-method","name":"table_schema","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L7"},"def":{"name":"table_schema","return_type":"String","visibility":"Public","body":"@table_schema"}},{"html_id":"table_schema=(table_schema:String)-instance-method","name":"table_schema=","abstract":false,"args":[{"name":"table_schema","external_name":"table_schema","restriction":"String"}],"args_string":"(table_schema : String)","args_html":"(table_schema : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L7"},"def":{"name":"table_schema=","args":[{"name":"table_schema","external_name":"table_schema","restriction":"String"}],"visibility":"Public","body":"@table_schema = table_schema"}},{"html_id":"table_type:String-instance-method","name":"table_type","abstract":false,"location":{"filename":"src/avram/database/column_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L9"},"def":{"name":"table_type","return_type":"String","visibility":"Public","body":"@table_type"}},{"html_id":"table_type=(table_type:String)-instance-method","name":"table_type=","abstract":false,"args":[{"name":"table_type","external_name":"table_type","restriction":"String"}],"args_string":"(table_type : String)","args_html":"(table_type : String)","location":{"filename":"src/avram/database/column_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/column_info.cr#L9"},"def":{"name":"table_type=","args":[{"name":"table_type","external_name":"table_type","restriction":"String"}],"visibility":"Public","body":"@table_type = table_type"}}]},{"html_id":"avram/Avram/Database/DatabaseCleaner","path":"Avram/Database/DatabaseCleaner.html","kind":"class","full_name":"Avram::Database::DatabaseCleaner","name":"DatabaseCleaner","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database.cr","line_number":253,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L253"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"new(database:Avram::Database)-class-method","name":"new","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"::Avram::Database"}],"args_string":"(database : Avram::Database)","args_html":"(database : Avram::Database)","location":{"filename":"src/avram/database.cr","line_number":257,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L257"},"def":{"name":"new","args":[{"name":"database","external_name":"database","restriction":"::Avram::Database"}],"visibility":"Public","body":"_ = allocate\n_.initialize(database)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"delete-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/database.cr","line_number":277,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L277"},"def":{"name":"delete","visibility":"Public","body":"if table_names.empty?\n return\nend\ntable_names.each do |t|\n statement = (\"DELETE FROM #{t}\")\n database.exec(statement)\nend\n"}},{"html_id":"truncate(*,cascade:Bool=true,restart_identity:Bool=true)-instance-method","name":"truncate","abstract":false,"args":[{"name":"","external_name":"","restriction":""},{"name":"cascade","default_value":"true","external_name":"cascade","restriction":"Bool"},{"name":"restart_identity","default_value":"true","external_name":"restart_identity","restriction":"Bool"}],"args_string":"(*, cascade : Bool = true, restart_identity : Bool = true)","args_html":"(*, cascade : Bool = true, restart_identity : Bool = true)","location":{"filename":"src/avram/database.cr","line_number":266,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L266"},"def":{"name":"truncate","args":[{"name":"","external_name":"","restriction":""},{"name":"cascade","default_value":"true","external_name":"cascade","restriction":"Bool"},{"name":"restart_identity","default_value":"true","external_name":"restart_identity","restriction":"Bool"}],"splat_index":0,"visibility":"Public","body":"if table_names.empty?\n return\nend\ncascade_sql = cascade ? \" CASCADE\" : \"\"\nrestart_id_sql = restart_identity ? \" RESTART IDENTITY\" : \"\"\ntable_names_sql = table_names.join(\", \")\nsql = \"TRUNCATE TABLE #{table_names_sql}#{restart_id_sql}#{cascade_sql}\"\ndatabase.exec(sql)\n"}}]},{"html_id":"avram/Avram/Database/DatabaseInfo","path":"Avram/Database/DatabaseInfo.html","kind":"struct","full_name":"Avram::Database::DatabaseInfo","name":"DatabaseInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/database_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SQL_QUERY","name":"SQL_QUERY","value":"\" SELECT columns.table_name,\\n tables.table_type,\\n columns.table_schema,\\n columns.table_catalog,\\n columns.column_name,\\n columns.is_nullable,\\n columns.column_default,\\n columns.data_type\\n FROM information_schema.columns as columns\\n JOIN information_schema.tables as tables\\n ON tables.table_name = columns.table_name\\n AND tables.table_catalog = columns.table_catalog\\n AND tables.table_schema = columns.table_schema\\n WHERE columns.table_schema='public';\""}],"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"load(database:Avram::Database.class):DatabaseInfo-class-method","name":"load","abstract":false,"args":[{"name":"database","external_name":"database","restriction":"Avram::Database.class"}],"args_string":"(database : Avram::Database.class) : DatabaseInfo","args_html":"(database : Avram::Database.class) : DatabaseInfo","location":{"filename":"src/avram/database/database_info.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L21"},"def":{"name":"load","args":[{"name":"database","external_name":"database","restriction":"Avram::Database.class"}],"return_type":"DatabaseInfo","visibility":"Public","body":"column_infos = database.query(SQL_QUERY) do |rs|\n ColumnInfo.from_rs(rs)\nend\ngrouped = column_infos.group_by(&.table)\ngrouped.each do |table, columns|\n columns.each do |c|\n table.columns << c\n end\nend\ntable_infos = grouped.keys\nnew(table_infos)\n"}},{"html_id":"new(table_infos:Array(Avram::Database::TableInfo))-class-method","name":"new","abstract":false,"args":[{"name":"table_infos","external_name":"table_infos","restriction":"::Array(::Avram::Database::TableInfo)"}],"args_string":"(table_infos : Array(Avram::Database::TableInfo))","args_html":"(table_infos : Array(Avram::Database::TableInfo))","location":{"filename":"src/avram/database/database_info.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L34"},"def":{"name":"new","args":[{"name":"table_infos","external_name":"table_infos","restriction":"::Array(::Avram::Database::TableInfo)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_infos)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"table(name:String):TableInfo|Nil-instance-method","name":"table","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : TableInfo | Nil","args_html":"(name : String) : TableInfo | Nil","location":{"filename":"src/avram/database/database_info.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L45"},"def":{"name":"table","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"TableInfo | ::Nil","visibility":"Public","body":"table_infos.find() do |__arg2|\n __arg2.table_name == name\nend"}},{"html_id":"table?(name:String):Bool-instance-method","name":"table?","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : Bool","args_html":"(name : String) : Bool","location":{"filename":"src/avram/database/database_info.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L37"},"def":{"name":"table?","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"Bool","visibility":"Public","body":"table_names.includes?(name)"}},{"html_id":"table_infos:Array(TableInfo)-instance-method","name":"table_infos","abstract":false,"location":{"filename":"src/avram/database/database_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L32"},"def":{"name":"table_infos","return_type":"Array(TableInfo)","visibility":"Public","body":"@table_infos"}},{"html_id":"table_infos=(table_infos:Array(TableInfo))-instance-method","name":"table_infos=","abstract":false,"args":[{"name":"table_infos","external_name":"table_infos","restriction":"Array(TableInfo)"}],"args_string":"(table_infos : Array(TableInfo))","args_html":"(table_infos : Array(TableInfo))","location":{"filename":"src/avram/database/database_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L32"},"def":{"name":"table_infos=","args":[{"name":"table_infos","external_name":"table_infos","restriction":"Array(TableInfo)"}],"visibility":"Public","body":"@table_infos = table_infos"}},{"html_id":"table_names:Array(String)-instance-method","name":"table_names","abstract":false,"location":{"filename":"src/avram/database/database_info.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/database_info.cr#L41"},"def":{"name":"table_names","return_type":"Array(String)","visibility":"Public","body":"table_infos.map(&.table_name)"}}]},{"html_id":"avram/Avram/Database/FiberId","path":"Avram/Database/FiberId.html","kind":"alias","full_name":"Avram::Database::FiberId","name":"FiberId","abstract":false,"locations":[{"filename":"src/avram/database.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"UInt64","aliased_html":"UInt64","const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"}},{"html_id":"avram/Avram/Database/TableInfo","path":"Avram/Database/TableInfo.html","kind":"struct","full_name":"Avram::Database::TableInfo","name":"TableInfo","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/database/table_info.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Database","kind":"class","full_name":"Avram::Database","name":"Database"},"constructors":[{"html_id":"new(table_name:String,table_type:String,table_schema:String)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"::String"},{"name":"table_type","external_name":"table_type","restriction":"::String"},{"name":"table_schema","external_name":"table_schema","restriction":"::String"}],"args_string":"(table_name : String, table_type : String, table_schema : String)","args_html":"(table_name : String, table_type : String, table_schema : String)","location":{"filename":"src/avram/database/table_info.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L9"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"::String"},{"name":"table_type","external_name":"table_type","restriction":"::String"},{"name":"table_schema","external_name":"table_schema","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, table_type, table_schema)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column(name:String):ColumnInfo|Nil-instance-method","name":"column","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : ColumnInfo | Nil","args_html":"(name : String) : ColumnInfo | Nil","location":{"filename":"src/avram/database/table_info.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L32"},"def":{"name":"column","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"ColumnInfo | ::Nil","visibility":"Public","body":"columns.find() do |__arg1|\n __arg1.column_name == name\nend"}},{"html_id":"column?(name:String):Bool-instance-method","name":"column?","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String) : Bool","args_html":"(name : String) : Bool","location":{"filename":"src/avram/database/table_info.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L24"},"def":{"name":"column?","args":[{"name":"name","external_name":"name","restriction":"String"}],"return_type":"Bool","visibility":"Public","body":"column_names.includes?(name)"}},{"html_id":"column_names:Array(String)-instance-method","name":"column_names","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L28"},"def":{"name":"column_names","return_type":"Array(String)","visibility":"Public","body":"columns.map(&.column_name)"}},{"html_id":"columns:Array(Avram::Database::ColumnInfo)-instance-method","name":"columns","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L7"},"def":{"name":"columns","visibility":"Public","body":"@columns"}},{"html_id":"migrations_table?:Bool-instance-method","name":"migrations_table?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L36"},"def":{"name":"migrations_table?","return_type":"Bool","visibility":"Public","body":"table_name == \"migrations\""}},{"html_id":"table?:Bool-instance-method","name":"table?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L16"},"def":{"name":"table?","return_type":"Bool","visibility":"Public","body":"table_type == \"BASE TABLE\""}},{"html_id":"table_name:String-instance-method","name":"table_name","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L4"},"def":{"name":"table_name","return_type":"String","visibility":"Public","body":"@table_name"}},{"html_id":"table_schema:String-instance-method","name":"table_schema","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L6"},"def":{"name":"table_schema","return_type":"String","visibility":"Public","body":"@table_schema"}},{"html_id":"table_type:String-instance-method","name":"table_type","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L5"},"def":{"name":"table_type","return_type":"String","visibility":"Public","body":"@table_type"}},{"html_id":"view?:Bool-instance-method","name":"view?","abstract":false,"location":{"filename":"src/avram/database/table_info.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database/table_info.cr#L20"},"def":{"name":"view?","return_type":"Bool","visibility":"Public","body":"table_type == \"VIEW\""}}]}]},{"html_id":"avram/Avram/DatabaseValidations","path":"Avram/DatabaseValidations.html","kind":"module","full_name":"Avram::DatabaseValidations(T)","name":"DatabaseValidations","abstract":false,"locations":[{"filename":"src/avram/database_validations.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/database_validations.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/DefineAttribute","path":"Avram/DefineAttribute.html","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute","abstract":false,"locations":[{"filename":"src/avram/define_attribute.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"attributes-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L34"},"def":{"name":"attributes","visibility":"Public","body":"[] of Avram::PermittedAttribute(Nil)"}}],"macros":[{"html_id":"attribute(type_declaration)-macro","name":"attribute","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/define_attribute.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L36"},"def":{"name":"attribute","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.type.is_a?(Union) %}\n {% if type_declaration.value.is_a?(Nop) %}\n {% default_value = \"\" %}\n {% else %}\n {% default_value = \"= #{type_declaration.value}\" %}\n {% end %}\n {% raise(\"`attribute` in #{@type} must not be called with a type union or nilable type but was called with #{type_declaration.type}\\nIf you were attempting to create a nilable attribute, all attributes are considered nilable by default.\\n\\nTry this...\\n\\n attribute #{type_declaration.var} : #{type_declaration.type.types.first} #{default_value.id}\\n\\nRead more on attributes: https://luckyframework.org/guides/database/validating-saving\") %}\n {% end %}\n\n\n \n{% ATTRIBUTES << type_declaration %}\n\n\n \n{% type = type_declaration.type %}\n\n \n{% name = type_declaration.var %}\n\n \n{% default_value = if type_declaration.value.is_a?(Nop)\n nil\nelse\n type_declaration.value\nend %}\n\n @_\n{{ name }}\n : Avram::Attribute(\n{{ type }}\n)?\n\n \nensure_base_attributes_method_is_present\n\n def attributes\n ([\n{{ name }}\n] + previous_def + super).uniq\n \nend\n\n def \n{{ name }}\n\n _\n{{ name }}\n.permitted\n \nend\n\n private def _\n{{ name }}\n\n @_\n{{ name }}\n ||= Avram::Attribute(\n{{ type }}\n).new(\n name: \n{{ name.id.symbolize }}\n,\n value: \n{{ default_value }}\n,\n param_key: self.class.param_key\n ).tap do |attribute|\n attribute.extract(params)\n \nend\n \nend\n \n"}},{"html_id":"ensure_base_attributes_method_is_present-macro","name":"ensure_base_attributes_method_is_present","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L2"},"def":{"name":"ensure_base_attributes_method_is_present","visibility":"Public","body":" \n{% if !(@type.methods.map(&.name).includes?((:attributes).id)) %}\n def attributes\n [] of Avram::PermittedAttribute(Nil)\n end\n {% end %}\n\n \n"}},{"html_id":"file_attribute(key)-macro","name":"file_attribute","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","location":{"filename":"src/avram/define_attribute.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L90"},"def":{"name":"file_attribute","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" \n{% if key.is_a?(SymbolLiteral) %}{% else %}\n {% raise(\"file_attribute must be declared with a Symbol\") %}\n {% end %}\n\n\n attribute \n{{ key.id }}\n : Avram::Uploadable\n \n"}},{"html_id":"inherit_attributes-macro","name":"inherit_attributes","abstract":false,"location":{"filename":"src/avram/define_attribute.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/define_attribute.cr#L18"},"def":{"name":"inherit_attributes","visibility":"Public","body":" \n\\{% if\n !@type.constant(:ATTRIBUTES) %}\n ATTRIBUTES = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n attribute in @type.ancestors.first.constant :ATTRIBUTES %}\n \n\\{% \nATTRIBUTES << attribute %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_attributes\n \nend\n \n"}}]},{"html_id":"avram/Avram/DeleteOperation","path":"Avram/DeleteOperation.html","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L34"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"T.name.underscore"}}],"instance_methods":[{"html_id":"after_delete(_record:T)-instance-method","name":"after_delete","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/delete_operation.cr","line_number":89,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L89"},"def":{"name":"after_delete","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"before_delete-instance-method","name":"before_delete","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L87"},"def":{"name":"before_delete","visibility":"Public","body":""}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"delete:Bool-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L38"},"def":{"name":"delete","return_type":"Bool","visibility":"Public","body":"before_delete\nif valid?\n result = delete_or_soft_delete(@record)\n @record = result\n after_delete(@record)\n publish_delete_success_event\n mark_as_deleted\nelse\n publish_delete_failed_event\n mark_as_failed\nend\n"}},{"html_id":"delete!-instance-method","name":"delete!","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":53,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L53"},"def":{"name":"delete!","visibility":"Public","body":"if delete\n @record\nelse\n raise(Avram::InvalidOperationError.new(operation: self))\nend"}},{"html_id":"deleted?:Bool-instance-method","name":"deleted?","doc":"Returns true if the operation has run and saved the record successfully","summary":"

Returns true if the operation has run and saved the record successfully

","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L78"},"def":{"name":"deleted?","return_type":"Bool","visibility":"Public","body":"delete_status == OperationStatus::Deleted"}},{"html_id":"mark_as_deleted:Bool-instance-method","name":"mark_as_deleted","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L72"},"def":{"name":"mark_as_deleted","return_type":"Bool","visibility":"Public","body":"self.delete_status = OperationStatus::Deleted\ntrue\n"}},{"html_id":"mark_as_failed:Bool-instance-method","name":"mark_as_failed","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L82"},"def":{"name":"mark_as_failed","return_type":"Bool","visibility":"Public","body":"self.delete_status = OperationStatus::DeleteFailed\nfalse\n"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L67"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}}],"types":[{"html_id":"avram/Avram/DeleteOperation/OperationStatus","path":"Avram/DeleteOperation/OperationStatus.html","kind":"enum","full_name":"Avram::DeleteOperation::OperationStatus","name":"OperationStatus","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L19"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Deleted","name":"Deleted","value":"0"},{"id":"DeleteFailed","name":"DeleteFailed","value":"1"},{"id":"Unperformed","name":"Unperformed","value":"2"}],"namespace":{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},"instance_methods":[{"html_id":"delete_failed?-instance-method","name":"delete_failed?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L21"},"def":{"name":"delete_failed?","visibility":"Public","body":"self == DeleteFailed"}},{"html_id":"deleted?-instance-method","name":"deleted?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L20"},"def":{"name":"deleted?","visibility":"Public","body":"self == Deleted"}},{"html_id":"unperformed?-instance-method","name":"unperformed?","abstract":false,"location":{"filename":"src/avram/delete_operation.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation.cr#L22"},"def":{"name":"unperformed?","visibility":"Public","body":"self == Unperformed"}}]}]},{"html_id":"avram/Avram/DeleteOperationTemplate","path":"Avram/DeleteOperationTemplate.html","kind":"class","full_name":"Avram::DeleteOperationTemplate","name":"DeleteOperationTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/delete_operation_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, *args, **named_args)","args_html":"(type, columns, *args, **named_args)","location":{"filename":"src/avram/delete_operation_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/delete_operation_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":2,"visibility":"Public","body":" def delete_operation_class : ::\n{{ type }}\n::DeleteOperation.class\n ::\n{{ type }}\n::DeleteOperation\n \nend\n\n class ::\n{{ type }}\n::DeleteOperation < Avram::DeleteOperation(\n{{ type }}\n)\n\n add_column_attributes(\n{{ columns }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/Events","path":"Avram/Events.html","kind":"module","full_name":"Avram::Events","name":"Events","abstract":false,"locations":[{"filename":"src/avram/events/delete_failed_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Events/DeleteFailedEvent","path":"Avram/Events/DeleteFailedEvent.html","kind":"class","full_name":"Avram::Events::DeleteFailedEvent","name":"DeleteFailedEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/delete_failed_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,errors:Hash(Symbol,Array(String)))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Hash(Symbol, Array(String))"}],"args_string":"(operation_class : String, errors : Hash(Symbol, Array(String)))","args_html":"(operation_class : String, errors : Hash(Symbol, Array(String)))","location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Hash(Symbol, Array(String))"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, errors)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"error_messages_as_string-instance-method","name":"error_messages_as_string","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L10"},"def":{"name":"error_messages_as_string","visibility":"Public","body":"String.build do |msg|\n errors.each do |key, messages|\n msg << \"#{key} #{messages.join(\", \")}\"\n end\nend"}},{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L2"},"def":{"name":"errors","visibility":"Public","body":"@errors"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/delete_failed_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_failed_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/DeleteSuccessEvent","path":"Avram/Events/DeleteSuccessEvent.html","kind":"class","full_name":"Avram::Events::DeleteSuccessEvent","name":"DeleteSuccessEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/delete_success_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_success_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String)-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"}],"args_string":"(operation_class : String)","args_html":"(operation_class : String)","location":{"filename":"src/avram/events/delete_success_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_success_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/delete_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/delete_success_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/FailedQueryEvent","path":"Avram/Events/FailedQueryEvent.html","kind":"class","full_name":"Avram::Events::FailedQueryEvent","name":"FailedQueryEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/failed_query_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(error_message:String,query:String,args:String|Nil,queryable:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"error_message","external_name":"error_message","restriction":"String"},{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(error_message : String, query : String, args : String | Nil, queryable : String | Nil = nil)","args_html":"(error_message : String, query : String, args : String | Nil, queryable : String | Nil = nil)","location":{"filename":"src/avram/events/failed_query_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L4"},"def":{"name":"new","args":[{"name":"error_message","external_name":"error_message","restriction":"String"},{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(error_message, query, args, queryable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:String?-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"args","visibility":"Public","body":"@args"}},{"html_id":"error_message:String-instance-method","name":"error_message","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"error_message","visibility":"Public","body":"@error_message"}},{"html_id":"query:String-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"query","visibility":"Public","body":"@query"}},{"html_id":"queryable:String?-instance-method","name":"queryable","abstract":false,"location":{"filename":"src/avram/events/failed_query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/failed_query_event.cr#L2"},"def":{"name":"queryable","visibility":"Public","body":"@queryable"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/QueryEvent","path":"Avram/Events/QueryEvent.html","kind":"class","full_name":"Avram::Events::QueryEvent","name":"QueryEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/TimedEvent","kind":"class","full_name":"Pulsar::TimedEvent","name":"TimedEvent"},"ancestors":[{"html_id":"avram/Pulsar/TimedEvent","kind":"class","full_name":"Pulsar::TimedEvent","name":"TimedEvent"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/query_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(query:String,args:String|Nil,queryable:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"args_string":"(query : String, args : String | Nil, queryable : String | Nil = nil)","args_html":"(query : String, args : String | Nil, queryable : String | Nil = nil)","location":{"filename":"src/avram/events/query_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L4"},"def":{"name":"new","args":[{"name":"query","external_name":"query","restriction":"String"},{"name":"args","external_name":"args","restriction":"String | ::Nil"},{"name":"queryable","default_value":"nil","external_name":"queryable","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(query, args, queryable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:String?-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L2"},"def":{"name":"args","visibility":"Public","body":"@args"}},{"html_id":"query:String-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L2"},"def":{"name":"query","visibility":"Public","body":"@query"}},{"html_id":"queryable:String?-instance-method","name":"queryable","abstract":false,"location":{"filename":"src/avram/events/query_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/query_event.cr#L2"},"def":{"name":"queryable","visibility":"Public","body":"@queryable"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/SaveFailedEvent","path":"Avram/Events/SaveFailedEvent.html","kind":"class","full_name":"Avram::Events::SaveFailedEvent","name":"SaveFailedEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/save_failed_event.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,attributes:Array(Avram::GenericAttribute))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"args_string":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","args_html":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","location":{"filename":"src/avram/events/save_failed_event.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L7"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, attributes)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attributes:Array(Avram::GenericAttribute)-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L5"},"def":{"name":"attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"@attributes"}},{"html_id":"error_messages_as_string:String-instance-method","name":"error_messages_as_string","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L17"},"def":{"name":"error_messages_as_string","return_type":"String","visibility":"Public","body":"invalid_attributes.join(\". \") do |attribute|\n \"#{attribute.name} #{attribute.errors.join(\", \")}\"\nend"}},{"html_id":"invalid_attributes:Array(Avram::GenericAttribute)-instance-method","name":"invalid_attributes","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L13"},"def":{"name":"invalid_attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"attributes.reject(&.valid?)"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/save_failed_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_failed_event.cr#L4"},"def":{"name":"operation_class","return_type":"String","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]},{"html_id":"avram/Avram/Events/SaveSuccessEvent","path":"Avram/Events/SaveSuccessEvent.html","kind":"class","full_name":"Avram::Events::SaveSuccessEvent","name":"SaveSuccessEvent","abstract":false,"superclass":{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},"ancestors":[{"html_id":"avram/Pulsar/Event","kind":"class","full_name":"Pulsar::Event","name":"Event"},{"html_id":"avram/Pulsar/BaseEvent","kind":"class","full_name":"Pulsar::BaseEvent","name":"BaseEvent"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/events/save_success_event.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_success_event.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Events","kind":"module","full_name":"Avram::Events","name":"Events"},"class_methods":[{"html_id":"logged_events-class-method","name":"logged_events","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"def":{"name":"logged_events","visibility":"Public","body":"@@logged_events"}},{"html_id":"logged_events=(logged_events)-class-method","name":"logged_events=","doc":"Used by `Pulsar::SpecHelper` to test for logged events","summary":"

Used by Pulsar::SpecHelper to test for logged events

","abstract":false,"args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"args_string":"(logged_events)","args_html":"(logged_events)","def":{"name":"logged_events=","args":[{"name":"logged_events","external_name":"logged_events","restriction":""}],"visibility":"Public","body":"@@logged_events = logged_events"}}],"constructors":[{"html_id":"new(operation_class:String,attributes:Array(Avram::GenericAttribute))-class-method","name":"new","abstract":false,"args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"args_string":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","args_html":"(operation_class : String, attributes : Array(Avram::GenericAttribute))","location":{"filename":"src/avram/events/save_success_event.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_success_event.cr#L4"},"def":{"name":"new","args":[{"name":"operation_class","external_name":"operation_class","restriction":"String"},{"name":"attributes","external_name":"attributes","restriction":"Array(Avram::GenericAttribute)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation_class, attributes)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attributes:Array(Avram::GenericAttribute)-instance-method","name":"attributes","abstract":false,"location":{"filename":"src/avram/events/save_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_success_event.cr#L2"},"def":{"name":"attributes","visibility":"Public","body":"@attributes"}},{"html_id":"operation_class:String-instance-method","name":"operation_class","abstract":false,"location":{"filename":"src/avram/events/save_success_event.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/events/save_success_event.cr#L2"},"def":{"name":"operation_class","visibility":"Public","body":"@operation_class"}},{"html_id":"started_at:Time-instance-method","name":"started_at","doc":"When the event started","summary":"

When the event started

","abstract":false,"def":{"name":"started_at","return_type":"Time","visibility":"Public","body":"@started_at"}}]}]},{"html_id":"avram/Avram/ExtractCriteria","path":"Avram/ExtractCriteria.html","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/extract_criteria.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria_extensions/extract_criteria.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Time/Lucky/Criteria","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Factory","path":"Avram/Factory.html","kind":"class","full_name":"Avram::Factory","name":"Factory","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/factory.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SEQUENCES","name":"SEQUENCES","value":"{} of String => Int32"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"build_attributes(&)-class-method","name":"build_attributes","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L66"},"def":{"name":"build_attributes","yields":1,"block_arity":1,"visibility":"Public","body":"(yield(new)).attributes"}},{"html_id":"build_attributes-class-method","name":"build_attributes","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L70"},"def":{"name":"build_attributes","visibility":"Public","body":"new.attributes"}},{"html_id":"create-class-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L74"},"def":{"name":"create","visibility":"Public","body":"new.create"}},{"html_id":"create(&)-class-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L78"},"def":{"name":"create","yields":1,"block_arity":1,"visibility":"Public","body":"(yield(new)).create"}},{"html_id":"create_pair-class-method","name":"create_pair","doc":"Returns an array with 2 instances of the model from the Factory.\n\nUsage:\n\n```\ntags = TagFactory.create_pair\ntypeof(tags) # => Array(Tag)\ntags.size # => 2\n```","summary":"

Returns an array with 2 instances of the model from the Factory.

","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L97"},"def":{"name":"create_pair","visibility":"Public","body":"create_pair do |factory|\n factory\nend"}},{"html_id":"create_pair(&)-class-method","name":"create_pair","doc":"Similar to `create_pair`, but accepts a block which yields the factory instance.\n\nBoth factories receive the same argument values.\n\nUsage:\n\n```\nTagFactory.create_pair do |factory|\n # set both factories name to \"test\"\n factory.name(\"test\")\nend\n```","summary":"

Similar to .create_pair, but accepts a block which yields the factory instance.

","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":113,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L113"},"def":{"name":"create_pair","yields":1,"block_arity":1,"visibility":"Public","body":"[1, 2].map do |n|\n self.create do |factory|\n yield(factory)\n end\nend"}}],"instance_methods":[{"html_id":"create-instance-method","name":"create","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L82"},"def":{"name":"create","visibility":"Public","body":"run_before_save_callbacks\nrecord = operation.save!\nrun_after_save_callbacks(record)\n"}},{"html_id":"operation-instance-method","name":"operation","abstract":false,"location":{"filename":"src/avram/factory.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L2"},"def":{"name":"operation","visibility":"Public","body":"@operation"}},{"html_id":"sequence(value:String):String-instance-method","name":"sequence","doc":"Returns a value with a number to use for unique values.\n\nUsage:\n\n```\nclass UserFactory < Avram::Factory\n def initialize\n username sequence(\"username\") # => username-1, username-2, etc.\n email \"#{sequence(\"email\")}@example.com\" # => email-1@example.com, email-2@example.com, etc.\n end\nend\n```","summary":"

Returns a value with a number to use for unique values.

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/factory.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L131"},"def":{"name":"sequence","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"__temp_91 = value\n__temp_92 = SEQUENCES\n__temp_92[__temp_91]? || (__temp_92[__temp_91] = 0)\n__temp_93 = value\n__temp_94 = SEQUENCES\n__temp_94[__temp_93] = __temp_94[__temp_93] + 1\n\"#{value}-#{SEQUENCES[value]}\"\n"}}],"macros":[{"html_id":"setup_attribute_shortcuts(operation)-macro","name":"setup_attribute_shortcuts","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/factory.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L20"},"def":{"name":"setup_attribute_shortcuts","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":" \n{% for attribute in operation.resolve.constant(:COLUMN_ATTRIBUTES) %}\n def {{ attribute[:name] }}(value : {{ attribute[:type] }}{% if attribute[:nilable] %}?{% end %})\n operation.{{ attribute[:name] }}.value = value\n self\n end\n {% end %}\n\n \n"}},{"html_id":"setup_attributes(operation)-macro","name":"setup_attributes","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/factory.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L29"},"def":{"name":"setup_attributes","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":" def attributes\n \n{\n \n{% for attribute in operation.resolve.constant(:COLUMN_ATTRIBUTES) %}\n {{ attribute[:name] }}: operation.{{ attribute[:name] }}.value,\n {% end %}\n\n }\n \nend\n \n"}},{"html_id":"setup_callbacks(model_name)-macro","name":"setup_callbacks","abstract":false,"args":[{"name":"model_name","external_name":"model_name","restriction":""}],"args_string":"(model_name)","args_html":"(model_name)","location":{"filename":"src/avram/factory.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/factory.cr#L39"},"def":{"name":"setup_callbacks","args":[{"name":"model_name","external_name":"model_name","restriction":""}],"visibility":"Public","body":" \n# Run `block` before the record is created\n\n def before_save(&block : -> Nil) : self\n @before_saves << block\n\n self\n \nend\n\n \n# Run `block` after the record is created.\n\n \n# The block will yield the created record instance\n\n def after_save(&block : \n{{ model_name.id }}\n -> Nil) : self\n @after_saves << block\n\n self\n \nend\n\n private def run_before_save_callbacks\n @before_saves.each(&.call)\n \nend\n\n private def run_after_save_callbacks(record : \n{{ model_name.id }}\n)\n @after_saves.each(&.call(record))\n\n record\n \nend\n \n"}}]},{"html_id":"avram/Avram/FailedMigration","path":"Avram/FailedMigration.html","kind":"class","full_name":"Avram::FailedMigration","name":"FailedMigration","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":160,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L160"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(migration:String,statements:Array(String),cause:Exception)-class-method","name":"new","abstract":false,"args":[{"name":"migration","external_name":"migration","restriction":"String"},{"name":"statements","external_name":"statements","restriction":"Array(String)"},{"name":"cause","external_name":"cause","restriction":"Exception"}],"args_string":"(migration : String, statements : Array(String), cause : Exception)","args_html":"(migration : String, statements : Array(String), cause : Exception)","location":{"filename":"src/avram/errors.cr","line_number":164,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L164"},"def":{"name":"new","args":[{"name":"migration","external_name":"migration","restriction":"String"},{"name":"statements","external_name":"statements","restriction":"Array(String)"},{"name":"cause","external_name":"cause","restriction":"Exception"}],"visibility":"Public","body":"_ = allocate\n_.initialize(migration, statements, cause)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"migration:String-instance-method","name":"migration","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":161,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L161"},"def":{"name":"migration","return_type":"String","visibility":"Public","body":"@migration"}},{"html_id":"statements:Array(String)-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L162"},"def":{"name":"statements","return_type":"Array(String)","visibility":"Public","body":"@statements"}}]},{"html_id":"avram/Avram/FailedOperation","path":"Avram/FailedOperation.html","kind":"class","full_name":"Avram::FailedOperation","name":"FailedOperation","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":157,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L157"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Used when `Avram::Operation` fails.","summary":"

Used when Avram::Operation fails.

"},{"html_id":"avram/Avram/GenericAttribute","path":"Avram/GenericAttribute.html","kind":"class","full_name":"Avram::GenericAttribute","name":"GenericAttribute","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/generic_attribute.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"A generic version of `Avram::Attribute` that is used for reporting and metrics.\n\nThis is a data only version of an `Avram::Atribute`. It is purely for\nretrieving and reporting on data. For example, `Avram::GenericAttribute` is\nused by `Avram::Events::SaveFailedEvent` so that subscribers can\nget information about attributes that failed to save.","summary":"

A generic version of Avram::Attribute that is used for reporting and metrics.

","constructors":[{"html_id":"new(name:Symbol,param:String|Nil,original_value:String|Nil,value:String|Nil,param_key:String,errors:Array(String))-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"Symbol"},{"name":"param","external_name":"param","restriction":"String | ::Nil"},{"name":"original_value","external_name":"original_value","restriction":"String | ::Nil"},{"name":"value","external_name":"value","restriction":"String | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Array(String)"}],"args_string":"(name : Symbol, param : String | Nil, original_value : String | Nil, value : String | Nil, param_key : String, errors : Array(String))","args_html":"(name : Symbol, param : String | Nil, original_value : String | Nil, value : String | Nil, param_key : String, errors : Array(String))","location":{"filename":"src/avram/generic_attribute.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L15"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"Symbol"},{"name":"param","external_name":"param","restriction":"String | ::Nil"},{"name":"original_value","external_name":"original_value","restriction":"String | ::Nil"},{"name":"value","external_name":"value","restriction":"String | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":"String"},{"name":"errors","external_name":"errors","restriction":"Array(String)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, param, original_value, value, param_key, errors)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"errors:Array(String)-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L13"},"def":{"name":"errors","return_type":"Array(String)","visibility":"Public","body":"@errors"}},{"html_id":"name:Symbol-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L8"},"def":{"name":"name","return_type":"Symbol","visibility":"Public","body":"@name"}},{"html_id":"original_value:String|Nil-instance-method","name":"original_value","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L10"},"def":{"name":"original_value","return_type":"String | ::Nil","visibility":"Public","body":"@original_value"}},{"html_id":"param:String|Nil-instance-method","name":"param","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L9"},"def":{"name":"param","return_type":"String | ::Nil","visibility":"Public","body":"@param"}},{"html_id":"param_key:String-instance-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L12"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"@param_key"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L25"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"errors.empty?"}},{"html_id":"value:String|Nil-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/generic_attribute.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/generic_attribute.cr#L11"},"def":{"name":"value","return_type":"String | ::Nil","visibility":"Public","body":"@value"}}]},{"html_id":"avram/Avram/HabitatSettings","path":"Avram/HabitatSettings.html","kind":"class","full_name":"Avram::HabitatSettings","name":"HabitatSettings","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"database_to_migrate:Avram::Database.class-class-method","name":"database_to_migrate","abstract":false,"def":{"name":"database_to_migrate","return_type":"Avram::Database.class","visibility":"Public","body":"@@database_to_migrate.not_nil!"}},{"html_id":"database_to_migrate=(value:Avram::Database.class)-class-method","name":"database_to_migrate=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::Database.class"}],"args_string":"(value : Avram::Database.class)","args_html":"(value : Avram::Database.class)","def":{"name":"database_to_migrate=","args":[{"name":"value","external_name":"value","restriction":"Avram::Database.class"}],"visibility":"Public","body":"@@database_to_migrate = value"}},{"html_id":"database_to_migrate?-class-method","name":"database_to_migrate?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use database_to_migrate in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use database_to_migrate in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"database_to_migrate?","visibility":"Public","body":"@@database_to_migrate"}},{"html_id":"i18n_backend:Avram::I18nBackend-class-method","name":"i18n_backend","abstract":false,"def":{"name":"i18n_backend","return_type":"Avram::I18nBackend","visibility":"Public","body":"@@i18n_backend.not_nil!"}},{"html_id":"i18n_backend=(value:Avram::I18nBackend)-class-method","name":"i18n_backend=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::I18nBackend"}],"args_string":"(value : Avram::I18nBackend)","args_html":"(value : Avram::I18nBackend)","def":{"name":"i18n_backend=","args":[{"name":"value","external_name":"value","restriction":"Avram::I18nBackend"}],"visibility":"Public","body":"@@i18n_backend = value"}},{"html_id":"i18n_backend?-class-method","name":"i18n_backend?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use i18n_backend in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use i18n_backend in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"i18n_backend?","visibility":"Public","body":"@@i18n_backend"}},{"html_id":"lazy_load_enabled:Bool-class-method","name":"lazy_load_enabled","abstract":false,"def":{"name":"lazy_load_enabled","return_type":"Bool","visibility":"Public","body":"@@lazy_load_enabled.not_nil!"}},{"html_id":"lazy_load_enabled=(value:Bool)-class-method","name":"lazy_load_enabled=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","def":{"name":"lazy_load_enabled=","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"@@lazy_load_enabled = value"}},{"html_id":"lazy_load_enabled?-class-method","name":"lazy_load_enabled?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use lazy_load_enabled in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use lazy_load_enabled in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"lazy_load_enabled?","visibility":"Public","body":"@@lazy_load_enabled"}},{"html_id":"query_cache_enabled:Bool-class-method","name":"query_cache_enabled","abstract":false,"def":{"name":"query_cache_enabled","return_type":"Bool","visibility":"Public","body":"@@query_cache_enabled.not_nil!"}},{"html_id":"query_cache_enabled=(value:Bool)-class-method","name":"query_cache_enabled=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","def":{"name":"query_cache_enabled=","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"@@query_cache_enabled = value"}},{"html_id":"query_cache_enabled?-class-method","name":"query_cache_enabled?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use query_cache_enabled in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use query_cache_enabled in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"query_cache_enabled?","visibility":"Public","body":"@@query_cache_enabled"}},{"html_id":"time_formats:Array(String)-class-method","name":"time_formats","abstract":false,"def":{"name":"time_formats","return_type":"Array(String)","visibility":"Public","body":"@@time_formats.not_nil!"}},{"html_id":"time_formats=(value:Array(String))-class-method","name":"time_formats=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Array(String)"}],"args_string":"(value : Array(String))","args_html":"(value : Array(String))","def":{"name":"time_formats=","args":[{"name":"value","external_name":"value","restriction":"Array(String)"}],"visibility":"Public","body":"@@time_formats = value"}},{"html_id":"time_formats?-class-method","name":"time_formats?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use time_formats in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use time_formats in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"time_formats?","visibility":"Public","body":"@@time_formats"}},{"html_id":"to_h-class-method","name":"to_h","doc":"Generates a hash using the provided values","summary":"

Generates a hash using the provided values

","abstract":false,"def":{"name":"to_h","visibility":"Public","body":"{\"lazy_load_enabled\" => lazy_load_enabled, \"database_to_migrate\" => database_to_migrate, \"time_formats\" => time_formats, \"i18n_backend\" => i18n_backend, \"query_cache_enabled\" => query_cache_enabled}"}}]},{"html_id":"avram/Avram/I18n","path":"Avram/I18n.html","kind":"struct","full_name":"Avram::I18n","name":"I18n","abstract":false,"superclass":{"html_id":"avram/Avram/I18nBackend","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend"},"ancestors":[{"html_id":"avram/Avram/I18nBackend","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/i18n_backend.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L5"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"get(key:String|Symbol):String-instance-method","name":"get","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"args_string":"(key : String | Symbol) : String","args_html":"(key : String | Symbol) : String","location":{"filename":"src/avram/i18n_backend.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L6"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"return_type":"String","visibility":"Public","body":"{validate_acceptance_of: \"must be accepted\", validate_at_most_one_filled: \"must be blank\", validate_confirmation_of: \"must match\", validate_exact_size_of: \"must be exactly %d characters long\", validate_exactly_one_filled: \"at least one must be filled\", validate_format_of: \"is invalid\", validate_inclusion_of: \"is not included in the list\", validate_max_size_of: \"must not have more than %d characters\", validate_min_size_of: \"must have at least %d characters\", validate_numeric_max: \"must be no more than %s\", validate_numeric_min: \"must be at least %s\", validate_numeric_nil: \"must not be nil\", validate_required: \"is required\", validate_uniqueness_of: \"is already taken\"}[key]"}}]},{"html_id":"avram/Avram/I18nBackend","path":"Avram/I18nBackend.html","kind":"struct","full_name":"Avram::I18nBackend","name":"I18nBackend","abstract":true,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/I18n","kind":"struct","full_name":"Avram::I18n","name":"I18n"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L1"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"get(key:String|Symbol):String-instance-method","name":"get","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"args_string":"(key : String | Symbol) : String","args_html":"(key : String | Symbol) : String","location":{"filename":"src/avram/i18n_backend.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L2"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String | Symbol"}],"return_type":"String","visibility":"Public","body":""}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/avram/i18n_backend.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/i18n_backend.cr#L1"},"def":{"name":"initialize","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/ImpossibleValidation","path":"Avram/ImpossibleValidation.html","kind":"class","full_name":"Avram::ImpossibleValidation","name":"ImpossibleValidation","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L50"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when a validation is expecting an impossible constraint","summary":"

Raised when a validation is expecting an impossible constraint

","constructors":[{"html_id":"new(attribute:Symbol,message:String=\"animpossiblevalidation\")-class-method","name":"new","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Symbol"},{"name":"message","default_value":"\"an impossible validation\"","external_name":"message","restriction":"String"}],"args_string":"(attribute : Symbol, message : String = \"an impossible validation\")","args_html":"(attribute : Symbol, message : String = "an impossible validation")","location":{"filename":"src/avram/errors.cr","line_number":53,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L53"},"def":{"name":"new","args":[{"name":"attribute","external_name":"attribute","restriction":"Symbol"},{"name":"message","default_value":"\"an impossible validation\"","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(attribute, message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"attribute:Symbol-instance-method","name":"attribute","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L51"},"def":{"name":"attribute","return_type":"Symbol","visibility":"Public","body":"@attribute"}}]},{"html_id":"avram/Avram/IncludesCriteria","path":"Avram/IncludesCriteria.html","kind":"module","full_name":"Avram::IncludesCriteria(T, V)","name":"IncludesCriteria","abstract":false,"locations":[{"filename":"src/avram/criteria_extensions/includes_criteria.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria_extensions/includes_criteria.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/Int64/Lucky/Criteria","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/String/Lucky/Criteria","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria"},{"html_id":"avram/UUID/Lucky/Criteria","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/InheritColumnAttributes","path":"Avram/InheritColumnAttributes.html","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes","abstract":false,"locations":[{"filename":"src/avram/inherit_column_attributes.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/inherit_column_attributes.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"inherit_column_attributes-macro","name":"inherit_column_attributes","abstract":false,"location":{"filename":"src/avram/inherit_column_attributes.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/inherit_column_attributes.cr#L8"},"def":{"name":"inherit_column_attributes","visibility":"Public","body":" \n\\{% if\n !@type.constant(:COLUMN_ATTRIBUTES) %}\n COLUMN_ATTRIBUTES = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n attribute in @type.ancestors.first.constant :COLUMN_ATTRIBUTES %}\n \n\\{% \nCOLUMN_ATTRIBUTES << attribute %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_column_attributes\n \nend\n \n"}}]},{"html_id":"avram/Avram/Insert","path":"Avram/Insert.html","kind":"class","full_name":"Avram::Insert","name":"Insert","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/insert.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(table:TableName,params:Params,column_names:Array(Symbol)=[]ofSymbol)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"params","external_name":"params","restriction":"Params"},{"name":"column_names","default_value":"[] of Symbol","external_name":"column_names","restriction":"Array(Symbol)"}],"args_string":"(table : TableName, params : Params, column_names : Array(Symbol) = [] of Symbol)","args_html":"(table : TableName, params : Params, column_names : Array(Symbol) = [] of Symbol)","location":{"filename":"src/avram/insert.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L4"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"params","external_name":"params","restriction":"Params"},{"name":"column_names","default_value":"[] of Symbol","external_name":"column_names","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, params, column_names)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/insert.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L19"},"def":{"name":"args","visibility":"Public","body":"@params.values"}},{"html_id":"statement:String-instance-method","name":"statement","abstract":false,"location":{"filename":"src/avram/insert.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L7"},"def":{"name":"statement","return_type":"String","visibility":"Public","body":"\"insert into #{@table}(#{fields}) values(#{values_placeholders}) returning #{returning}\""}}],"types":[{"html_id":"avram/Avram/Insert/Params","path":"Avram/Insert/Params.html","kind":"alias","full_name":"Avram::Insert::Params","name":"Params","abstract":false,"locations":[{"filename":"src/avram/insert.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/insert.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Hash(Symbol, Nil) | Hash(Symbol, String | Nil) | Hash(Symbol, String))","aliased_html":"Hash(Symbol, Nil) | Hash(Symbol, String?) | Hash(Symbol, String)","const":false,"namespace":{"html_id":"avram/Avram/Insert","kind":"class","full_name":"Avram::Insert","name":"Insert"}}]},{"html_id":"avram/Avram/InvalidDatabaseNameError","path":"Avram/InvalidDatabaseNameError.html","kind":"class","full_name":"Avram::InvalidDatabaseNameError","name":"InvalidDatabaseNameError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":150,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L150"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/InvalidOperationError","path":"Avram/InvalidOperationError.html","kind":"class","full_name":"Avram::InvalidOperationError","name":"InvalidOperationError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Lucky/RenderableError","kind":"module","full_name":"Lucky::RenderableError","name":"RenderableError"},{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L59"},{"filename":"src/lucky/ext/avram/errors.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/RenderableError","kind":"module","full_name":"Lucky::RenderableError","name":"RenderableError"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when using the create!, update!, or delete! methods on an operation when it does not have the proper attributes","summary":"

Raised when using the create!, update!, or delete! methods on an operation when it does not have the proper attributes

","constructors":[{"html_id":"new(operation)-class-method","name":"new","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":""}],"args_string":"(operation)","args_html":"(operation)","location":{"filename":"src/avram/errors.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L62"},"def":{"name":"new","args":[{"name":"operation","external_name":"operation","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(operation)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L60"},"def":{"name":"errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@errors"}},{"html_id":"invalid_attribute_name:String-instance-method","name":"invalid_attribute_name","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L17"},"def":{"name":"invalid_attribute_name","return_type":"String","visibility":"Public","body":"invalid_attribute[0].to_s"}},{"html_id":"renderable_details:String-instance-method","name":"renderable_details","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L13"},"def":{"name":"renderable_details","return_type":"String","visibility":"Public","body":"\"#{invalid_attribute_name} #{validation_messages.first}\""}},{"html_id":"renderable_message:String-instance-method","name":"renderable_message","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L9"},"def":{"name":"renderable_message","return_type":"String","visibility":"Public","body":"\"Invalid params\""}},{"html_id":"renderable_status:Int32-instance-method","name":"renderable_status","abstract":false,"location":{"filename":"src/lucky/ext/avram/errors.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/ext/avram/errors.cr#L5"},"def":{"name":"renderable_status","return_type":"Int32","visibility":"Public","body":"400"}}]},{"html_id":"avram/Avram/InvalidQueryError","path":"Avram/InvalidQueryError.html","kind":"class","full_name":"Avram::InvalidQueryError","name":"InvalidQueryError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L153"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Join","path":"Avram/Join.html","kind":"module","full_name":"Avram::Join","name":"Join","abstract":false,"locations":[{"filename":"src/avram/join.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Join/Full","path":"Avram/Join/Full.html","kind":"class","full_name":"Avram::Join::Full","name":"Full","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L63"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L64"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"FULL\""}}]},{"html_id":"avram/Avram/Join/Inner","path":"Avram/Join/Inner.html","kind":"class","full_name":"Avram::Join::Inner","name":"Inner","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L46"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"INNER\""}}]},{"html_id":"avram/Avram/Join/Left","path":"Avram/Join/Left.html","kind":"class","full_name":"Avram::Join::Left","name":"Left","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L51"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L52"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"LEFT\""}}]},{"html_id":"avram/Avram/Join/Right","path":"Avram/Join/Right.html","kind":"class","full_name":"Avram::Join::Right","name":"Right","abstract":false,"superclass":{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Join/SqlClause","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L57"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"instance_methods":[{"html_id":"join_type:String-instance-method","name":"join_type","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L58"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":"\"RIGHT\""}}]},{"html_id":"avram/Avram/Join/SqlClause","path":"Avram/Join/SqlClause.html","kind":"class","full_name":"Avram::Join::SqlClause","name":"SqlClause","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/join.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Join/Full","kind":"class","full_name":"Avram::Join::Full","name":"Full"},{"html_id":"avram/Avram/Join/Inner","kind":"class","full_name":"Avram::Join::Inner","name":"Inner"},{"html_id":"avram/Avram/Join/Left","kind":"class","full_name":"Avram::Join::Left","name":"Left"},{"html_id":"avram/Avram/Join/Right","kind":"class","full_name":"Avram::Join::Right","name":"Right"}],"namespace":{"html_id":"avram/Avram/Join","kind":"module","full_name":"Avram::Join","name":"Join"},"constructors":[{"html_id":"new(from:TableName,to:TableName,primary_key:Symbol|Nil=nil,foreign_key:Symbol|Nil=nil,comparison:String|Nil=\"=\",using:Array(Symbol)=[]ofSymbol)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"primary_key","default_value":"nil","external_name":"primary_key","restriction":"Symbol | ::Nil"},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":"Symbol | ::Nil"},{"name":"comparison","default_value":"\"=\"","external_name":"comparison","restriction":"String | ::Nil"},{"name":"using","default_value":"[] of Symbol","external_name":"using","restriction":"Array(Symbol)"}],"args_string":"(from : TableName, to : TableName, primary_key : Symbol | Nil = nil, foreign_key : Symbol | Nil = nil, comparison : String | Nil = \"=\", using : Array(Symbol) = [] of Symbol)","args_html":"(from : TableName, to : TableName, primary_key : Symbol | Nil = nil, foreign_key : Symbol | Nil = nil, comparison : String | Nil = "=", using : Array(Symbol) = [] of Symbol)","location":{"filename":"src/avram/join.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L8"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"primary_key","default_value":"nil","external_name":"primary_key","restriction":"Symbol | ::Nil"},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":"Symbol | ::Nil"},{"name":"comparison","default_value":"\"=\"","external_name":"comparison","restriction":"String | ::Nil"},{"name":"using","default_value":"[] of Symbol","external_name":"using","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, to, primary_key, foreign_key, comparison, using)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone:self-instance-method","name":"clone","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L40"},"def":{"name":"clone","return_type":"self","visibility":"Public","body":"self"}},{"html_id":"default_foreign_key:String-instance-method","name":"default_foreign_key","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L36"},"def":{"name":"default_foreign_key","return_type":"String","visibility":"Public","body":"(Wordsmith::Inflector.singularize(@from)) + \"_id\""}},{"html_id":"from:TableName-instance-method","name":"from","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L5"},"def":{"name":"from","return_type":"TableName","visibility":"Public","body":"@from"}},{"html_id":"from_column:String-instance-method","name":"from_column","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L28"},"def":{"name":"from_column","return_type":"String","visibility":"Public","body":"\"#{@from}.#{@primary_key || \"id\"}\""}},{"html_id":"join_type:String-instance-method","name":"join_type","abstract":true,"location":{"filename":"src/avram/join.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L18"},"def":{"name":"join_type","return_type":"String","visibility":"Public","body":""}},{"html_id":"to:TableName-instance-method","name":"to","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L6"},"def":{"name":"to","return_type":"TableName","visibility":"Public","body":"@to"}},{"html_id":"to_column:String-instance-method","name":"to_column","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L32"},"def":{"name":"to_column","return_type":"String","visibility":"Public","body":"\"#{@to}.#{@foreign_key || default_foreign_key}\""}},{"html_id":"to_sql:String-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/join.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/join.cr#L20"},"def":{"name":"to_sql","return_type":"String","visibility":"Public","body":"if !@using.empty?\n \"#{join_type} JOIN #{@to} USING (#{@using.join(\", \")})\"\nelse\n \"#{join_type} JOIN #{@to} ON #{from_column} #{@comparison} #{to_column}\"\nend"}}]}]},{"html_id":"avram/Avram/LazyLoadError","path":"Avram/LazyLoadError.html","kind":"class","full_name":"Avram::LazyLoadError","name":"LazyLoadError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L16"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when trying to access a record that was not preloaded and lazy load\nis disabled.","summary":"

Raised when trying to access a record that was not preloaded and lazy load is disabled.

","constructors":[{"html_id":"new(model:String,association:String)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"String"},{"name":"association","external_name":"association","restriction":"String"}],"args_string":"(model : String, association : String)","args_html":"(model : String, association : String)","location":{"filename":"src/avram/errors.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L20"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"String"},{"name":"association","external_name":"association","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, association)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"association:String-instance-method","name":"association","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L18"},"def":{"name":"association","return_type":"String","visibility":"Public","body":"@association"}},{"html_id":"model:String-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L17"},"def":{"name":"model","return_type":"String","visibility":"Public","body":"@model"}}]},{"html_id":"avram/Avram/MarkAsFailed","path":"Avram/MarkAsFailed.html","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed","abstract":false,"locations":[{"filename":"src/avram/mark_as_failed.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/mark_as_failed.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"mark_as_failed:Nil-instance-method","name":"mark_as_failed","abstract":false,"location":{"filename":"src/avram/mark_as_failed.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/mark_as_failed.cr#L2"},"def":{"name":"mark_as_failed","return_type":"Nil","visibility":"Public","body":"self.save_status = Avram::SaveOperation::OperationStatus::SaveFailed"}}]},{"html_id":"avram/Avram/Migrator","path":"Avram/Migrator.html","kind":"module","full_name":"Avram::Migrator","name":"Migrator","abstract":false,"locations":[{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L1"},{"filename":"src/avram/migrator/migrator.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migrator.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"run(&)-class-method","name":"run","abstract":false,"location":{"filename":"src/avram/migrator/migrator.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migrator.cr#L2"},"def":{"name":"run","yields":0,"block_arity":0,"visibility":"Public","body":"begin\n yield\nrescue e\n puts(e.inspect_with_backtrace)\n exit(1)\nend"}}],"types":[{"html_id":"avram/Avram/Migrator/AlterExtensionStatement","path":"Avram/Migrator/AlterExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::AlterExtensionStatement","name":"AlterExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,to:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"args_string":"(name : String, to : String | Nil = nil)","args_html":"(name : String, to : String | Nil = nil)","location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, to)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"String.build do |sql|\n sql << \"ALTER EXTENSION \\\"#{@name}\\\" UPDATE\"\n if @to\n sql << to_version\n end\n sql << \";\"\nend"}},{"html_id":"to_version-instance-method","name":"to_version","abstract":false,"location":{"filename":"src/avram/migrator/alter_extension_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_extension_statement.cr#L13"},"def":{"name":"to_version","visibility":"Public","body":"\" TO '#{@to}'\""}}]},{"html_id":"avram/Avram/Migrator/AlterTableStatement","path":"Avram/Migrator/AlterTableStatement.html","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L15"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_change_default_statement(column:Avram::Migrator::Columns::Base)-instance-method","name":"add_change_default_statement","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"args_string":"(column : Avram::Migrator::Columns::Base)","args_html":"(column : Avram::Migrator::Columns::Base)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L86"},"def":{"name":"add_change_default_statement","args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"visibility":"Public","body":"change_default_statements << (column.build_change_default_statement(@table_name))"}},{"html_id":"add_change_type_statement(column:Avram::Migrator::Columns::Base)-instance-method","name":"add_change_type_statement","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"args_string":"(column : Avram::Migrator::Columns::Base)","args_html":"(column : Avram::Migrator::Columns::Base)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L82"},"def":{"name":"add_change_type_statement","args":[{"name":"column","external_name":"column","restriction":"::Avram::Migrator::Columns::Base"}],"visibility":"Public","body":"change_type_statements << (column.build_change_type_statement(@table_name))"}},{"html_id":"add_fill_existing_with_statements(column:Symbol|String,type,value,nilable)-instance-method","name":"add_fill_existing_with_statements","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol | String"},{"name":"type","external_name":"type","restriction":""},{"name":"value","external_name":"value","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""}],"args_string":"(column : Symbol | String, type, value, nilable)","args_html":"(column : Symbol | String, type, value, nilable)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L250"},"def":{"name":"add_fill_existing_with_statements","args":[{"name":"column","external_name":"column","restriction":"Symbol | String"},{"name":"type","external_name":"type","restriction":""},{"name":"value","external_name":"value","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""}],"visibility":"Public","body":"@fill_existing_with_statements << \"UPDATE #{@table_name} SET #{column} = #{value};\"\nif nilable\nelse\n @fill_existing_with_statements << \"ALTER TABLE #{@table_name} ALTER COLUMN #{column} SET NOT NULL;\"\nend\n"}},{"html_id":"alter_statements:Array(String)-instance-method","name":"alter_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":119,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L119"},"def":{"name":"alter_statements","return_type":"Array(String)","visibility":"Public","body":"alterations = renamed_rows.map do |statement|\n \"ALTER TABLE #{@table_name} #{statement};\"\nend\nif (rows + dropped_rows).empty?\nelse\n alterations << String.build do |statement|\n statement << \"ALTER TABLE #{@table_name}\"\n statement << \"\\n\"\n statement << ((rows + dropped_rows).join(\",\\n\"))\n statement << ';'\n end\nend\nalterations\n"}},{"html_id":"build(&)-instance-method","name":"build","doc":"Accepts a block to alter a table using the `add` method. The generated sql\nstatements are aggregated in the `statements` getter.\n\n## Usage\n\n```\nbuilt = Avram::Migrator::AlterTableStatement.new(:users).build do\n add name : String\n add age : Int32\n remove old_field\nend\n\nbuilt.statements\n# => [\n\"ALTER TABLE users\n ADD name text NOT NULL,\n ADD age int NOT NULL,\n DROP old_field\"\n]\n```","summary":"

Accepts a block to alter a table using the add method.

","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":110,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L110"},"def":{"name":"build","yields":0,"block_arity":0,"visibility":"Public","body":"with self yield\nself\n"}},{"html_id":"change_default_statements:Array(String)-instance-method","name":"change_default_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L13"},"def":{"name":"change_default_statements","visibility":"Public","body":"@change_default_statements"}},{"html_id":"change_type_statements:Array(String)-instance-method","name":"change_type_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L12"},"def":{"name":"change_type_statements","visibility":"Public","body":"@change_type_statements"}},{"html_id":"dropped_rows:Array(String)-instance-method","name":"dropped_rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L10"},"def":{"name":"dropped_rows","visibility":"Public","body":"@dropped_rows"}},{"html_id":"fill_existing_with_statements:Array(String)-instance-method","name":"fill_existing_with_statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L11"},"def":{"name":"fill_existing_with_statements","visibility":"Public","body":"@fill_existing_with_statements"}},{"html_id":"renamed_rows:Array(String)-instance-method","name":"renamed_rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L9"},"def":{"name":"renamed_rows","visibility":"Public","body":"@renamed_rows"}},{"html_id":"rows:Array(String)-instance-method","name":"rows","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L8"},"def":{"name":"rows","visibility":"Public","body":"@rows"}},{"html_id":"statements-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":115,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L115"},"def":{"name":"statements","visibility":"Public","body":"(((alter_statements + change_default_statements) + change_type_statements) + index_statements) + fill_existing_with_statements"}}],"macros":[{"html_id":"add(type_declaration,index=false,using=:btree,unique=false,default=nil,fill_existing_with=nil,**type_options)-macro","name":"add","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""}],"args_string":"(type_declaration, index = false, using = :btree, unique = false, default = nil, fill_existing_with = nil, **type_options)","args_html":"(type_declaration, index = false, using = :btree, unique = false, default = nil, fill_existing_with = nil, **type_options)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":181,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L181"},"def":{"name":"add","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% type = type_declaration.type.resolve %}\n\n \n{% nilable = false %}\n\n \n{% array = false %}\n\n \n{% should_fill_existing = (!(fill_existing_with == nil)) && (fill_existing_with != (:nothing)) %}\n\n\n \n{% if type.nilable? %}\n {% type = type.union_types.reject(&.==(Nil)).first %}\n {% nilable = true %}\n {% end %}\n\n \n{% if type < Array %}\n {% type = type.type_vars.first %}\n {% array = true %}\n {% end %}\n\n\n \n{% if ((!nilable) && (default == nil)) && (fill_existing_with == nil) %}\n {% raise(\"\\nYou must provide a default value or use fill_existing_with when adding a required column to an existing table.\\n\\nTry one of these...\\n\\n ▸ add #{type_declaration}, default: \\\"Something\\\"\\n ▸ add #{type_declaration}, fill_existing_with: \\\"Something\\\"\\n ▸ add #{type_declaration}, fill_existing_with: :nothing\") %}\n {% end %}\n\n\n \n{% if (default != nil) && (fill_existing_with != nil) %}\n {% type_declaration.raise(\"\\nCannot use both 'default' and 'fill_existing_with' arguments for add(#{type_declaration}).\\n\\nTry this...\\n\\n ▸ Use `default` to set the default value, and backfill existing columns\\n ▸ Use `fill_existing_with` to backfill existing columns without a default value\") %}\n {% end %}\n\n\n rows << Avram::Migrator::Columns::\n{{ type }}\nColumn(\n \n{% if array %}Array({{ type }}){% else %}{{ type }}{% end %}\n\n ).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable || should_fill_existing }}\n,\n default: \n{{ default }}\n,\n \n{{ type_options.double_splat }}\n\n )\n \n{% if array %}\n .array!\n {% end %}\n\n .build_add_statement_for_alter\n\n \n{% if should_fill_existing %}\n add_fill_existing_with_statements(\n column: {{ type_declaration.var.stringify }},\n type: {{ type }},\n value: Avram::Migrator::Columns::{{ type }}Column.prepare_value_for_database({{ fill_existing_with }}),\n nilable: {{ nilable }}\n )\n {% end %}\n\n\n \n{% if index || unique %}\n add_index :{{ type_declaration.var }}, using: {{ using }}, unique: {{ unique }}\n {% end %}\n\n \n"}},{"html_id":"add_belongs_to(type_declaration,on_delete,references=nil,foreign_key_type=Int64,fill_existing_with=nil,unique=false)-macro","name":"add_belongs_to","doc":"Adds a references column and index given a model class and references option.","summary":"

Adds a references column and index given a model class and references option.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"args_string":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, fill_existing_with = nil, unique = false)","args_html":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, fill_existing_with = nil, unique = false)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L135"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"fill_existing_with","default_value":"nil","external_name":"fill_existing_with","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.is_a?(TypeDeclaration) %}{% else %}\n {% raise(\"add_belongs_to expected a type declaration like 'user : User', instead got: '#{type_declaration}'\") %}\n {% end %}\n\n \n{% if (type_declaration.type.stringify =~ (/\\w::\\w/)) && references.nil? %}\n {% raise(\"Namespaced models must include the `references` option with the name of the table.\\n\\nTry this...\\n\\n ▸ add_belongs_to(#{type_declaration}, on_delete: #{on_delete}, references: :the_table_name)\") %}\n {% end %}\n\n \n{% optional = type_declaration.type.is_a?(Union) %}\n\n\n \n{% if optional %}\n {% underscored_class = type_declaration.type.types.first %}\n {% else %}\n {% underscored_class = type_declaration.type %}\n {% end %}\n\n \n{% underscored_class = underscored_class.stringify.underscore.gsub(/::/, \"_\") %}\n\n\n \n{% foreign_key_name = type_declaration.var + \"_id\" %}\n\n \n%table_name\n = \n{{ references }}\n || Wordsmith::Inflector.pluralize(\n{{ underscored_class }}\n)\n\n rows << ::Avram::Migrator::Columns::\n{{ foreign_key_type }}\nColumn(\n{{ foreign_key_type }}\n).new(\n name: \n{{ foreign_key_name.stringify }}\n,\n nilable: \n{{ optional }}\n,\n default: nil\n )\n .set_references(references: \n%table_name\n.to_s, on_delete: \n{{ on_delete }}\n)\n .build_add_statement_for_alter\n\n \n{% if (!(fill_existing_with == nil)) && (fill_existing_with != (:nothing)) %}\n add_fill_existing_with_statements(\n column: {{ foreign_key_name.stringify }},\n type: {{ foreign_key_type }},\n value: Avram::Migrator::Columns::{{ foreign_key_type }}Column.prepare_value_for_database({{ fill_existing_with }}),\n nilable: {{ optional }}\n )\n {% end %}\n\n\n add_index :\n{{ foreign_key_name }}\n, unique: \n{{ unique }}\n\n \n"}},{"html_id":"change_default(type_declaration,default)-macro","name":"change_default","doc":"Change the columns' default value to `default`\n```\nalter table_for(Post) do\n change_default published_at, default: :now\nend\n```","summary":"

Change the columns' default value to default alter table_for(Post) do change_default published_at, default: :now end

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(type_declaration, default)","args_html":"(type_declaration, default)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L68"},"def":{"name":"change_default","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":" \n{% if !type_declaration.is_a?(TypeDeclaration)\n raise(\"Must pass a type declaration to 'change_default'. Example: change_default count : Int32, default: 1\")\nend %}\n\n \n%column\n = ::Avram::Migrator::Columns::\n{{ type_declaration.type }}\nColumn(\n{{ type_declaration.type }}\n).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: false,\n default: \n{{ default }}\n\n )\n add_change_default_statement \n%column\n\n \n"}},{"html_id":"change_type(type_declaration,**type_options)-macro","name":"change_type","doc":"Change the column's type from whatever it is currently to\n`type_declaration.type`. The only exceptions are when changing\nfrom `text` to `citext` with `String` using `case_sensitive`, or changing to\na `Float64` column which requires setting the `precision`, and `scale`.\n```\nalter table_for(User) do\n change_type email : String, case_sensitive: false\nend\n```","summary":"

Change the column's type from whatever it is currently to type_declaration.type.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration, **type_options)","args_html":"(type_declaration, **type_options)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L27"},"def":{"name":"change_type","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% if !type_declaration.is_a?(TypeDeclaration)\n raise(\"Must pass a type declaration to 'change_type'. Example: change_type age : Int32\")\nelse\n if type_options.keys.includes?(\"default\".id)\n raise(\"Cannot change the default value from `change_type`. Use `change_default` instead.\")\n end\nend %}\n\n \n{% type = type_declaration.type.resolve\nnilable = false\nbytes = false\n %}\n\n \n{% if type.nilable?\n type = type.union_types.reject(&.==(Nil)).first\n nilable = true\nend %}\n\n \n{% if type < Slice\n type = \"Bytes\".id\n bytes = true\nend %}\n\n\n \n%column\n = ::Avram::Migrator::Columns::\n{{ type }}\nColumn(\n{{ type }}\n).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable }}\n,\n default: nil,\n \n{{ type_options.double_splat }}\n\n )\n add_change_type_statement \n%column\n\n \n"}},{"html_id":"remove(name)-macro","name":"remove","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name)","args_html":"(name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":294,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L294"},"def":{"name":"remove","args":[{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":" \n{% if name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"remove\", {{ name }})\n {% end %}\n\n dropped_rows << \" DROP #{\n{{ name }}\n}\"\n \n"}},{"html_id":"remove_belongs_to(association_name)-macro","name":"remove_belongs_to","abstract":false,"args":[{"name":"association_name","external_name":"association_name","restriction":""}],"args_string":"(association_name)","args_html":"(association_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":301,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L301"},"def":{"name":"remove_belongs_to","args":[{"name":"association_name","external_name":"association_name","restriction":""}],"visibility":"Public","body":" \n{% if association_name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"remove_belongs_to\", {{ name }})\n {% end %}\n\n remove \n{{ association_name }}\n_id\n \n"}},{"html_id":"rename(old_name,new_name)-macro","name":"rename","abstract":false,"args":[{"name":"old_name","external_name":"old_name","restriction":""},{"name":"new_name","external_name":"new_name","restriction":""}],"args_string":"(old_name, new_name)","args_html":"(old_name, new_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":276,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L276"},"def":{"name":"rename","args":[{"name":"old_name","external_name":"old_name","restriction":""},{"name":"new_name","external_name":"new_name","restriction":""}],"visibility":"Public","body":" \n{% for name in {old_name, new_name} %}\n {% if name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"rename\", {{ name }})\n {% end %}\n {% end %}\n\n renamed_rows << \"RENAME COLUMN #{\n{{ old_name }}\n} TO #{\n{{ new_name }}\n}\"\n \n"}},{"html_id":"rename_belongs_to(old_association_name,new_association_name)-macro","name":"rename_belongs_to","abstract":false,"args":[{"name":"old_association_name","external_name":"old_association_name","restriction":""},{"name":"new_association_name","external_name":"new_association_name","restriction":""}],"args_string":"(old_association_name, new_association_name)","args_html":"(old_association_name, new_association_name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":285,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L285"},"def":{"name":"rename_belongs_to","args":[{"name":"old_association_name","external_name":"old_association_name","restriction":""},{"name":"new_association_name","external_name":"new_association_name","restriction":""}],"visibility":"Public","body":" \n{% for association_name in {old_association_name, new_association_name} %}\n {% if association_name.is_a?(SymbolLiteral) %}{% else %}\n symbol_expected_error(\"rename_belongs_to\", {{ name }})\n {% end %}\n {% end %}\n\n rename \n{{ old_association_name }}\n_id, \n{{ new_association_name }}\n_id\n \n"}},{"html_id":"symbol_expected_error(action,name)-macro","name":"symbol_expected_error","abstract":false,"args":[{"name":"action","external_name":"action","restriction":""},{"name":"name","external_name":"name","restriction":""}],"args_string":"(action, name)","args_html":"(action, name)","location":{"filename":"src/avram/migrator/alter_table_statement.cr","line_number":255,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/alter_table_statement.cr#L255"},"def":{"name":"symbol_expected_error","args":[{"name":"action","external_name":"action","restriction":""},{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":" \n{% if name.is_a?(TypeDeclaration) %}\n {% example = name.var %}\n {% else %}\n {% example = name.id %}\n {% end %}\n\n\n \n{% raise(\"\\n#{action} expected a symbol like :#{example}, instead got: #{name}.\\n\\nin: #{name.filename}:#{name.line_number}:#{name.column_number}\\n\\nTry replacing...\\n\\n ▸ #{name} with :#{example}\") %}\n\n \n"}}]},{"html_id":"avram/Avram/Migrator/BuildReferenceFragment","path":"Avram/Migrator/BuildReferenceFragment.html","kind":"class","full_name":"Avram::Migrator::BuildReferenceFragment","name":"BuildReferenceFragment","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/build_reference_fragment.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(references:String|Symbol|Nil,on_delete:Symbol|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"::String | ::Symbol | ::Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"args_string":"(references : String | Symbol | Nil, on_delete : Symbol | Nil)","args_html":"(references : String | Symbol | Nil, on_delete : Symbol | Nil)","location":{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/build_reference_fragment.cr#L7"},"def":{"name":"new","args":[{"name":"references","external_name":"references","restriction":"::String | ::Symbol | ::Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(references, on_delete)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/build_reference_fragment.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/build_reference_fragment.cr#L10"},"def":{"name":"build","visibility":"Public","body":"if on_delete == (:do_nothing)\n \" REFERENCES #{references}\"\nelse\n (\" REFERENCES #{references}\" + \" ON DELETE \") + on_delete_sql\nend"}}]},{"html_id":"avram/Avram/Migrator/ChangeNullStatement","path":"Avram/Migrator/ChangeNullStatement.html","kind":"class","full_name":"Avram::Migrator::ChangeNullStatement","name":"ChangeNullStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/change_null_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/change_null_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for changing a columns NOT NULL status.\n\n### Usage\n\n```\nChangeNullStatement.new(:users, :email, make: :optional).build\n# => \"ALTER TABLE users ALTER COLUMN email DROP NOT NULL;\"\n```","summary":"

Builds an SQL statement for changing a columns NOT NULL status.

","constructors":[{"html_id":"new(table:TableName,column:Symbol,required:Bool)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"required","external_name":"required","restriction":"Bool"}],"args_string":"(table : TableName, column : Symbol, required : Bool)","args_html":"(table : TableName, column : Symbol, required : Bool)","location":{"filename":"src/avram/migrator/change_null_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/change_null_statement.cr#L10"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"required","external_name":"required","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, column, required)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/change_null_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/change_null_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"if @required\n change = \"SET\"\nelse\n change = \"DROP\"\nend\nString.build do |index|\n index << \"ALTER TABLE #{@table}\"\n index << \" ALTER COLUMN #{@column}\"\n index << \" #{change} NOT NULL;\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/Columns","path":"Avram/Migrator/Columns.html","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L1"},{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bool_column.cr#L3"},{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bytes_column.cr#L3"},{"filename":"src/avram/migrator/columns/float_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L3"},{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int16_column.cr#L3"},{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int32_column.cr#L3"},{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int64_column.cr#L3"},{"filename":"src/avram/migrator/columns/string_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/string_column.cr#L3"},{"filename":"src/avram/migrator/columns/time_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L3"},{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/uuid_column.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"types":[{"html_id":"avram/Avram/Migrator/Columns/Base","path":"Avram/Migrator/Columns/Base.html","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/BoolColumn","kind":"class","full_name":"Avram::Migrator::Columns::BoolColumn(T)","name":"BoolColumn"},{"html_id":"avram/Avram/Migrator/Columns/BytesColumn","kind":"class","full_name":"Avram::Migrator::Columns::BytesColumn(T)","name":"BytesColumn"},{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn(T)","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Int16Column","kind":"class","full_name":"Avram::Migrator::Columns::Int16Column(T)","name":"Int16Column"},{"html_id":"avram/Avram/Migrator/Columns/Int32Column","kind":"class","full_name":"Avram::Migrator::Columns::Int32Column(T)","name":"Int32Column"},{"html_id":"avram/Avram/Migrator/Columns/Int64Column","kind":"class","full_name":"Avram::Migrator::Columns::Int64Column(T)","name":"Int64Column"},{"html_id":"avram/Avram/Migrator/Columns/JSON/AnyColumn","kind":"class","full_name":"Avram::Migrator::Columns::JSON::AnyColumn(T)","name":"AnyColumn"},{"html_id":"avram/Avram/Migrator/Columns/StringColumn","kind":"class","full_name":"Avram::Migrator::Columns::StringColumn(T)","name":"StringColumn"},{"html_id":"avram/Avram/Migrator/Columns/TimeColumn","kind":"class","full_name":"Avram::Migrator::Columns::TimeColumn(T)","name":"TimeColumn"},{"html_id":"avram/Avram/Migrator/Columns/UUIDColumn","kind":"class","full_name":"Avram::Migrator::Columns::UUIDColumn(T)","name":"UUIDColumn"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"class_methods":[{"html_id":"escape_literal(value)-class-method","name":"escape_literal","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L78"},"def":{"name":"escape_literal","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"PG::EscapeHelper.escape_literal(value)"}},{"html_id":"prepare_value_for_database(value:Array)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Array"}],"args_string":"(value : Array)","args_html":"(value : Array)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L74"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":"Array"}],"visibility":"Public","body":"escape_literal(PQ::Param.encode_array(value))"}},{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L70"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"escape_literal(value.to_s)"}}],"constructors":[{"html_id":"new(name)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name)","args_html":"(name)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"array!-instance-method","name":"array!","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L28"},"def":{"name":"array!","visibility":"Public","body":"@array = true\nself\n"}},{"html_id":"as_array_type:String-instance-method","name":"as_array_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L49"},"def":{"name":"as_array_type","return_type":"String","visibility":"Public","body":"@array ? \"[]\" : \"\""}},{"html_id":"build_add_statement_for_alter:String-instance-method","name":"build_add_statement_for_alter","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L41"},"def":{"name":"build_add_statement_for_alter","return_type":"String","visibility":"Public","body":"\" ADD \" + build_add_statement"}},{"html_id":"build_add_statement_for_create:String-instance-method","name":"build_add_statement_for_create","abstract":false,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L45"},"def":{"name":"build_add_statement_for_create","return_type":"String","visibility":"Public","body":"\" \" + build_add_statement"}},{"html_id":"build_change_default_statement(table_name:TableName):String-instance-method","name":"build_change_default_statement","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName) : String","args_html":"(table_name : TableName) : String","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L37"},"def":{"name":"build_change_default_statement","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"return_type":"String","visibility":"Public","body":"\"ALTER TABLE ONLY #{table_name} ALTER COLUMN #{name} SET#{default_fragment};\""}},{"html_id":"build_change_type_statement(table_name:TableName):String-instance-method","name":"build_change_type_statement","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName) : String","args_html":"(table_name : TableName) : String","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L33"},"def":{"name":"build_change_type_statement","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"return_type":"String","visibility":"Public","body":"\"ALTER TABLE #{table_name} ALTER COLUMN #{name} SET DATA TYPE #{column_type};\""}},{"html_id":"column_type:String-instance-method","name":"column_type","abstract":true,"location":{"filename":"src/avram/migrator/columns/base.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L64"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":""}},{"html_id":"set_references(references:String,on_delete:Symbol)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"String"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"}],"args_string":"(references : String, on_delete : Symbol)","args_html":"(references : String, on_delete : Symbol)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L16"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"String"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\nself\n"}},{"html_id":"set_references(references:Nil,on_delete:Nil)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"Nil"}],"args_string":"(references : Nil, on_delete : Nil)","args_html":"(references : Nil, on_delete : Nil)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L20"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"Nil"},{"name":"on_delete","external_name":"on_delete","restriction":"Nil"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\nself\n"}},{"html_id":"set_references(references:Nil|String,on_delete:Symbol|Nil)-instance-method","name":"set_references","abstract":false,"args":[{"name":"references","external_name":"references","restriction":"::Nil | ::String"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"args_string":"(references : Nil | String, on_delete : Symbol | Nil)","args_html":"(references : Nil | String, on_delete : Symbol | Nil)","location":{"filename":"src/avram/migrator/columns/base.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/base.cr#L24"},"def":{"name":"set_references","args":[{"name":"references","external_name":"references","restriction":"::Nil | ::String"},{"name":"on_delete","external_name":"on_delete","restriction":"::Symbol | ::Nil"}],"visibility":"Public","body":"@references = references\n@on_delete = on_delete\n{% raise(\"When setting a reference you must set the reference table and the 'on_delete' option.\") %}\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/BoolColumn","path":"Avram/Migrator/Columns/BoolColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::BoolColumn(T)","name":"BoolColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bool_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bool_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = BoolColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/bool_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bool_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"boolean\""}}]},{"html_id":"avram/Avram/Migrator/Columns/BytesColumn","path":"Avram/Migrator/Columns/BytesColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::BytesColumn(T)","name":"BytesColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bytes_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Slice(UInt8)|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Slice(::UInt8) | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Slice(UInt8) | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Slice(UInt8) | T | Nil)","location":{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bytes_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Slice(::UInt8) | T | ::Nil"}],"visibility":"Public","body":"_ = BytesColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/bytes_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/bytes_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bytea\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Float32Column","path":"Avram/Migrator/Columns/Float32Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Float32Column(T)","name":"Float32Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name,nilable,default,precision,scale)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"args_string":"(name, nilable, default, precision, scale)","args_html":"(name, nilable, default, precision, scale)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"visibility":"Public","body":"_ = Float32Column(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name,nilable,default)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(name, nilable, default)","args_html":"(name, nilable, default)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":"_ = Float32Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/Float64Column","path":"Avram/Migrator/Columns/Float64Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Float64Column(T)","name":"Float64Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn","name":"FloatColumn"},{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L29"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name,nilable,default,precision,scale)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"args_string":"(name, nilable, default, precision, scale)","args_html":"(name, nilable, default, precision, scale)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""},{"name":"precision","external_name":"precision","restriction":""},{"name":"scale","external_name":"scale","restriction":""}],"visibility":"Public","body":"_ = Float64Column(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name,nilable,default)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"args_string":"(name, nilable, default)","args_html":"(name, nilable, default)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"nilable","external_name":"nilable","restriction":""},{"name":"default","external_name":"default","restriction":""}],"visibility":"Public","body":"_ = Float64Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Migrator/Columns/FloatColumn","path":"Avram/Migrator/Columns/FloatColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::FloatColumn(T)","name":"FloatColumn","abstract":true,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/float_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/Float32Column","kind":"class","full_name":"Avram::Migrator::Columns::Float32Column(T)","name":"Float32Column"},{"html_id":"avram/Avram/Migrator/Columns/Float64Column","kind":"class","full_name":"Avram::Migrator::Columns::Float64Column(T)","name":"Float64Column"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Float32|T|Nil,precision:Int32|Nil,scale:Int32|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"},{"name":"precision","external_name":"precision","restriction":"::Int32 | ::Nil"},{"name":"scale","external_name":"scale","restriction":"::Int32 | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil, precision : Int32 | Nil, scale : Int32 | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil, precision : Int32 | Nil, scale : Int32 | Nil)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L11"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"},{"name":"precision","external_name":"precision","restriction":"::Int32 | ::Nil"},{"name":"scale","external_name":"scale","restriction":"::Int32 | ::Nil"}],"visibility":"Public","body":"_ = FloatColumn(T).allocate\n_.initialize(name, nilable, default, precision, scale)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name:String,nilable:Bool|Nil,default:Float32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Float32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Float32 | T | ::Nil"}],"visibility":"Public","body":"_ = FloatColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/float_column.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/float_column.cr#L17"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"if precision && scale\n \"decimal(#{precision},#{scale})\"\nelse\n \"decimal\"\nend"}}]},{"html_id":"avram/Avram/Migrator/Columns/Int16Column","path":"Avram/Migrator/Columns/Int16Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int16Column(T)","name":"Int16Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int16_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Int32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int16_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"visibility":"Public","body":"_ = Int16Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int16_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int16_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"smallint\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Int32Column","path":"Avram/Migrator/Columns/Int32Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int32Column(T)","name":"Int32Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int32_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int32_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = Int32Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int32_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int32_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"int4\""}}]},{"html_id":"avram/Avram/Migrator/Columns/Int64Column","path":"Avram/Migrator/Columns/Int64Column.html","kind":"class","full_name":"Avram::Migrator::Columns::Int64Column(T)","name":"Int64Column","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int64_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Int32|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Int32 | T | Nil)","location":{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int64_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Int32 | T | ::Nil"}],"visibility":"Public","body":"_ = Int64Column(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/int64_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/int64_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bigint\""}}]},{"html_id":"avram/Avram/Migrator/Columns/JSON","path":"Avram/Migrator/Columns/JSON.html","kind":"module","full_name":"Avram::Migrator::Columns::JSON","name":"JSON","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/json_column.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"types":[{"html_id":"avram/Avram/Migrator/Columns/JSON/AnyColumn","path":"Avram/Migrator/Columns/JSON/AnyColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::JSON::AnyColumn(T)","name":"AnyColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/json_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/JSON","kind":"module","full_name":"Avram::Migrator::Columns::JSON","name":"JSON"},"class_methods":[{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L14"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"escape_literal(value.to_json)"}}],"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:::JSON::Any|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::JSON::Any | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : ::JSON::Any | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : ::JSON::Any | Nil)","location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::JSON::Any | ::Nil"}],"visibility":"Public","body":"_ = AnyColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/json_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/json_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"jsonb\""}}]}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","path":"Avram/Migrator/Columns/PrimaryKeys.html","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys","abstract":false,"locations":[{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/base.cr#L1"},{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L3"},{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"types":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","path":"Avram/Migrator/Columns/PrimaryKeys/Base.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/base.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int16PrimaryKey","name":"Int16PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int32PrimaryKey","name":"Int32PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int64PrimaryKey","name":"Int64PrimaryKey"},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::UUIDPrimaryKey","name":"UUIDPrimaryKey"}],"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"instance_methods":[{"html_id":"build:String-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/base.cr#L8"},"def":{"name":"build","return_type":"String","visibility":"Public","body":"\" #{name} #{column_type} PRIMARY KEY\""}},{"html_id":"column_type-instance-method","name":"column_type","abstract":true,"location":{"filename":"src/avram/migrator/columns/primary_keys/base.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/base.cr#L6"},"def":{"name":"column_type","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int16PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int16PrimaryKey","name":"Int16PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int16_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int16_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"smallserial\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int32PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int32PrimaryKey","name":"Int32PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int32_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int32_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"serial4\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/Int64PrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Int64PrimaryKey","name":"Int64PrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/int64_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/int64_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"bigserial\""}}]},{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey","path":"Avram/Migrator/Columns/PrimaryKeys/UUIDPrimaryKey.html","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::UUIDPrimaryKey","name":"UUIDPrimaryKey","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys/Base","kind":"class","full_name":"Avram::Migrator::Columns::PrimaryKeys::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns/PrimaryKeys","kind":"module","full_name":"Avram::Migrator::Columns::PrimaryKeys","name":"PrimaryKeys"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L5"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build:String-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L12"},"def":{"name":"build","return_type":"String","visibility":"Public","body":"\" #{name} #{column_type} PRIMARY KEY DEFAULT gen_random_uuid()\""}},{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/primary_keys/uuid_primary_key.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/primary_keys/uuid_primary_key.cr#L8"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"uuid\""}}]}]},{"html_id":"avram/Avram/Migrator/Columns/StringColumn","path":"Avram/Migrator/Columns/StringColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::StringColumn(T)","name":"StringColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/string_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/string_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil,case_sensitive:Bool=true)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"},{"name":"case_sensitive","default_value":"true","external_name":"case_sensitive","restriction":"::Bool"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil, case_sensitive : Bool = true)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil, case_sensitive : Bool = true)","location":{"filename":"src/avram/migrator/columns/string_column.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/string_column.cr#L8"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"},{"name":"case_sensitive","default_value":"true","external_name":"case_sensitive","restriction":"::Bool"}],"visibility":"Public","body":"_ = StringColumn(T).allocate\n_.initialize(name, nilable, default, case_sensitive)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","doc":"If `case_sensitive?` is false then the column type is set to `citext`\nwhich requires the `citext` extension to be enabled\notherwise the type is `text`","summary":"

If case_sensitive? is false then the column type is set to citext which requires the citext extension to be enabled otherwise the type is text

","abstract":false,"location":{"filename":"src/avram/migrator/columns/string_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/string_column.cr#L14"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"case_sensitive? ? \"text\" : \"citext\""}}]},{"html_id":"avram/Avram/Migrator/Columns/TimeColumn","path":"Avram/Migrator/Columns/TimeColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::TimeColumn(T)","name":"TimeColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/time_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"class_methods":[{"html_id":"prepare_value_for_database(value)-class-method","name":"prepare_value_for_database","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L14"},"def":{"name":"prepare_value_for_database","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"if value == (:now)\n \"NOW()\"\nelse\n if value.is_a?(Time)\n escape_literal(value.to_utc.to_s)\n else\n raise(\"Unrecognized value :#{value} for a timestamptz. Please use a Time object or :now for current timestamp.\")\n end\nend"}}],"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:Symbol|T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Symbol | T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : Symbol | T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : Symbol | T | Nil)","location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"::Symbol | T | ::Nil"}],"visibility":"Public","body":"_ = TimeColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/time_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/time_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"timestamptz\""}}]},{"html_id":"avram/Avram/Migrator/Columns/UUIDColumn","path":"Avram/Migrator/Columns/UUIDColumn.html","kind":"class","full_name":"Avram::Migrator::Columns::UUIDColumn(T)","name":"UUIDColumn","abstract":false,"superclass":{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},"ancestors":[{"html_id":"avram/Avram/Migrator/Columns/Base","kind":"class","full_name":"Avram::Migrator::Columns::Base","name":"Base"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/uuid_column.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator/Columns","kind":"module","full_name":"Avram::Migrator::Columns","name":"Columns"},"constructors":[{"html_id":"new(name:String,nilable:Bool|Nil,default:T|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"args_string":"(name : String, nilable : Bool | Nil, default : T | Nil)","args_html":"(name : String, nilable : Bool | Nil, default : T | Nil)","location":{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/uuid_column.cr#L7"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"::String"},{"name":"nilable","external_name":"nilable","restriction":"::Bool | ::Nil"},{"name":"default","external_name":"default","restriction":"T | ::Nil"}],"visibility":"Public","body":"_ = UUIDColumn(T).allocate\n_.initialize(name, nilable, default)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column_type:String-instance-method","name":"column_type","abstract":false,"location":{"filename":"src/avram/migrator/columns/uuid_column.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/columns/uuid_column.cr#L10"},"def":{"name":"column_type","return_type":"String","visibility":"Public","body":"\"uuid\""}}]}]},{"html_id":"avram/Avram/Migrator/CreateExtensionStatement","path":"Avram/Migrator/CreateExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::CreateExtensionStatement","name":"CreateExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"CREATE EXTENSION IF NOT EXISTS \\\"#{@name}\\\";\""}}]},{"html_id":"avram/Avram/Migrator/CreateForeignKeyStatement","path":"Avram/Migrator/CreateForeignKeyStatement.html","kind":"class","full_name":"Avram::Migrator::CreateForeignKeyStatement","name":"CreateForeignKeyStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_foreign_key_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Generates an ALTER TABLE statement for adding a foreign key constraint on a table.\n\n### Usage\n\n```\nCreateForeignKeyStatement.new(from: :comments, to: :users, column: :author_id, primary_key: :uid, on_delete: :cascade).build\n# => \"ALTER TABLE comments ADD CONSTRAINT comments_author_id_fk FOREIGN KEY (author_id) REFERENCES users (uid) ON DELETE CASCADE;\"\n```","summary":"

Generates an ALTER TABLE statement for adding a foreign key constraint on a table.

","constructors":[{"html_id":"new(from:TableName,to:TableName,on_delete:Symbol,column:Symbol|Nil=nil,primary_key:Symbol=:id)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":"::Symbol"}],"args_string":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil = nil, primary_key : Symbol = :id)","args_html":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil = nil, primary_key : Symbol = :id)","location":{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_foreign_key_statement.cr#L10"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":"::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, to, on_delete, column, primary_key)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_foreign_key_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_foreign_key_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"foreign_key = @column || ((Wordsmith::Inflector.singularize(@to.to_s)) + \"_id\")\nString.build do |index|\n index << \"ALTER TABLE\"\n index << \" #{@from}\"\n index << \" ADD CONSTRAINT #{@from}_#{foreign_key}_fk\"\n index << \" FOREIGN KEY (#{foreign_key})\"\n index << (BuildReferenceFragment.new(\"#{@to} (#{@primary_key})\", @on_delete)).build\n index << \";\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/CreateFunctionStatement","path":"Avram/Migrator/CreateFunctionStatement.html","kind":"class","full_name":"Avram::Migrator::CreateFunctionStatement","name":"CreateFunctionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_function_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_function_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,body:String,returns:String=\"trigger\")-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"args_string":"(name : String, body : String, returns : String = \"trigger\")","args_html":"(name : String, body : String, returns : String = "trigger")","location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_function_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, body, returns)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_function_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"\"CREATE OR REPLACE FUNCTION #{function_name}\\n RETURNS #{@returns} AS $$\\nBEGIN\\n #{@body}\\nEND\\n$$ LANGUAGE 'plpgsql';\""}},{"html_id":"function_name-instance-method","name":"function_name","abstract":false,"location":{"filename":"src/avram/migrator/create_function_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_function_statement.cr#L5"},"def":{"name":"function_name","visibility":"Public","body":"if @name.ends_with?(')')\n @name\nelse\n \"#{@name}()\"\nend"}}]},{"html_id":"avram/Avram/Migrator/CreateIndexStatement","path":"Avram/Migrator/CreateIndexStatement.html","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_index_statement.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L28"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for creating an index using table name, column\nname(s), index type and unique flag.\n\n### Usage\n\nFor a single column:\n\n```\nCreateIndexStatement.new(:users, columns: :email, using: :btree, unique: true).build\n# => \"CREATE UNIQUE INDEX users_email_index ON users USING btree (email);\"\n```\n\nFor multiple columns:\n\n```\nCreateIndexStatement.new(:users, columns: [:email, :username], using: :btree, unique: true).build\n# => \"CREATE UNIQUE INDEX users_email_username_index ON users USING btree (email, username);\"\n```\n\nWith custom name:\n\n```\nCreateIndexStatement.new(:users, columns: [:email, :username], name: :custom_index_name).build\n# => \"CREATE INDEX custom_index_name ON users USING btree (email, username);\"\n```","summary":"

Builds an SQL statement for creating an index using table name, column name(s), index type and unique flag.

","constructors":[{"html_id":"new(table:TableName,columns:Columns,using:Symbol=:btree,unique:Bool=false,name:String|Nil|Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":"::Bool"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table : TableName, columns : Columns, using : Symbol = :btree, unique : Bool = false, name : String | Nil | Symbol | Nil = nil)","args_html":"(table : TableName, columns : Columns, using : Symbol = :btree, unique : Bool = false, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L39"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":"::Bool"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, columns, using, unique, name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L44"},"def":{"name":"build","visibility":"Public","body":"index_name = @name\nindex_name || (index_name = \"#{@table}_#{columns.join(\"_\")}_index\")\nString.build do |index|\n index << \"CREATE\"\n if @unique\n index << \" UNIQUE\"\n end\n index << \" INDEX #{index_name}\"\n index << \" ON #{@table}\"\n index << \" USING #{@using.to_s.downcase}\"\n index << \" (#{columns.join(\", \")});\"\nend\n"}}],"types":[{"html_id":"avram/Avram/Migrator/CreateIndexStatement/IndexTypes","path":"Avram/Migrator/CreateIndexStatement/IndexTypes.html","kind":"enum","full_name":"Avram::Migrator::CreateIndexStatement::IndexTypes","name":"IndexTypes","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_index_statement.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L31"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Btree","name":"Btree","value":"0"},{"id":"Hash","name":"Hash","value":"1"},{"id":"Gist","name":"Gist","value":"2"},{"id":"Gin","name":"Gin","value":"3"},{"id":"Brin","name":"Brin","value":"4"}],"namespace":{"html_id":"avram/Avram/Migrator/CreateIndexStatement","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement"},"instance_methods":[{"html_id":"brin?-instance-method","name":"brin?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L36"},"def":{"name":"brin?","visibility":"Public","body":"self == Brin"}},{"html_id":"btree?-instance-method","name":"btree?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L32"},"def":{"name":"btree?","visibility":"Public","body":"self == Btree"}},{"html_id":"gin?-instance-method","name":"gin?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L35"},"def":{"name":"gin?","visibility":"Public","body":"self == Gin"}},{"html_id":"gist?-instance-method","name":"gist?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L34"},"def":{"name":"gist?","visibility":"Public","body":"self == Gist"}},{"html_id":"hash?-instance-method","name":"hash?","abstract":false,"location":{"filename":"src/avram/migrator/create_index_statement.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_index_statement.cr#L33"},"def":{"name":"hash?","visibility":"Public","body":"self == Hash"}}]}]},{"html_id":"avram/Avram/Migrator/CreateTableStatement","path":"Avram/Migrator/CreateTableStatement.html","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_table_statement.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L11"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build(&):CreateTableStatement-instance-method","name":"build","doc":"Accepts a block to build a table and indices using `add` and `add_index` methods.\n\nThe generated sql statements are aggregated in the `statements` method.\n\n## Usage\n\n```\nbuilt = Avram::Migrator::CreateTableStatement.new(:users).build do\n add_belongs_to Account, on_delete: :cascade\n add :email : String, unique: true\nend\n\nbuilt.statements\n# => [\n \"CREATE TABLE users (\n id serial PRIMARY KEY,\n created_at timestamptz NOT NULL,\n updated_at timestamptz NOT NULL,\n account_id bigint NOT NULL REFERENCES accounts (id) ON DELETE CASCADE,\n email text NOT NULL);\",\n \"CREATE UNIQUE INDEX users_email_index ON users USING btree (email);\"\n]\n```\n\nAn optional second argument can toggle between the usage of a numeric or uuid\nbased id column.\n\n```\nbuilt = Avram::Migrator::CreateTableStatement.new(:users, PrimaryKeyType::UUID).build do\n add :email : String, unique: true\nend\n```","summary":"

Accepts a block to build a table and indices using add and add_index methods.

","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L46"},"def":{"name":"build","yields":0,"block_arity":0,"return_type":"CreateTableStatement","visibility":"Public","body":"with self yield\nself\n"}},{"html_id":"statements-instance-method","name":"statements","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L51"},"def":{"name":"statements","visibility":"Public","body":"[table_statement] + index_statements"}}],"macros":[{"html_id":"add(type_declaration,default=nil,index=false,unique=false,using=:btree,**type_options)-macro","name":"add","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""}],"args_string":"(type_declaration, default = nil, index = false, unique = false, using = :btree, **type_options)","args_html":"(type_declaration, default = nil, index = false, unique = false, using = :btree, **type_options)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":89,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L89"},"def":{"name":"add","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"default","default_value":"nil","external_name":"default","restriction":""},{"name":"index","default_value":"false","external_name":"index","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""}],"double_splat":{"name":"type_options","external_name":"type_options","restriction":""},"visibility":"Public","body":" \n{% type = type_declaration.type.resolve\nnilable = false\narray = false\nbytes = false\n %}\n\n \n{% if type.nilable?\n type = type.union_types.reject(&.==(Nil)).first\n nilable = true\nend %}\n\n \n{% if type < Array\n type = type.type_vars.first\n array = true\nend %}\n\n \n{% if type < Slice\n type = \"Bytes\".id\n bytes = true\nend %}\n\n\n\n rows << Avram::Migrator::Columns::\n{{ type }}\nColumn(\n \n{% if array %}Array({{ type }}){% else %}{{ type }}{% end %}\n\n ).new(\n name: \n{{ type_declaration.var.stringify }}\n,\n nilable: \n{{ nilable }}\n,\n default: \n{{ default }}\n,\n \n{{ type_options.double_splat }}\n\n )\n \n{% if array %}\n .array!\n {% end %}\n\n .build_add_statement_for_create\n\n \n{% if index || unique %}\n add_index :{{ type_declaration.var }}, using: {{ using }}, unique: {{ unique }}\n {% end %}\n\n \n"}},{"html_id":"add_belongs_to(type_declaration,on_delete,references=nil,foreign_key_type=Int64,unique=false)-macro","name":"add_belongs_to","doc":"Adds a references column and index given a model class and references option.","summary":"

Adds a references column and index given a model class and references option.

","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"args_string":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, unique = false)","args_html":"(type_declaration, on_delete, references = nil, foreign_key_type = Int64, unique = false)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L135"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"on_delete","external_name":"on_delete","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""},{"name":"foreign_key_type","default_value":"Int64","external_name":"foreign_key_type","restriction":""},{"name":"unique","default_value":"false","external_name":"unique","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.is_a?(TypeDeclaration) %}{% else %}\n {% raise(\"add_belongs_to expected a type declaration like 'user : User', instead got: '#{type_declaration}'\") %}\n {% end %}\n\n \n{% if (type_declaration.type.stringify =~ (/\\w::\\w/)) && references.nil? %}\n {% raise(\"Namespaced models must include the `references` option with the name of the table.\\n\\nTry this...\\n\\n ▸ add_belongs_to(#{type_declaration}, on_delete: #{on_delete}, references: :the_table_name)\") %}\n {% end %}\n\n \n{% optional = type_declaration.type.is_a?(Union) %}\n\n\n \n{% if optional %}\n {% underscored_class = type_declaration.type.types.first %}\n {% else %}\n {% underscored_class = type_declaration.type %}\n {% end %}\n\n \n{% underscored_class = underscored_class.stringify.underscore.gsub(/::/, \"_\") %}\n\n\n \n{% foreign_key_name = type_declaration.var + \"_id\" %}\n\n \n%table_name\n = \n{{ references }}\n || Wordsmith::Inflector.pluralize(\n{{ underscored_class }}\n)\n\n rows << Avram::Migrator::Columns::\n{{ foreign_key_type }}\nColumn(\n{{ foreign_key_type }}\n).new(\n name: \n{{ foreign_key_name.stringify }}\n,\n nilable: \n{{ optional }}\n,\n default: nil,\n )\n .set_references(references: \n%table_name\n.to_s, on_delete: \n{{ on_delete }}\n)\n .build_add_statement_for_create\n\n add_index :\n{{ foreign_key_name }}\n, unique: \n{{ unique }}\n\n \n"}},{"html_id":"add_timestamps-macro","name":"add_timestamps","abstract":false,"location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":84,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L84"},"def":{"name":"add_timestamps","visibility":"Public","body":" add created_at : Time, default: :now\n add updated_at : Time, default: :now\n "}},{"html_id":"belongs_to(type_declaration,*args,**named_args)-macro","name":"belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type_declaration, *args, **named_args)","args_html":"(type_declaration, *args, **named_args)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":172,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L172"},"def":{"name":"belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% raise(\"Unexpected call to `belongs_to` in a migration.\\nFound in #{type_declaration.filename.id}:#{type_declaration.line_number}:#{type_declaration.column_number}.\\n\\nDid you mean to use 'add_belongs_to'?\\n\\n'add_belongs_to #{type_declaration}, ...'\") %}\n\n \n"}},{"html_id":"composite_primary_key(*columns)-macro","name":"composite_primary_key","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""}],"args_string":"(*columns)","args_html":"(*columns)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L77"},"def":{"name":"composite_primary_key","args":[{"name":"columns","external_name":"columns","restriction":""}],"splat_index":0,"visibility":"Public","body":" \n{% if columns.size < 2 %}\n {% raise(\"composite_primary_key expected at least two primary keys, instead got #{columns.size}\") %}\n {% end %}\n\n constraints << \" PRIMARY KEY (\n{{ (columns.join(\", \")).id }}\n)\"\n \n"}},{"html_id":"primary_key(type_declaration)-macro","name":"primary_key","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/migrator/create_table_statement.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_table_statement.cr#L71"},"def":{"name":"primary_key","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" rows << Avram::Migrator::Columns::PrimaryKeys::\n{{ type_declaration.type }}\nPrimaryKey\n .new(name: \n{{ type_declaration.var.stringify }}\n)\n .build\n \n"}}]},{"html_id":"avram/Avram/Migrator/CreateTriggerStatement","path":"Avram/Migrator/CreateTriggerStatement.html","kind":"class","full_name":"Avram::Migrator::CreateTriggerStatement","name":"CreateTriggerStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_trigger_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName,trigger_name:String,function:String,callbacktrigger_when:Symbol=:before,ontrigger_operation:Array(Symbol)=[:update])-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"},{"name":"function","external_name":"function","restriction":"String"},{"name":"trigger_when","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"trigger_operation","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"args_string":"(table_name : TableName, trigger_name : String, function : String, callback trigger_when : Symbol = :before, on trigger_operation : Array(Symbol) = [:update])","args_html":"(table_name : TableName, trigger_name : String, function : String, callback trigger_when : Symbol = :before, on trigger_operation : Array(Symbol) = [:update])","location":{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_trigger_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"},{"name":"function","external_name":"function","restriction":"String"},{"name":"trigger_when","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"trigger_operation","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, trigger_name, function, trigger_when, trigger_operation)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/create_trigger_statement.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/create_trigger_statement.cr#L11"},"def":{"name":"build","visibility":"Public","body":"\"CREATE TRIGGER #{@trigger_name}\\n#{@trigger_when.to_s.upcase} #{operation_statement} ON #{@table_name}\\nFOR EACH ROW\\nEXECUTE PROCEDURE #{@function}();\""}}]},{"html_id":"avram/Avram/Migrator/DropExtensionStatement","path":"Avram/Migrator/DropExtensionStatement.html","kind":"class","full_name":"Avram::Migrator::DropExtensionStatement","name":"DropExtensionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_extension_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_extension_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_extension_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_extension_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP EXTENSION IF EXISTS \\\"#{@name}\\\" CASCADE;\""}}]},{"html_id":"avram/Avram/Migrator/DropForeignKeyStatement","path":"Avram/Migrator/DropForeignKeyStatement.html","kind":"class","full_name":"Avram::Migrator::DropForeignKeyStatement","name":"DropForeignKeyStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_foreign_key_statement.cr#L9"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Generates an ALTER TABLE statement for dropping a foreign key constraint on a table.\n\n### Usage\n\n```\nDropForeignKeyStatement.new(from: :comments, references: :users, column: :author_id).build\n# => \"ALTER TABLE comments DROP CONSTRAINT comments_author_id_fk;\"\n```","summary":"

Generates an ALTER TABLE statement for dropping a foreign key constraint on a table.

","constructors":[{"html_id":"new(from:TableName,references:TableName,column:Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"}],"args_string":"(from : TableName, references : TableName, column : Symbol | Nil = nil)","args_html":"(from : TableName, references : TableName, column : Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_foreign_key_statement.cr#L10"},"def":{"name":"new","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","default_value":"nil","external_name":"column","restriction":"Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(from, references, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_foreign_key_statement.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_foreign_key_statement.cr#L13"},"def":{"name":"build","visibility":"Public","body":"foreign_key = @column || ((Wordsmith::Inflector.singularize(@references.to_s)) + \"_id\")\nString.build do |index|\n index << \"ALTER TABLE\"\n index << \" #{@from}\"\n index << \" DROP CONSTRAINT #{@from}_#{foreign_key}_fk\"\n index << \";\"\nend\n"}}]},{"html_id":"avram/Avram/Migrator/DropFunctionStatement","path":"Avram/Migrator/DropFunctionStatement.html","kind":"class","full_name":"Avram::Migrator::DropFunctionStatement","name":"DropFunctionStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_function_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_function_statement.cr#L2"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_function_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_function_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP FUNCTION IF EXISTS \\\"#{@name}\\\" CASCADE;\""}}]},{"html_id":"avram/Avram/Migrator/DropIndexStatement","path":"Avram/Migrator/DropIndexStatement.html","kind":"class","full_name":"Avram::Migrator::DropIndexStatement","name":"DropIndexStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_index_statement.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ALLOWED_ON_DELETE_STRATEGIES","name":"ALLOWED_ON_DELETE_STRATEGIES","value":"[:cascade, :restrict] of ::Symbol"}],"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"doc":"Builds an SQL statement for dropping an index by inferring it's name using table name and column(s).\n\n### Usage\n\nFor a single column index:\n\n```\nDropIndexStatement.new(:users, :email, if_exists: true, on_delete: :cascade).build\n# => \"DROP INDEX IF EXISTS users_email_index CASCADE;\"\n```\n\nFor multiple column index:\n\n```\nDropIndexStatement.new(:users, [:email, :username] if_exists: true, on_delete: :cascade).build\n# => \"DROP INDEX IF EXISTS users_email_username_index CASCADE;\"\n```\n\nFor index by name:\n\n```\nDropIndexStatement.new(:users, name: :custom_index_name).build\n# => \"DROP INDEX custom_index_name;\"\n```","summary":"

Builds an SQL statement for dropping an index by inferring it's name using table name and column(s).

","constructors":[{"html_id":"new(table:TableName,columns:Columns|Nil=nil,if_exists:Bool=false,on_delete:Symbol=:do_nothing,name:String|Nil|Symbol|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":"::Bool"},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":"::Symbol"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table : TableName, columns : Columns | Nil = nil, if_exists : Bool = false, on_delete : Symbol = :do_nothing, name : String | Nil | Symbol | Nil = nil)","args_html":"(table : TableName, columns : Columns | Nil = nil, if_exists : Bool = false, on_delete : Symbol = :do_nothing, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_index_statement.cr#L32"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":"::Bool"},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":"::Symbol"},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table, columns, if_exists, on_delete, name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_index_statement.cr#L35"},"def":{"name":"build","visibility":"Public","body":"String.build do |index|\n index << \"DROP INDEX\"\n if @if_exists\n index << \" IF EXISTS\"\n end\n index << \" #{index_name}\"\n index << (on_delete_strategy(@on_delete))\nend"}},{"html_id":"on_delete_strategy(on_delete=:do_nothing)-instance-method","name":"on_delete_strategy","abstract":false,"args":[{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""}],"args_string":"(on_delete = :do_nothing)","args_html":"(on_delete = :do_nothing)","location":{"filename":"src/avram/migrator/drop_index_statement.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_index_statement.cr#L44"},"def":{"name":"on_delete_strategy","args":[{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""}],"visibility":"Public","body":"if on_delete == (:do_nothing)\n \";\"\nelse\n if ALLOWED_ON_DELETE_STRATEGIES.includes?(on_delete)\n \" #{on_delete};\".upcase\n else\n raise(\"on_delete: :#{on_delete} is not supported. Please use :do_nothing, :cascade or :restrict\")\n end\nend"}}]},{"html_id":"avram/Avram/Migrator/DropTableStatement","path":"Avram/Migrator/DropTableStatement.html","kind":"class","full_name":"Avram::Migrator::DropTableStatement","name":"DropTableStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_table_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"args_string":"(table_name : TableName)","args_html":"(table_name : TableName)","location":{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_table_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_table_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_table_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP TABLE #{@table_name}\""}}]},{"html_id":"avram/Avram/Migrator/DropTriggerStatement","path":"Avram/Migrator/DropTriggerStatement.html","kind":"class","full_name":"Avram::Migrator::DropTriggerStatement","name":"DropTriggerStatement","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_trigger_statement.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(table_name:TableName,trigger_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"}],"args_string":"(table_name : TableName, trigger_name : String)","args_html":"(table_name : TableName, trigger_name : String)","location":{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_trigger_statement.cr#L2"},"def":{"name":"new","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"trigger_name","external_name":"trigger_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table_name, trigger_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"build-instance-method","name":"build","abstract":false,"location":{"filename":"src/avram/migrator/drop_trigger_statement.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/drop_trigger_statement.cr#L5"},"def":{"name":"build","visibility":"Public","body":"\"DROP TRIGGER IF EXISTS #{@trigger_name} ON #{@table_name};\""}}]},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","path":"Avram/Migrator/IndexStatementHelpers.html","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers","abstract":false,"locations":[{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/index_statement_helpers.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/AlterTableStatement","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement"},{"html_id":"avram/Avram/Migrator/CreateIndexStatement","kind":"class","full_name":"Avram::Migrator::CreateIndexStatement","name":"CreateIndexStatement"},{"html_id":"avram/Avram/Migrator/CreateTableStatement","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement"},{"html_id":"avram/Avram/Migrator/DropIndexStatement","kind":"class","full_name":"Avram::Migrator::DropIndexStatement","name":"DropIndexStatement"},{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"instance_methods":[{"html_id":"add_index(column:Symbol,unique=false,using:Symbol=:btree)-instance-method","name":"add_index","doc":"Generates raw sql for adding an index to a table column. Accepts 'unique' and 'using' options.","summary":"

Generates raw sql for adding an index to a table column.

","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"}],"args_string":"(column : Symbol, unique = false, using : Symbol = :btree)","args_html":"(column : Symbol, unique = false, using : Symbol = :btree)","location":{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/index_statement_helpers.cr#L7"},"def":{"name":"add_index","args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":"Symbol"}],"visibility":"Public","body":"index = (CreateIndexStatement.new(@table_name, column, using, unique)).build\nif index_added?(index, column)\nelse\n index_statements << index\nend\n"}},{"html_id":"index_added?(index:String,column:Symbol)-instance-method","name":"index_added?","doc":"Returns false unless matching index exists. Ignores UNIQUE","summary":"

Returns false unless matching index exists.

","abstract":false,"args":[{"name":"index","external_name":"index","restriction":"String"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(index : String, column : Symbol)","args_html":"(index : String, column : Symbol)","location":{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/index_statement_helpers.cr#L13"},"def":{"name":"index_added?","args":[{"name":"index","external_name":"index","restriction":"String"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"if (index_statements.includes?(index)) || (index_statements.includes?(index.gsub(\" UNIQUE\", \"\")))\nelse\n return false\nend\nraise(\"index on #{@table_name}.#{column} already exists\")\n"}}],"types":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers/Columns","path":"Avram/Migrator/IndexStatementHelpers/Columns.html","kind":"alias","full_name":"Avram::Migrator::IndexStatementHelpers::Columns","name":"Columns","abstract":false,"locations":[{"filename":"src/avram/migrator/index_statement_helpers.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/index_statement_helpers.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Array(Symbol) | Symbol)","aliased_html":"Array(Symbol) | Symbol","const":false,"namespace":{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}}]},{"html_id":"avram/Avram/Migrator/Migration","path":"Avram/Migrator/Migration.html","kind":"module","full_name":"Avram::Migrator::Migration","name":"Migration","abstract":false,"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"types":[{"html_id":"avram/Avram/Migrator/Migration/V1","path":"Avram/Migrator/Migration/V1.html","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"},{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator/Migration","kind":"module","full_name":"Avram::Migrator::Migration","name":"Migration"},"instance_methods":[{"html_id":"down(quiet=false)-instance-method","name":"down","doc":"Same as #up except calls rollback method in migration.","summary":"

Same as #up except calls rollback method in migration.

","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"args_string":"(quiet = false)","args_html":"(quiet = false)","location":{"filename":"src/avram/migrator/migration.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L48"},"def":{"name":"down","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"visibility":"Public","body":"suppress_logging do\n if pending?\n puts(\"Already rolled back #{self.class.name.colorize(:cyan)}\")\n else\n reset_prepared_statements\n rollback\n execute_in_transaction(@prepared_statements) do |tx|\n untrack_migration(tx)\n if quiet\n else\n puts(\"Rolled back #{self.class.name.colorize(:green)}\")\n end\n end\n end\nend"}},{"html_id":"migrate-instance-method","name":"migrate","abstract":true,"location":{"filename":"src/avram/migrator/migration.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L21"},"def":{"name":"migrate","visibility":"Public","body":""}},{"html_id":"migrated?-instance-method","name":"migrated?","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L69"},"def":{"name":"migrated?","visibility":"Public","body":"suppress_logging do\n Avram.settings.database_to_migrate.query_one?(\"SELECT id FROM migrations WHERE version = $1\", version, as: MigrationId)\nend"}},{"html_id":"pending?-instance-method","name":"pending?","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L65"},"def":{"name":"pending?","visibility":"Public","body":"!migrated?"}},{"html_id":"prepared_statements:Array(String)-instance-method","name":"prepared_statements","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L24"},"def":{"name":"prepared_statements","visibility":"Public","body":"@prepared_statements"}},{"html_id":"reset_prepared_statements-instance-method","name":"reset_prepared_statements","abstract":false,"location":{"filename":"src/avram/migrator/migration.cr","line_number":110,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L110"},"def":{"name":"reset_prepared_statements","visibility":"Public","body":"@prepared_statements = [] of String"}},{"html_id":"up(quiet=false)-instance-method","name":"up","doc":"Unless already migrated, calls migrate which in turn calls statement\nhelpers to generate and collect SQL statements in the\n@prepared_statements array. Each statement is then executed in a\ntransaction and tracked upon completion.","summary":"

Unless already migrated, calls migrate which in turn calls statement helpers to generate and collect SQL statements in the @prepared_statements array.

","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"args_string":"(quiet = false)","args_html":"(quiet = false)","location":{"filename":"src/avram/migrator/migration.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L30"},"def":{"name":"up","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":""}],"visibility":"Public","body":"suppress_logging do\n if migrated?\n puts(\"Already migrated #{self.class.name.colorize(:cyan)}\")\n else\n reset_prepared_statements\n migrate\n execute_in_transaction(@prepared_statements) do |tx|\n track_migration(tx)\n if quiet\n else\n puts(\"Migrated #{self.class.name.colorize(:green)}\")\n end\n end\n end\nend"}},{"html_id":"version:Int64-instance-method","name":"version","abstract":true,"location":{"filename":"src/avram/migrator/migration.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L22"},"def":{"name":"version","return_type":"Int64","visibility":"Public","body":""}}],"types":[{"html_id":"avram/Avram/Migrator/Migration/V1/MigrationId","path":"Avram/Migrator/Migration/V1/MigrationId.html","kind":"alias","full_name":"Avram::Migrator::Migration::V1::MigrationId","name":"MigrationId","abstract":false,"locations":[{"filename":"src/avram/migrator/migration.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/migration.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Int32 | Int64)","aliased_html":"Int32 | Int64","const":false,"namespace":{"html_id":"avram/Avram/Migrator/Migration/V1","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1"}}]}]},{"html_id":"avram/Avram/Migrator/MigrationGenerator","path":"Avram/Migrator/MigrationGenerator.html","kind":"class","full_name":"Avram::Migrator::MigrationGenerator","name":"MigrationGenerator","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"constructors":[{"html_id":"new(name:String,migrate_contents:String,rollback_contents:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"migrate_contents","external_name":"migrate_contents","restriction":"String"},{"name":"rollback_contents","external_name":"rollback_contents","restriction":"String"}],"args_string":"(name : String, migrate_contents : String, rollback_contents : String)","args_html":"(name : String, migrate_contents : String, rollback_contents : String)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L17"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"migrate_contents","external_name":"migrate_contents","restriction":"String"},{"name":"rollback_contents","external_name":"rollback_contents","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, migrate_contents, rollback_contents)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(name:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L14"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"formatted_migrate_contents:String|Nil-instance-method","name":"formatted_migrate_contents","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L32"},"def":{"name":"formatted_migrate_contents","return_type":"String | ::Nil","visibility":"Public","body":"@migrate_contents.try do |contents|\n pad_contents(contents)\nend"}},{"html_id":"formatted_rollback_contents:String|Nil-instance-method","name":"formatted_rollback_contents","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L38"},"def":{"name":"formatted_rollback_contents","return_type":"String | ::Nil","visibility":"Public","body":"@rollback_contents.try do |contents|\n pad_contents(contents)\nend"}},{"html_id":"generate(_version:Nil|String=@_version)-instance-method","name":"generate","abstract":false,"args":[{"name":"_version","default_value":"@_version","external_name":"_version","restriction":"::Nil | ::String"}],"args_string":"(_version : Nil | String = @_version)","args_html":"(_version : Nil | String = @_version)","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L20"},"def":{"name":"generate","args":[{"name":"_version","default_value":"@_version","external_name":"_version","restriction":"::Nil | ::String"}],"visibility":"Public","body":"@_version = _version\nensure_camelcase_name\nmake_migrations_folder_if_missing\nensure_unique\nFile.write(file_path, contents)\nio.puts(\"Created #{migration_class_name.colorize(:green)} in .#{relative_file_path.colorize(:green)}\")\n"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L7"},"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"to_s(__io__:IO):Nil-instance-method","name":"to_s","doc":"Appends a short String representation of this object\nwhich includes its class name and its object address.\n\n```\nclass Person\n def initialize(@name : String, @age : Int32)\n end\nend\n\nPerson.new(\"John\", 32).to_s # => #\n```","summary":"

Appends a short String representation of this object which includes its class name and its object address.

","abstract":false,"args":[{"name":"__io__","external_name":"__io__","restriction":"IO"}],"args_string":"(__io__ : IO) : Nil","args_html":"(__io__ : IO) : Nil","location":{"filename":"src/avram/tasks/gen/migration_generator.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration_generator.cr#L12"},"def":{"name":"to_s","args":[{"name":"__io__","external_name":"__io__","restriction":"IO"}],"return_type":"Nil","visibility":"Public","body":"ECR.embed(\"/home/runner/work/avram/avram/src/avram/tasks/gen/migration.ecr\", \"__io__\")"}}]},{"html_id":"avram/Avram/Migrator/MissingOnDeleteWithBelongsToError","path":"Avram/Migrator/MissingOnDeleteWithBelongsToError.html","kind":"module","full_name":"Avram::Migrator::MissingOnDeleteWithBelongsToError","name":"MissingOnDeleteWithBelongsToError","abstract":false,"locations":[{"filename":"src/avram/migrator/missing_on_delete_with_belongs_to_error.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/missing_on_delete_with_belongs_to_error.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/AlterTableStatement","kind":"class","full_name":"Avram::Migrator::AlterTableStatement","name":"AlterTableStatement"},{"html_id":"avram/Avram/Migrator/CreateTableStatement","kind":"class","full_name":"Avram::Migrator::CreateTableStatement","name":"CreateTableStatement"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"macros":[{"html_id":"add_belongs_to(type_declaration,references=nil)-macro","name":"add_belongs_to","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""}],"args_string":"(type_declaration, references = nil)","args_html":"(type_declaration, references = nil)","location":{"filename":"src/avram/migrator/missing_on_delete_with_belongs_to_error.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/missing_on_delete_with_belongs_to_error.cr#L2"},"def":{"name":"add_belongs_to","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"references","default_value":"nil","external_name":"references","restriction":""}],"visibility":"Public","body":" \n{% raise(\"Must use 'on_delete' with 'add_belongs_to'\\n\\nTry this...\\n\\n ▸ add_belongs_to #{type_declaration}, on_delete: :cascade\\n\\nYou can also use :restrict, :nullify, or :do_nothing\\n\\nRead more at: https://luckyframework.org/guides/database/migrations#associations\\n\\n\") %}\n\n \n"}}]},{"html_id":"avram/Avram/Migrator/Runner","path":"Avram/Migrator/Runner.html","kind":"class","full_name":"Avram::Migrator::Runner","name":"Runner","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/migrator/runner.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"MIGRATIONS_TABLE_NAME","name":"MIGRATIONS_TABLE_NAME","value":"\"migrations\""}],"extended_modules":[{"html_id":"avram/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"class_methods":[{"html_id":"cmd_args-class-method","name":"cmd_args","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L40"},"def":{"name":"cmd_args","visibility":"Public","body":"String.build do |args|\n if self.db_user\n args << \"-U #{self.db_user}\"\n end\n if self.db_host\n args << \" -h #{self.db_host}\"\n end\n if self.db_port\n args << \" -p #{self.db_port}\"\n end\n args << \" #{self.db_name}\"\nend"}},{"html_id":"create_db(quiet?:Bool=false)-class-method","name":"create_db","abstract":false,"args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"args_string":"(quiet? : Bool = false)","args_html":"(quiet? : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L58"},"def":{"name":"create_db","args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"visibility":"Public","body":"begin\n DB.connect(\"#{credentials.connection_string}/#{db_user}\") do |db|\n db.exec(\"CREATE DATABASE #{db_name}\")\n end\n if quiet?\n else\n puts(\"Done creating #{db_name.colorize(:green)}\")\n end\nrescue e : DB::ConnectionRefused\n message = e.message.to_s\n if message.blank?\n raise(ConnectionError.new(URI.parse(credentials.url_without_query_params), Avram.settings.database_to_migrate))\n else\n raise(e)\n end\nrescue e : Exception\n message = e.message.to_s\n if message.includes?(\"\\\"#{self.db_name}\\\" already exists\")\n if quiet?\n else\n puts(\"Already created #{self.db_name.colorize(:green)}\")\n end\n else\n if message.includes?(\"Cannot establish connection\")\n raise(PGNotRunningError.new(message))\n else\n raise(e)\n end\n end\nend"}},{"html_id":"credentials-class-method","name":"credentials","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L36"},"def":{"name":"credentials","visibility":"Public","body":"Avram.settings.database_to_migrate.credentials"}},{"html_id":"db_host-class-method","name":"db_host","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L20"},"def":{"name":"db_host","visibility":"Public","body":"credentials.hostname"}},{"html_id":"db_name-class-method","name":"db_name","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L16"},"def":{"name":"db_name","visibility":"Public","body":"credentials.database"}},{"html_id":"db_password-class-method","name":"db_password","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L32"},"def":{"name":"db_password","visibility":"Public","body":"credentials.password"}},{"html_id":"db_port-class-method","name":"db_port","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L24"},"def":{"name":"db_port","visibility":"Public","body":"credentials.port"}},{"html_id":"db_user-class-method","name":"db_user","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L28"},"def":{"name":"db_user","visibility":"Public","body":"credentials.username"}},{"html_id":"drop_db(quiet?:Bool=false)-class-method","name":"drop_db","abstract":false,"args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"args_string":"(quiet? : Bool = false)","args_html":"(quiet? : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L49"},"def":{"name":"drop_db","args":[{"name":"quiet?","default_value":"false","external_name":"quiet?","restriction":"Bool"}],"visibility":"Public","body":"DB.connect(\"#{credentials.connection_string}/#{db_user}\") do |db|\n db.exec(\"DROP DATABASE IF EXISTS #{db_name}\")\nend\nif quiet?\nelse\n puts(\"Done dropping #{Avram::Migrator::Runner.db_name.colorize(:green)}\")\nend\n"}},{"html_id":"dump_db(dump_to:String=\"db/structure.sql\",quiet:Bool=false)-class-method","name":"dump_db","doc":"Creates a new file at `dump_to` with your database schema,\nand includes the migtation data.","summary":"

Creates a new file at dump_to with your database schema, and includes the migtation data.

","abstract":false,"args":[{"name":"dump_to","default_value":"\"db/structure.sql\"","external_name":"dump_to","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(dump_to : String = \"db/structure.sql\", quiet : Bool = false)","args_html":"(dump_to : String = "db/structure.sql", quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":98,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L98"},"def":{"name":"dump_db","args":[{"name":"dump_to","default_value":"\"db/structure.sql\"","external_name":"dump_to","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"Db::VerifyConnection.new(quiet: true).run_task\nrun(\"pg_dump -s #{cmd_args} > #{dump_to}; pg_dump -t migrations --data-only #{cmd_args} >> #{dump_to}\")\nif quiet\nelse\n puts(\"Done dumping #{db_name.colorize(:green)}\")\nend\n"}},{"html_id":"migrations-class-method","name":"migrations","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L11"},"def":{"name":"migrations","visibility":"Public","body":"@@migrations"}},{"html_id":"restore_db(restore_file:String,quiet:Bool=false)-class-method","name":"restore_db","abstract":false,"args":[{"name":"restore_file","external_name":"restore_file","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(restore_file : String, quiet : Bool = false)","args_html":"(restore_file : String, quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":85,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L85"},"def":{"name":"restore_db","args":[{"name":"restore_file","external_name":"restore_file","restriction":"String"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"if File.exists?(restore_file)\n run(\"psql -q #{cmd_args} -v ON_ERROR_STOP=1 < #{restore_file}\")\n if quiet\n else\n puts(\"Done restoring #{db_name.colorize(:green)}\")\n end\nelse\n raise(\"Unable to locate the restore file: #{restore_file}\")\nend"}},{"html_id":"run(command:String,output:IO=STDOUT)-class-method","name":"run","abstract":false,"args":[{"name":"command","external_name":"command","restriction":"String"},{"name":"output","default_value":"STDOUT","external_name":"output","restriction":"IO"}],"args_string":"(command : String, output : IO = STDOUT)","args_html":"(command : String, output : IO = STDOUT)","location":{"filename":"src/avram/migrator/runner.cr","line_number":130,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L130"},"def":{"name":"run","args":[{"name":"command","external_name":"command","restriction":"String"},{"name":"output","default_value":"STDOUT","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"error_messages = IO::Memory.new\nif self.db_password\n ENV[\"PGPASSWORD\"] = self.db_password\nend\nresult = Process.run(command, shell: true, output: output, error: error_messages)\nif self.db_password\n ENV.delete(\"PGPASSWORD\")\nend\nif result.success?\nelse\n raise(error_messages.to_s)\nend\n"}},{"html_id":"setup_migration_tracking_tables-class-method","name":"setup_migration_tracking_tables","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L106"},"def":{"name":"setup_migration_tracking_tables","visibility":"Public","body":"suppress_logging do\n db = Avram.settings.database_to_migrate\n db.exec(create_table_for_tracking_migrations)\n db.exec(create_unique_index_for_migrations)\nend"}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/migrator/runner.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L13"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"ensure_migrated!-instance-method","name":"ensure_migrated!","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":184,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L184"},"def":{"name":"ensure_migrated!","visibility":"Public","body":"if !pending_migrations.empty?\n display_migration_error_banner\n Process.signal(:term, Process.ppid)\n exit(1)\nend"}},{"html_id":"rollback_all-instance-method","name":"rollback_all","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":161,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L161"},"def":{"name":"rollback_all","visibility":"Public","body":"self.class.setup_migration_tracking_tables\nmigrated_migrations.reverse.each do |__arg1|\n __arg1.new.down\nend\n"}},{"html_id":"rollback_one-instance-method","name":"rollback_one","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":166,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L166"},"def":{"name":"rollback_one","visibility":"Public","body":"self.class.setup_migration_tracking_tables\nif migrated_migrations.empty?\n puts(\"Did not roll anything back because the database has no migrations.\".colorize(:green))\nelse\n migrated_migrations.last.new.down\nend\n"}},{"html_id":"rollback_to(last_version:Int64)-instance-method","name":"rollback_to","abstract":false,"args":[{"name":"last_version","external_name":"last_version","restriction":"Int64"}],"args_string":"(last_version : Int64)","args_html":"(last_version : Int64)","location":{"filename":"src/avram/migrator/runner.cr","line_number":175,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L175"},"def":{"name":"rollback_to","args":[{"name":"last_version","external_name":"last_version","restriction":"Int64"}],"visibility":"Public","body":"self.class.setup_migration_tracking_tables\nsubset = migrated_migrations.select do |mm|\n mm.new.version > last_version\nend\nsubset.reverse.each do |__arg2|\n __arg2.new.down\nend\nputs(\"Done rolling back to #{last_version}\".colorize(:green))\n"}},{"html_id":"run_next_migration-instance-method","name":"run_next_migration","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L155"},"def":{"name":"run_next_migration","visibility":"Public","body":"prepare_for_migration do\n pending_migrations.first.new.up\nend"}},{"html_id":"run_pending_migrations-instance-method","name":"run_pending_migrations","abstract":false,"location":{"filename":"src/avram/migrator/runner.cr","line_number":149,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/runner.cr#L149"},"def":{"name":"run_pending_migrations","visibility":"Public","body":"prepare_for_migration do\n pending_migrations.each do |__arg0|\n __arg0.new.up(@quiet)\n end\nend"}}]},{"html_id":"avram/Avram/Migrator/StatementHelpers","path":"Avram/Migrator/StatementHelpers.html","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers","abstract":false,"ancestors":[{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"},{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"}],"locations":[{"filename":"src/avram/migrator/statement_helpers.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Migrator/IndexStatementHelpers","kind":"module","full_name":"Avram::Migrator::IndexStatementHelpers","name":"IndexStatementHelpers"},{"html_id":"avram/Avram/TableFor","kind":"module","full_name":"Avram::TableFor","name":"TableFor"}],"including_types":[{"html_id":"avram/Avram/Migrator/Migration/V1","kind":"class","full_name":"Avram::Migrator::Migration::V1","name":"V1"}],"namespace":{"html_id":"avram/Avram/Migrator","kind":"module","full_name":"Avram::Migrator","name":"Migrator"},"instance_methods":[{"html_id":"create_foreign_key(from:TableName,to:TableName,on_delete:Symbol,column:Symbol|Nil,primary_key=:id)-instance-method","name":"create_foreign_key","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":""}],"args_string":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil, primary_key = :id)","args_html":"(from : TableName, to : TableName, on_delete : Symbol, column : Symbol | Nil, primary_key = :id)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L31"},"def":{"name":"create_foreign_key","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"to","external_name":"to","restriction":"TableName"},{"name":"on_delete","external_name":"on_delete","restriction":"Symbol"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"},{"name":"primary_key","default_value":":id","external_name":"primary_key","restriction":""}],"visibility":"Public","body":"prepared_statements << (CreateForeignKeyStatement.new(from, to, on_delete, column, primary_key)).build"}},{"html_id":"create_function(name:String,body:String,returns:String=\"trigger\")-instance-method","name":"create_function","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"args_string":"(name : String, body : String, returns : String = \"trigger\")","args_html":"(name : String, body : String, returns : String = "trigger")","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L67"},"def":{"name":"create_function","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"body","external_name":"body","restriction":"String"},{"name":"returns","default_value":"\"trigger\"","external_name":"returns","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::CreateFunctionStatement.new(name, body: body, returns: returns)).build"}},{"html_id":"create_index(table_name:TableName,columns:Columns,unique=false,using=:btree,name:String|Nil|Symbol|Nil=nil)-instance-method","name":"create_index","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table_name : TableName, columns : Columns, unique = false, using = :btree, name : String | Nil | Symbol | Nil = nil)","args_html":"(table_name : TableName, columns : Columns, unique = false, using = :btree, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L39"},"def":{"name":"create_index","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","external_name":"columns","restriction":"Columns"},{"name":"unique","default_value":"false","external_name":"unique","restriction":""},{"name":"using","default_value":":btree","external_name":"using","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (CreateIndexStatement.new(table_name, columns, using, unique, name)).build"}},{"html_id":"create_trigger(table_name:TableName,name:String,function_name:String,callback:Symbol=:before,on:Array(Symbol)=[:update])-instance-method","name":"create_trigger","doc":"Drop any existing trigger by this name first before creating.\nPostgres does not support updating or replacing a trigger as of version 12\n\nCreates a new TRIGGER named `name` on the table `table_name`.\n`function_name` - The PG function to run from this trigger.\n`callback` - When to run this trigger (BEFORE or AFTER). Default `:before`\n`on` - The operation(s) for this trigger (INSERT, UPDATE, DELETE). Default is `[:update]`\n\n```\ncreate_trigger(:users, \"trigger_set_timestamps\", \"set_timestamps\")\n# => CREATE TRIGGER trigger_set_timestamps BEFORE UPDATE ON users FOR EACH ROW EXECUTE PROCEDURE set_timestamps();\n```","summary":"

Drop any existing trigger by this name first before creating.

","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"},{"name":"function_name","external_name":"function_name","restriction":"String"},{"name":"callback","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"on","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"args_string":"(table_name : TableName, name : String, function_name : String, callback : Symbol = :before, on : Array(Symbol) = [:update])","args_html":"(table_name : TableName, name : String, function_name : String, callback : Symbol = :before, on : Array(Symbol) = [:update])","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L87"},"def":{"name":"create_trigger","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"},{"name":"function_name","external_name":"function_name","restriction":"String"},{"name":"callback","default_value":":before","external_name":"callback","restriction":"Symbol"},{"name":"on","default_value":"[:update]","external_name":"on","restriction":"Array(Symbol)"}],"visibility":"Public","body":"drop_trigger(table_name, name)\nprepared_statements << (Avram::Migrator::CreateTriggerStatement.new(table_name, name, function_name, callback, on)).build\n"}},{"html_id":"disable_extension(name:String)-instance-method","name":"disable_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L59"},"def":{"name":"disable_extension","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropExtensionStatement.new(name)).build"}},{"html_id":"drop(table_name)-instance-method","name":"drop","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L17"},"def":{"name":"drop","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropTableStatement.new(table_name)).build"}},{"html_id":"drop_foreign_key(from:TableName,references:TableName,column:Symbol|Nil)-instance-method","name":"drop_foreign_key","abstract":false,"args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"}],"args_string":"(from : TableName, references : TableName, column : Symbol | Nil)","args_html":"(from : TableName, references : TableName, column : Symbol | Nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L35"},"def":{"name":"drop_foreign_key","args":[{"name":"from","external_name":"from","restriction":"TableName"},{"name":"references","external_name":"references","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (DropForeignKeyStatement.new(from, references, column)).build"}},{"html_id":"drop_function(name:String)-instance-method","name":"drop_function","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L71"},"def":{"name":"drop_function","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropFunctionStatement.new(name)).build"}},{"html_id":"drop_index(table_name:TableName,columns:Columns|Nil=nil,if_exists=false,on_delete=:do_nothing,name:String|Nil|Symbol|Nil=nil)-instance-method","name":"drop_index","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":""},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"args_string":"(table_name : TableName, columns : Columns | Nil = nil, if_exists = false, on_delete = :do_nothing, name : String | Nil | Symbol | Nil = nil)","args_html":"(table_name : TableName, columns : Columns | Nil = nil, if_exists = false, on_delete = :do_nothing, name : String | Nil | Symbol | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L43"},"def":{"name":"drop_index","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"columns","default_value":"nil","external_name":"columns","restriction":"Columns | ::Nil"},{"name":"if_exists","default_value":"false","external_name":"if_exists","restriction":""},{"name":"on_delete","default_value":":do_nothing","external_name":"on_delete","restriction":""},{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil | Symbol | ::Nil"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropIndexStatement.new(table_name, columns, if_exists, on_delete, name)).build"}},{"html_id":"drop_trigger(table_name:TableName,name:String)-instance-method","name":"drop_trigger","doc":"Drop the tigger `name` for the table `table_name`","summary":"

Drop the tigger name for the table table_name

","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(table_name : TableName, name : String)","args_html":"(table_name : TableName, name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":93,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L93"},"def":{"name":"drop_trigger","args":[{"name":"table_name","external_name":"table_name","restriction":"TableName"},{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::DropTriggerStatement.new(table_name, name)).build"}},{"html_id":"enable_extension(name:String)-instance-method","name":"enable_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"}],"args_string":"(name : String)","args_html":"(name : String)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L55"},"def":{"name":"enable_extension","args":[{"name":"name","external_name":"name","restriction":"String"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::CreateExtensionStatement.new(name)).build"}},{"html_id":"make_optional(table:TableName,column:Symbol)-instance-method","name":"make_optional","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(table : TableName, column : Symbol)","args_html":"(table : TableName, column : Symbol)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L51"},"def":{"name":"make_optional","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::ChangeNullStatement.new(table, column, required: false)).build"}},{"html_id":"make_required(table:TableName,column:Symbol)-instance-method","name":"make_required","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"args_string":"(table : TableName, column : Symbol)","args_html":"(table : TableName, column : Symbol)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L47"},"def":{"name":"make_required","args":[{"name":"table","external_name":"table","restriction":"TableName"},{"name":"column","external_name":"column","restriction":"Symbol"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::ChangeNullStatement.new(table, column, required: true)).build"}},{"html_id":"update_extension(name:String,to:String|Nil=nil)-instance-method","name":"update_extension","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"args_string":"(name : String, to : String | Nil = nil)","args_html":"(name : String, to : String | Nil = nil)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L63"},"def":{"name":"update_extension","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"to","default_value":"nil","external_name":"to","restriction":"String | ::Nil"}],"visibility":"Public","body":"prepared_statements << (Avram::Migrator::AlterExtensionStatement.new(name, to: to)).build"}}],"macros":[{"html_id":"alter(table_name)-macro","name":"alter","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L21"},"def":{"name":"alter","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":" statements = Avram::Migrator::AlterTableStatement.new(\n{{ table_name }}\n).build do\n \n{{ yield }}\n\n \nend.statements\n\n statements.each do |statement|\n prepared_statements << statement\n \nend\n \n"}},{"html_id":"create(table_name)-macro","name":"create","abstract":false,"args":[{"name":"table_name","external_name":"table_name","restriction":""}],"args_string":"(table_name)","args_html":"(table_name)","location":{"filename":"src/avram/migrator/statement_helpers.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/migrator/statement_helpers.cr#L7"},"def":{"name":"create","args":[{"name":"table_name","external_name":"table_name","restriction":""}],"visibility":"Public","body":" statements = Avram::Migrator::CreateTableStatement.new(\n{{ table_name }}\n).build do\n \n{{ yield }}\n\n \nend.statements\n\n statements.each do |statement|\n prepared_statements << statement\n \nend\n \n"}}]}]},{"html_id":"avram/Avram/MissingRequiredAssociationError","path":"Avram/MissingRequiredAssociationError.html","kind":"class","full_name":"Avram::MissingRequiredAssociationError","name":"MissingRequiredAssociationError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(model:Avram::Model.class,association:Avram::Model.class)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"Avram::Model.class"},{"name":"association","external_name":"association","restriction":"Avram::Model.class"}],"args_string":"(model : Avram::Model.class, association : Avram::Model.class)","args_html":"(model : Avram::Model.class, association : Avram::Model.class)","location":{"filename":"src/avram/errors.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L44"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"Avram::Model.class"},{"name":"association","external_name":"association","restriction":"Avram::Model.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, association)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"association:Avram::Model.class-instance-method","name":"association","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L42"},"def":{"name":"association","return_type":"Avram::Model.class","visibility":"Public","body":"@association"}},{"html_id":"model:Avram::Model.class-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L41"},"def":{"name":"model","return_type":"Avram::Model.class","visibility":"Public","body":"@model"}}]},{"html_id":"avram/Avram/Model","path":"Avram/Model.html","kind":"class","full_name":"Avram::Model","name":"Model","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},{"html_id":"avram/Avram/Polymorphic","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic"},{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},{"html_id":"avram/Avram/Associations/BelongsTo","kind":"module","full_name":"Avram::Associations::BelongsTo","name":"BelongsTo"},{"html_id":"avram/Avram/Associations/HasOne","kind":"module","full_name":"Avram::Associations::HasOne","name":"HasOne"},{"html_id":"avram/Avram/Associations/HasMany","kind":"module","full_name":"Avram::Associations::HasMany","name":"HasMany"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/model.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Associations","kind":"module","full_name":"Avram::Associations","name":"Associations"},{"html_id":"avram/Avram/Polymorphic","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic"},{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"database_table_info:Avram::Database::TableInfo|Nil-class-method","name":"database_table_info","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L28"},"def":{"name":"database_table_info","return_type":"Avram::Database::TableInfo | ::Nil","visibility":"Public","body":"database.database_info.table(table_name.to_s)"}},{"html_id":"primary_key_name:Symbol|Nil-class-method","name":"primary_key_name","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L24"},"def":{"name":"primary_key_name","return_type":"Symbol | ::Nil","visibility":"Public","body":"nil"}}],"instance_methods":[{"html_id":"delete-instance-method","name":"delete","doc":"Refer to `PrimaryKeyMethods#delete`","summary":"

Refer to PrimaryKeyMethods#delete

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L52"},"def":{"name":"delete","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#delete on #{@type.name} because it does not have a primary key. Add a primary key or define your own `delete` method.\") %}"}},{"html_id":"model_name:String-instance-method","name":"model_name","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L32"},"def":{"name":"model_name","return_type":"String","visibility":"Public","body":"self.class.name"}},{"html_id":"reload:self-instance-method","name":"reload","doc":"Refer to `PrimaryKeyMethods#reload`","summary":"

Refer to PrimaryKeyMethods#reload

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L37"},"def":{"name":"reload","return_type":"self","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#reload on #{@type.name} because it does not have a primary key. Add a primary key or define your own `reload` method.\") %}"}},{"html_id":"reload(&):self-instance-method","name":"reload","doc":"Refer to `PrimaryKeyMethods#reload`","summary":"

Refer to PrimaryKeyMethods#reload

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L42"},"def":{"name":"reload","yields":0,"block_arity":0,"return_type":"self","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#reload on #{@type.name} because it does not have a primary key. Add a primary key or define your own `reload` method.\") %}"}},{"html_id":"to_param:String-instance-method","name":"to_param","doc":"Refer to `PrimaryKeyMethods#to_param`","summary":"

Refer to PrimaryKeyMethods#to_param

","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L47"},"def":{"name":"to_param","return_type":"String","visibility":"Public","body":"{% raise(\"Unable to call Avram::Model#to_param on #{@type.name} because it does not have a primary key. Add a primary key or define your own `to_param` method.\") %}"}}],"macros":[{"html_id":"association(assoc_name,type,relationship_type,foreign_key=nil,through=nil)-macro","name":"association","abstract":false,"args":[{"name":"assoc_name","external_name":"assoc_name","restriction":""},{"name":"type","external_name":"type","restriction":""},{"name":"relationship_type","external_name":"relationship_type","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""}],"args_string":"(assoc_name, type, relationship_type, foreign_key = nil, through = nil)","args_html":"(assoc_name, type, relationship_type, foreign_key = nil, through = nil)","location":{"filename":"src/avram/model.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L281"},"def":{"name":"association","args":[{"name":"assoc_name","external_name":"assoc_name","restriction":""},{"name":"type","external_name":"type","restriction":""},{"name":"relationship_type","external_name":"relationship_type","restriction":""},{"name":"foreign_key","default_value":"nil","external_name":"foreign_key","restriction":""},{"name":"through","default_value":"nil","external_name":"through","restriction":""}],"visibility":"Public","body":" \n{% ASSOCIATIONS << {type: type, assoc_name: assoc_name.id, foreign_key: foreign_key, relationship_type: relationship_type, through: through} %}\n\n \n"}},{"html_id":"column(type_declaration,autogenerated=false,serializeis_serialized=false,allow_blank=false)-macro","name":"column","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"autogenerated","default_value":"false","external_name":"autogenerated","restriction":""},{"name":"is_serialized","default_value":"false","external_name":"serialize","restriction":""},{"name":"allow_blank","default_value":"false","external_name":"allow_blank","restriction":""}],"args_string":"(type_declaration, autogenerated = false, serialize is_serialized = false, allow_blank = false)","args_html":"(type_declaration, autogenerated = false, serialize is_serialized = false, allow_blank = false)","location":{"filename":"src/avram/model.cr","line_number":246,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L246"},"def":{"name":"column","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""},{"name":"autogenerated","default_value":"false","external_name":"autogenerated","restriction":""},{"name":"is_serialized","default_value":"false","external_name":"serialize","restriction":""},{"name":"allow_blank","default_value":"false","external_name":"allow_blank","restriction":""}],"visibility":"Public","body":" \n{% if type_declaration.type.is_a?(Union) %}\n {% data_type = type_declaration.type.types.first %}\n {% nilable = true %}\n {% else %}\n {% data_type = type_declaration.type %}\n {% nilable = false %}\n {% end %}\n\n \n{% if type_declaration.value || (type_declaration.value == false) %}\n {% value = type_declaration.value %}\n {% else %}\n {% value = nil %}\n {% end %}\n\n\n \n{% COLUMNS << {name: type_declaration.var, type: data_type, nilable: nilable.id, autogenerated: autogenerated, value: value, serialized: is_serialized, allow_blank: allow_blank} %}\n\n \n"}},{"html_id":"default_columns-macro","name":"default_columns","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L137"},"def":{"name":"default_columns","visibility":"Public","body":" primary_key id : Int64\n timestamps\n "}},{"html_id":"primary_key(type_declaration)-macro","name":"primary_key","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/model.cr","line_number":100,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L100"},"def":{"name":"primary_key","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" PRIMARY_KEY_TYPE = \n{{ type_declaration.type }}\n\n PRIMARY_KEY_NAME = \n{{ type_declaration.var.symbolize }}\n\n column \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n, autogenerated: true\n alias PrimaryKeyType = \n{{ type_declaration.type }}\n\n\n def self.primary_key_name : Symbol?\n :\n{{ type_declaration.var.stringify }}\n\n \nend\n\n include Avram::PrimaryKeyMethods\n\n \n# If not using default 'id' primary key\n\n \n{% if type_declaration.var.id != \"id\".id %}\n # Then point 'id' to the primary key\n def id\n {{ type_declaration.var.id }}\n end\n {% end %}\n\n \n"}},{"html_id":"setup(step)-macro","name":"setup","abstract":false,"args":[{"name":"step","external_name":"step","restriction":""}],"args_string":"(step)","args_html":"(step)","location":{"filename":"src/avram/model.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L152"},"def":{"name":"setup","args":[{"name":"step","external_name":"step","restriction":""}],"visibility":"Public","body":" \n{{ step.id }}\n(\n type: \n{{ @type }}\n,\n columns: \n{{ COLUMNS }}\n,\n associations: \n{{ ASSOCIATIONS }}\n\n )\n \n"}},{"html_id":"setup_association_queries(associations,*args,**named_args)-macro","name":"setup_association_queries","abstract":false,"args":[{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(associations, *args, **named_args)","args_html":"(associations, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":209,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L209"},"def":{"name":"setup_association_queries","args":[{"name":"associations","external_name":"associations","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% for assoc in associations %}\n def {{ assoc[:assoc_name] }}_query\n {% if assoc[:relationship_type] == (:has_many) %}\n {{ assoc[:type] }}::BaseQuery.new.{{ assoc[:foreign_key].id }}(id)\n {% else %}{% if assoc[:relationship_type] == (:belongs_to) %}\n {{ assoc[:type] }}::BaseQuery.new.id({{ assoc[:foreign_key].id }})\n {% else %}\n {{ assoc[:type] }}::BaseQuery.new\n {% end %}{% end %}\n end\n {% end %}\n\n \n"}},{"html_id":"setup_column_info_methods(columns,*args,**named_args)-macro","name":"setup_column_info_methods","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L263"},"def":{"name":"setup_column_info_methods","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" def self.column_names : Array(Symbol)\n columns.map \n{ |column| column[:name] }\n \nend\n\n def self.columns : Array(\n{name: Symbol, nilable: Bool, type: String})\n [\n \n{% for column in columns %}\n {\n name: {{ column[:name].id.symbolize }},\n nilable: {{ column[:nilable] }},\n type: {{ column[:type].id }}.name\n },\n {% end %}\n\n ]\n \nend\n \n"}},{"html_id":"setup_db_mapping(columns,*args,**named_args)-macro","name":"setup_db_mapping","doc":"Setup [database mapping](http://crystal-lang.github.io/crystal-db/api/latest/DB.html) for the model's columns.\n\nNOTE: Avram::Migrator saves `Float` columns as numeric which are converted\nin the avram/charms/float64_extensions.cr file","summary":"

Setup database mapping for the model's columns.

","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":189,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L189"},"def":{"name":"setup_db_mapping","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" DB.mapping(\n{\n \n{% for column in columns %}\n {{ column[:name] }}: {\n {% if column[:type].id == Array(Float64).id %}\n type: Array(PG::Numeric),\n {% else %}{% if column[:type].is_a?(Generic) || column[:serialized] %}\n type: {{ column[:type] }},\n {% else %}\n type: {{ column[:type] }}::Lucky::ColumnType,\n {% end %}{% end %}\n nilable: {{ column[:nilable] }},\n {% if column[:serialized] %}\n converter: JSONConverter({{ column[:type] }}),\n {% end %}\n },\n {% end %}\n\n })\n \n"}},{"html_id":"setup_getters(columns,*args,**named_args)-macro","name":"setup_getters","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":233,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L233"},"def":{"name":"setup_getters","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" \n{% for column in columns %}\n def {{ column[:name] }} : {{ column[:type] }}{{ (column[:nilable] ? \"?\" : \"\").id }}\n {{ column[:type] }}.adapter.from_db!(@{{ column[:name] }})\n end\n {% if column[:type].id == Bool.id %}\n def {{ column[:name] }}? : Bool\n !!{{ column[:name] }}\n end\n {% end %}\n {% end %}\n\n \n"}},{"html_id":"setup_initialize(columns,*args,**named_args)-macro","name":"setup_initialize","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(columns, *args, **named_args)","args_html":"(columns, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":176,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L176"},"def":{"name":"setup_initialize","args":[{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" def initialize(\n \n{% for column in columns %}\n @{{ column[:name] }},\n {% end %}\n\n )\n \nend\n \n"}},{"html_id":"setup_table_schema_enforcer_validations(type,*args,**named_args)-macro","name":"setup_table_schema_enforcer_validations","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":223,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L223"},"def":{"name":"setup_table_schema_enforcer_validations","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" schema_enforcer_validations << EnsureExistingTable.new(model_class: \n{{ type.id }}\n)\n schema_enforcer_validations << EnsureMatchingColumns.new(model_class: \n{{ type.id }}\n)\n \n"}},{"html_id":"setup_view_schema_enforcer_validations(type,*args,**named_args)-macro","name":"setup_view_schema_enforcer_validations","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/model.cr","line_number":228,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L228"},"def":{"name":"setup_view_schema_enforcer_validations","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" schema_enforcer_validations << EnsureExistingTable.new(model_class: \n{{ type.id }}\n)\n schema_enforcer_validations << EnsureMatchingColumns.new(model_class: \n{{ type.id }}\n, check_required: false)\n \n"}},{"html_id":"skip_default_columns-macro","name":"skip_default_columns","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L142"},"def":{"name":"skip_default_columns","visibility":"Public","body":" macro default_columns\n \nend\n \n"}},{"html_id":"table(table_name=nil)-macro","name":"table","abstract":false,"args":[{"name":"table_name","default_value":"nil","external_name":"table_name","restriction":""}],"args_string":"(table_name = nil)","args_html":"(table_name = nil)","location":{"filename":"src/avram/model.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L56"},"def":{"name":"table","args":[{"name":"table_name","default_value":"nil","external_name":"table_name","restriction":""}],"visibility":"Public","body":" default_columns\n\n \n{{ yield }}\n\n\n validate_columns(\"table\")\n validate_primary_key\n\n \n{% if table_name %}\n class_getter table_name : String = {{ table_name.id.stringify }}\n {% else %}\n class_getter table_name : String = Avram::TableFor.table_for({{ @type.id }})\n {% end %}\n\n setup(Avram::Model.setup_initialize)\n setup(Avram::Model.setup_db_mapping)\n setup(Avram::Model.setup_getters)\n setup(Avram::Model.setup_column_info_methods)\n setup(Avram::Model.setup_association_queries)\n setup(Avram::Model.setup_table_schema_enforcer_validations)\n setup(Avram::BaseQueryTemplate.setup)\n setup(Avram::SaveOperationTemplate.setup)\n setup(Avram::DeleteOperationTemplate.setup)\n setup(Avram::SchemaEnforcer.setup)\n \n"}},{"html_id":"timestamps-macro","name":"timestamps","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L147"},"def":{"name":"timestamps","visibility":"Public","body":" column created_at : Time, autogenerated: true\n column updated_at : Time, autogenerated: true\n "}},{"html_id":"validate_columns(model_type)-macro","name":"validate_columns","abstract":false,"args":[{"name":"model_type","external_name":"model_type","restriction":""}],"args_string":"(model_type)","args_html":"(model_type)","location":{"filename":"src/avram/model.cr","line_number":160,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L160"},"def":{"name":"validate_columns","args":[{"name":"model_type","external_name":"model_type","restriction":""}],"visibility":"Public","body":" \n{% if COLUMNS.empty? %}\n {% raise(\"#{@type} must define at least one column.\\n\\nExample:\\n\\n #{model_type.id} do\\n primary_key id : Int64\\n ...\\n end\") %}\n {% end %}\n\n \n"}},{"html_id":"validate_primary_key-macro","name":"validate_primary_key","abstract":false,"location":{"filename":"src/avram/model.cr","line_number":121,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L121"},"def":{"name":"validate_primary_key","visibility":"Public","body":" \n{% if !(@type.has_constant?(\"PRIMARY_KEY_TYPE\")) %}\n \\{% raise <<-ERROR\n No primary key was specified.\n\n Example:\n\n table do\n primary_key id : Int64\n ...\n end\n ERROR\n %}\n {% end %}\n\n \n"}},{"html_id":"view(view_name=nil)-macro","name":"view","abstract":false,"args":[{"name":"view_name","default_value":"nil","external_name":"view_name","restriction":""}],"args_string":"(view_name = nil)","args_html":"(view_name = nil)","location":{"filename":"src/avram/model.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L81"},"def":{"name":"view","args":[{"name":"view_name","default_value":"nil","external_name":"view_name","restriction":""}],"visibility":"Public","body":" \n{{ yield }}\n\n\n validate_columns(\"view\")\n \n{% if view_name %}\n class_getter table_name : String = {{ view_name.id.stringify }}\n {% else %}\n class_getter table_name : String = Avram::TableFor.table_for({{ @type.id }})\n {% end %}\n\n setup(Avram::Model.setup_initialize)\n setup(Avram::Model.setup_db_mapping)\n setup(Avram::Model.setup_getters)\n setup(Avram::Model.setup_column_info_methods)\n setup(Avram::Model.setup_association_queries)\n setup(Avram::Model.setup_view_schema_enforcer_validations)\n setup(Avram::BaseQueryTemplate.setup)\n setup(Avram::SchemaEnforcer.setup)\n \n"}}],"types":[{"html_id":"avram/Avram/Model/JSONConverter","path":"Avram/Model/JSONConverter.html","kind":"module","full_name":"Avram::Model::JSONConverter(T)","name":"JSONConverter","abstract":false,"locations":[{"filename":"src/avram/model.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L11"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"},"class_methods":[{"html_id":"from_rs(rs:DB::ResultSet)-class-method","name":"from_rs","abstract":false,"args":[{"name":"rs","external_name":"rs","restriction":"DB::ResultSet"}],"args_string":"(rs : DB::ResultSet)","args_html":"(rs : DB::ResultSet)","location":{"filename":"src/avram/model.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/model.cr#L12"},"def":{"name":"from_rs","args":[{"name":"rs","external_name":"rs","restriction":"DB::ResultSet"}],"visibility":"Public","body":"value = rs.read(::Union(JSON::PullParser, ::Nil))\nif value\n T.new(value)\nend\n"}}]}]},{"html_id":"avram/Avram/NeedyInitializer","path":"Avram/NeedyInitializer.html","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer","abstract":false,"locations":[{"filename":"src/avram/needy_initializer.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L68"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializers-macro","name":"generate_initializers","abstract":false,"location":{"filename":"src/avram/needy_initializer.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L37"},"def":{"name":"generate_initializers","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L15"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# This is called at the end so @type will be of the subclass,\n\n \n# and not the parent abstract class.\n\n generate_initializers\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n property \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n \n"}}]},{"html_id":"avram/Avram/NeedyInitializerAndDeleteMethods","path":"Avram/NeedyInitializerAndDeleteMethods.html","kind":"module","full_name":"Avram::NeedyInitializerAndDeleteMethods","name":"NeedyInitializerAndDeleteMethods","abstract":false,"locations":[{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_delete(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_delete","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":94,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L94"},"def":{"name":"generate_delete","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.delete\n{% if with_bang %}!{% end %}\n(\n record : T,\n params : Hash,\n **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:delete\n{% if with_bang %}!{% end %}\n, additional_args: \"record, \")\n \nend\n\n def self.delete\n{% if with_bang %}!{% end %}\n(\n record : T,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n record,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.delete!\n {% else %}\n operation.delete\n yield operation, operation.record\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_delete_methods(attribute_method_args,attribute_params)-macro","name":"generate_delete_methods","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L133"},"def":{"name":"generate_delete_methods","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_delete(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n \n"}},{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":140,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L140"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @record : T,\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @record : T,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \nextract_changes_from_params\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n unless {{ attribute[:name] }}.is_a? Avram::Nothing\n self.{{ attribute[:name] }}.value = {{ attribute[:name] }}\n end\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer_and_delete_methods-macro","name":"generate_initializer_and_delete_methods","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L37"},"def":{"name":"generate_initializer_and_delete_methods","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# These method arguments can be used in macros for generating delete/new\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute[:name]} : #{attribute[:type]} | Avram::Nothing\" %}\n {% if attribute[:nilable] %}{% attribute_method_args = attribute_method_args + \" | Nil\" %}{% end %}\n {% attribute_method_args = attribute_method_args + \" = Avram::Nothing.new,\\n\" %}\n\n {% attribute_params = attribute_params + \"#{attribute[:name]}: #{attribute[:name]},\\n\" %}\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n generate_delete_methods(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"hash_is_not_allowed_helpful_error(method,additional_args=nil)-macro","name":"hash_is_not_allowed_helpful_error","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"args_string":"(method, additional_args = nil)","args_html":"(method, additional_args = nil)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":81,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L81"},"def":{"name":"hash_is_not_allowed_helpful_error","args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"visibility":"Public","body":" \n{% raise(\"You can't pass a Hash directly to #{method.id}. Instead pass named arguments, or convert the hash to params.\\n\\nTry this...\\n\\n * Use named arguments (recommended) - #{@type}.#{method.id}(#{if additional_args\n additional_args.id\nend}title: \\\"My Title\\\")\\n * Convert hash to params (not as safe) - Avram::Params.new({\\\"title\\\" => \\\"My Title\\\"})\\n\") %}\n\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L15"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# This is called at the end so @type will be of the subclass,\n\n \n# and not the parent abstract class.\n\n generate_initializer_and_delete_methods\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer_and_delete_methods.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_delete_methods.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n property \n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n \n"}}]},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","path":"Avram/NeedyInitializerAndSaveMethods.html","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods","abstract":false,"locations":[{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"generate_create(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_create","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":96,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L96"},"def":{"name":"generate_create","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.create\n{% if with_bang %}!{% end %}\n(\n params : Hash, **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:create\n{% if with_bang %}!{% end %}\n)\n \nend\n\n def self.create\n{% if with_bang %}!{% end %}\n(\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.save!\n {% else %}\n if operation.save\n yield operation, operation.record\n else\n yield operation, nil\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer(attribute_method_args,attribute_params)-macro","name":"generate_initializer","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":185,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L185"},"def":{"name":"generate_initializer","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" \n{% needs_method_args = \"\" %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {% needs_method_args = needs_method_args + \"@#{type_declaration},\\n\" %}\n {% end %}\n\n\n def initialize(\n @record : T,\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @params : Avram::Paramable,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @record = nil\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n @record : T,\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def initialize(\n \n{{ needs_method_args.id }}\n\n \n{{ attribute_method_args.id }}\n\n )\n @record = nil\n @params = Avram::Params.new\n set_attributes(\n{{ attribute_params.id }}\n)\n \nend\n\n def set_attributes(\n{{ attribute_method_args.id }}\n)\n \nextract_changes_from_params\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n unless {{ attribute[:name] }}.is_a? Avram::Nothing\n self.{{ attribute[:name] }}.value = {{ attribute[:name] }}\n end\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES %}\n unless {{ attribute.var }}.is_a? Avram::Nothing\n self.{{ attribute.var }}.value = {{ attribute.var }}\n end\n {% end %}\n\n \nend\n \n"}},{"html_id":"generate_initializer_and_save_methods-macro","name":"generate_initializer_and_save_methods","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L39"},"def":{"name":"generate_initializer_and_save_methods","visibility":"Public","body":" \n# Build up a list of method arguments\n\n \n#\n\n \n# These method arguments can be used in macros fro generating create/update/new\n\n \n#\n\n \n# This way everything has a name and type and we don't have to rely on\n\n \n# **named_args. **named_args** are easy but you get horrible type errors.\n\n \n#\n\n \n# attribute_method_args would look something like:\n\n \n#\n\n \n# name : String | Avram::Nothing = Avram::Nothing.new,\n\n \n# email : String | Nil | Avram::Nothing = Avram::Nothing.new\n\n \n#\n\n \n# This can be passed to macros as a string, and then the macro can call .id\n\n \n# on it to output the string as code!\n\n \n{% attribute_method_args = \"\" %}\n\n\n \n# Build up a list of params so you can use the method args\n\n \n#\n\n \n# This looks something like:\n\n \n#\n\n \n# name: name,\n\n \n# email: email\n\n \n{% attribute_params = \"\" %}\n\n\n \n{% if @type.constant(:COLUMN_ATTRIBUTES) %}\n {% for attribute in COLUMN_ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute[:name]} : #{attribute[:type]} | Avram::Nothing\" %}\n {% if attribute[:nilable] %}{% attribute_method_args = attribute_method_args + \" | Nil\" %}{% end %}\n {% attribute_method_args = attribute_method_args + \" = Avram::Nothing.new,\\n\" %}\n\n {% attribute_params = attribute_params + \"#{attribute[:name]}: #{attribute[:name]},\\n\" %}\n {% end %}\n {% end %}\n\n\n \n{% for attribute in ATTRIBUTES.uniq %}\n {% attribute_method_args = attribute_method_args + \"#{attribute.var} : #{attribute.type} | Avram::Nothing = Avram::Nothing.new,\\n\" %}\n {% attribute_params = attribute_params + \"#{attribute.var}: #{attribute.var},\\n\" %}\n {% end %}\n\n\n generate_initializer(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n generate_save_methods(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n)\n \n"}},{"html_id":"generate_save_methods(attribute_method_args,attribute_params)-macro","name":"generate_save_methods","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"args_string":"(attribute_method_args, attribute_params)","args_html":"(attribute_method_args, attribute_params)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":173,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L173"},"def":{"name":"generate_save_methods","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""}],"visibility":"Public","body":" generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_create(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: false)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: true, with_bang: true)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: true)\n generate_update(\n{{ attribute_method_args }}\n, \n{{ attribute_params }}\n, with_params: false, with_bang: false)\n \n"}},{"html_id":"generate_update(attribute_method_args,attribute_params,with_params,with_bang)-macro","name":"generate_update","abstract":false,"args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"args_string":"(attribute_method_args, attribute_params, with_params, with_bang)","args_html":"(attribute_method_args, attribute_params, with_params, with_bang)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":134,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L134"},"def":{"name":"generate_update","args":[{"name":"attribute_method_args","external_name":"attribute_method_args","restriction":""},{"name":"attribute_params","external_name":"attribute_params","restriction":""},{"name":"with_params","external_name":"with_params","restriction":""},{"name":"with_bang","external_name":"with_bang","restriction":""}],"visibility":"Public","body":" def self.update\n{% if with_bang %}!{% end %}\n(\n record : T,\n params : Hash,\n **named_args\n )\n \n{% if with_bang %}\n {% else %}\n yield nil, nil\n {% end %}\n\n hash_is_not_allowed_helpful_error(:update\n{% if with_bang %}!{% end %}\n, additional_args: \"record, \")\n \nend\n\n def self.update\n{% if with_bang %}!{% end %}\n(\n record : T,\n \n{% if with_params %}with params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration }},\n {% end %}\n\n \n{{ attribute_method_args.id }}\n\n )\n operation = new(\n record,\n \n{% if with_params %}params,{% end %}\n\n \n{% for type_declaration in OPERATION_NEEDS %}\n {{ type_declaration.var }},\n {% end %}\n\n \n{{ attribute_params.id }}\n\n )\n\n \n{% if with_bang %}\n operation.update!\n {% else %}\n operation.save\n yield operation, operation.record.not_nil!\n {% end %}\n\n \nend\n \n"}},{"html_id":"hash_is_not_allowed_helpful_error(method,additional_args=nil)-macro","name":"hash_is_not_allowed_helpful_error","abstract":false,"args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"args_string":"(method, additional_args = nil)","args_html":"(method, additional_args = nil)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":83,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L83"},"def":{"name":"hash_is_not_allowed_helpful_error","args":[{"name":"method","external_name":"method","restriction":""},{"name":"additional_args","default_value":"nil","external_name":"additional_args","restriction":""}],"visibility":"Public","body":" \n{% raise(\"You can't pass a Hash directly to #{method.id}. Instead pass named arguments, or convert the hash to params.\\n\\nTry this...\\n\\n * Use named arguments (recommended) - #{@type}.#{method.id}(#{if additional_args\n additional_args.id\nend}title: \\\"My Title\\\")\\n * Convert hash to params (not as safe) - Avram::Params.new({\\\"title\\\" => [\\\"My Title\\\"]})\\n\") %}\n\n \n"}},{"html_id":"inherit_needs-macro","name":"inherit_needs","abstract":false,"location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L16"},"def":{"name":"inherit_needs","visibility":"Public","body":" \n\\{% if\n !@type.constant(:OPERATION_NEEDS) %}\n OPERATION_NEEDS = [] of Nil\n \n\\{% end\n %}\n\n \n\\{% if\n !@type.ancestors.first.abstract? %}\n \n\\{% for\n type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}\n \n\\{% \nOPERATION_NEEDS << type_declaration %}\n \n\\{% end\n %}\n \n\\{% end\n %}\n\n macro inherited\n inherit_needs\n \nend\n\n macro finished\n \n# @type is not correct in this method, but is in the macro we call below\n\n \n# That is why this extrac macro was extracted. We need @type to get the\n\n \n# attributes for this SaveOperation\n\n generate_initializer_and_save_methods\n \nend\n \n"}},{"html_id":"needs(type_declaration)-macro","name":"needs","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/needy_initializer_and_save_methods.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/needy_initializer_and_save_methods.cr#L10"},"def":{"name":"needs","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% OPERATION_NEEDS << type_declaration %}\n\n @\n{{ type_declaration.var }}\n : \n{{ type_declaration.type }}\n\n property \n{{ type_declaration.var }}\n\n \n"}}]},{"html_id":"avram/Avram/NestedSaveOperation","path":"Avram/NestedSaveOperation.html","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation","abstract":false,"locations":[{"filename":"src/avram/nested_save_operation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nested_save_operation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"mark_nested_save_operations_as_failed-instance-method","name":"mark_nested_save_operations_as_failed","abstract":false,"location":{"filename":"src/avram/nested_save_operation.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nested_save_operation.cr#L49"},"def":{"name":"mark_nested_save_operations_as_failed","visibility":"Public","body":"nested_save_operations.each do |operation|\n (operation.as(Avram::MarkAsFailed)).mark_as_failed\nend"}},{"html_id":"nested_save_operations-instance-method","name":"nested_save_operations","abstract":false,"location":{"filename":"src/avram/nested_save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nested_save_operation.cr#L55"},"def":{"name":"nested_save_operations","visibility":"Public","body":"[] of Avram::MarkAsFailed"}}],"macros":[{"html_id":"has_one(type_declaration)-macro","name":"has_one","abstract":false,"args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"args_string":"(type_declaration)","args_html":"(type_declaration)","location":{"filename":"src/avram/nested_save_operation.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nested_save_operation.cr#L2"},"def":{"name":"has_one","args":[{"name":"type_declaration","external_name":"type_declaration","restriction":""}],"visibility":"Public","body":" \n{% name = type_declaration.var %}\n\n \n{% type = type_declaration.type.resolve %}\n\n\n \n{% model_type = type.ancestors.find do |t|\n t.stringify.starts_with?(\"Avram::SaveOperation(\")\nend.type_vars.first %}\n\n\n \n{% assoc = (T.constant(:ASSOCIATIONS)).find do |assoc|\n (assoc[:relationship_type] == (:has_one)) && (assoc[:type].resolve.name == model_type.name)\nend %}\n\n\n \n{% if assoc %}{% else %}\n {% raise(\"#{T} must have a has_one association with #{model_type}\") %}\n {% end %}\n\n\n @_\n{{ name }}\n : \n{{ type }}\n | Nil\n\n after_save save_\n{{ name }}\n\n\n def save_\n{{ name }}\n(saved_record)\n \n{{ name }}\n.\n{{ (@type.constant(:FOREIGN_KEY)).id }}\n.value = saved_record.id\n\n unless \n{{ name }}\n.save\n add_error(:\n{{ name }}\n, \"failed\")\n mark_nested_save_operations_as_failed\n database.rollback\n \nend\n \nend\n\n def \n{{ name }}\n\n @_\n{{ name }}\n ||= if new_record?\n \n{{ type }}\n.new(params)\n \nelse\n \n{{ type }}\n.new(record.not_nil!.\n{{ assoc[:assoc_name].id }}\n!, params)\n \nend\n \nend\n\n def nested_save_operations\n \n{% if @type.methods.map(&.name).includes?((:nested_save_operations).id) %}\n previous_def +\n {% end %}\n\n [\n{{ name }}\n]\n \nend\n \n"}}]},{"html_id":"avram/Avram/Nothing","path":"Avram/Nothing.html","kind":"class","full_name":"Avram::Nothing","name":"Nothing","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/nothing.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/nothing.cr#L5"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"This class is used in various places\nwhere the question of \"Did I not pass in anything or did I pass in nil?\"\nneeds to be answered.\n:nodoc:","summary":"

This class is used in various places where the question of "Did I not pass in anything or did I pass in nil?" needs to be answered.

"},{"html_id":"avram/Avram/Operation","path":"Avram/Operation.html","kind":"class","full_name":"Avram::Operation","name":"Operation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializer","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/operation.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/NeedyInitializer","kind":"module","full_name":"Avram::NeedyInitializer","name":"NeedyInitializer"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L104"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"name.underscore"}},{"html_id":"run(params:Avram::Paramable,*args,**named_args,&)-class-method","name":"run","doc":"Yields the instance of the operation, and the return value from\nthe `run` instance method.\n\n```\nMyOperation.run(params) do |operation, value|\n # operation is complete\nend\n```","summary":"

Yields the instance of the operation, and the return value from the #run instance method.

","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"args_string":"(params : Avram::Paramable, *args, **named_args, &)","args_html":"(params : Avram::Paramable, *args, **named_args, &)","location":{"filename":"src/avram/operation.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L52"},"def":{"name":"run","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"yields":2,"block_arity":2,"visibility":"Public","body":"operation = self.new(params, *args, **named_args)\nvalue = nil\noperation.before_run\nif operation.valid?\n value = operation.run\n operation.after_run(value)\nend\nyield operation, value\n"}},{"html_id":"run(*args,**named_args,&)-class-method","name":"run","doc":"Yields the instance of the operation, and the return value from\nthe `run` instance method.\n\n```\nMyOperation.run do |operation, value|\n # operation is complete\nend\n```","summary":"

Yields the instance of the operation, and the return value from the #run instance method.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args, &)","args_html":"(*args, **named_args, &)","location":{"filename":"src/avram/operation.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L26"},"def":{"name":"run","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"yields":2,"block_arity":2,"visibility":"Public","body":"params = Avram::Params.new\nrun(params, *args, **named_args) do |operation, value|\n yield operation, value\nend\n"}},{"html_id":"run!(params:Avram::Paramable,*args,**named_args)-class-method","name":"run!","doc":"Returns the value from the `run` instance method.\nor raise `Avram::FailedOperation` if the operation fails.\n\n```\nvalue = MyOperation.run!(params)\n```","summary":"

Returns the value from the #run instance method.

","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"args_string":"(params : Avram::Paramable, *args, **named_args)","args_html":"(params : Avram::Paramable, *args, **named_args)","location":{"filename":"src/avram/operation.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L72"},"def":{"name":"run!","args":[{"name":"params","external_name":"params","restriction":"Avram::Paramable"},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":"run(params, *args, **named_args) do |_operation, value|\n if value\n else\n raise(Avram::FailedOperation.new(\"The operation failed to return a value\"))\n end\n value\nend"}},{"html_id":"run!(*args,**named_args)-class-method","name":"run!","doc":"Returns the value from the `run` instance method.\nor raise `Avram::FailedOperation` if the operation fails.\n\n```\nvalue = MyOperation.run!\n```","summary":"

Returns the value from the #run instance method.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/operation.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L39"},"def":{"name":"run!","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"params = Avram::Params.new\nrun!(params, *args, **named_args)\n"}}],"constructors":[{"html_id":"new(params:Avram::Paramable)-class-method","name":"new","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/operation.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L87"},"def":{"name":"new","args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"visibility":"Public","body":"_ = allocate\n_.initialize(params)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L90"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"after_run(_value)-instance-method","name":"after_run","abstract":false,"args":[{"name":"_value","external_name":"_value","restriction":""}],"args_string":"(_value)","args_html":"(_value)","location":{"filename":"src/avram/operation.cr","line_number":84,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L84"},"def":{"name":"after_run","args":[{"name":"_value","external_name":"_value","restriction":""}],"visibility":"Public","body":""}},{"html_id":"before_run-instance-method","name":"before_run","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L79"},"def":{"name":"before_run","visibility":"Public","body":""}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"params:Avram::Paramable-instance-method","name":"params","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L16"},"def":{"name":"params","return_type":"Avram::Paramable","visibility":"Public","body":"@params"}},{"html_id":"run-instance-method","name":"run","abstract":true,"location":{"filename":"src/avram/operation.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L82"},"def":{"name":"run","visibility":"Public","body":""}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/operation.cr","line_number":99,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation.cr#L99"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/OperationErrors","path":"Avram/OperationErrors.html","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors","abstract":false,"locations":[{"filename":"src/avram/operation_errors.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation_errors.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"add_error(key:Symbol,message:String):Nil-instance-method","name":"add_error","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"Symbol"},{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(key : Symbol, message : String) : Nil","args_html":"(key : Symbol, message : String) : Nil","location":{"filename":"src/avram/operation_errors.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation_errors.cr#L19"},"def":{"name":"add_error","args":[{"name":"key","external_name":"key","restriction":"Symbol"},{"name":"message","external_name":"message","restriction":"String"}],"return_type":"Nil","visibility":"Public","body":"__temp_89 = key\n@custom_errors[__temp_89]? || (@custom_errors[__temp_89] = [] of String)\n@custom_errors[key].push(message)\n"}},{"html_id":"errors:Hash(Symbol,Array(String))-instance-method","name":"errors","abstract":false,"location":{"filename":"src/avram/operation_errors.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/operation_errors.cr#L6"},"def":{"name":"errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"attr_errors = attributes.reduce({} of Symbol => Array(String)) do |errors_hash, attribute|\n if attribute.errors.empty?\n errors_hash\n else\n errors_hash[attribute.name] = attribute.errors\n errors_hash\n end\nend\nattr_errors.merge(@custom_errors)\n"}}]},{"html_id":"avram/Avram/OrderBy","path":"Avram/OrderBy.html","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy","abstract":false,"superclass":{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},"ancestors":[{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(column:String|Symbol,direction:Direction,nulls:NullSorting=:default)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"String | Symbol"},{"name":"direction","external_name":"direction","restriction":"Direction"},{"name":"nulls","default_value":":default","external_name":"nulls","restriction":"NullSorting"}],"args_string":"(column : String | Symbol, direction : Direction, nulls : NullSorting = :default)","args_html":"(column : String | Symbol, direction : Direction, nulls : NullSorting = :default)","location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L24"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":"String | Symbol"},{"name":"direction","external_name":"direction","restriction":"Direction"},{"name":"nulls","default_value":":default","external_name":"nulls","restriction":"NullSorting"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column, direction, nulls)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L18"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L20"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":"@column"}},{"html_id":"direction:Avram::OrderBy::Direction-instance-method","name":"direction","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L21"},"def":{"name":"direction","visibility":"Public","body":"@direction"}},{"html_id":"nulls:Avram::OrderBy::NullSorting-instance-method","name":"nulls","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L22"},"def":{"name":"nulls","visibility":"Public","body":"@nulls"}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L31"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":"String.build do |str|\n str << \"#{column} #{direction}\"\n if nulls.default?\n else\n str << \" #{nulls}\"\n end\nend"}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L38"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":"@direction = @direction.asc? ? Direction::DESC : Direction::ASC\nself\n"}}],"types":[{"html_id":"avram/Avram/OrderBy/Direction","path":"Avram/OrderBy/Direction.html","kind":"enum","full_name":"Avram::OrderBy::Direction","name":"Direction","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L13"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"ASC","name":"ASC","value":"0"},{"id":"DESC","name":"DESC","value":"1"}],"namespace":{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},"instance_methods":[{"html_id":"asc?-instance-method","name":"asc?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L14"},"def":{"name":"asc?","visibility":"Public","body":"self == ASC"}},{"html_id":"desc?-instance-method","name":"desc?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L15"},"def":{"name":"desc?","visibility":"Public","body":"self == DESC"}}]},{"html_id":"avram/Avram/OrderBy/NullSorting","path":"Avram/OrderBy/NullSorting.html","kind":"enum","full_name":"Avram::OrderBy::NullSorting","name":"NullSorting","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L3"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"DEFAULT","name":"DEFAULT","value":"0"},{"id":"NULLS_FIRST","name":"NULLS_FIRST","value":"1"},{"id":"NULLS_LAST","name":"NULLS_LAST","value":"2"}],"namespace":{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},"instance_methods":[{"html_id":"default?-instance-method","name":"default?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L4"},"def":{"name":"default?","visibility":"Public","body":"self == DEFAULT"}},{"html_id":"nulls_first?-instance-method","name":"nulls_first?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L5"},"def":{"name":"nulls_first?","visibility":"Public","body":"self == NULLS_FIRST"}},{"html_id":"nulls_last?-instance-method","name":"nulls_last?","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L6"},"def":{"name":"nulls_last?","visibility":"Public","body":"self == NULLS_LAST"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"Returns a `String` representation of this enum member.\nIn the case of regular enums, this is just the name of the member.\nIn the case of flag enums, it's the names joined by vertical bars, or \"None\",\nif the value is zero.\n\nIf an enum's value doesn't match a member's value, the raw value\nis returned as a string.\n\n```\nColor::Red.to_s # => \"Red\"\nIOMode::None.to_s # => \"None\"\n(IOMode::Read | IOMode::Write).to_s # => \"Read | Write\"\n\nColor.new(10).to_s # => \"10\"\n```","summary":"

Returns a String representation of this enum member.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by.cr#L8"},"def":{"name":"to_s","visibility":"Public","body":"super().gsub(\"_\", \" \")"}}]}]},{"html_id":"avram/Avram/OrderByClause","path":"Avram/OrderByClause.html","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/OrderBy","kind":"class","full_name":"Avram::OrderBy","name":"OrderBy"},{"html_id":"avram/Avram/OrderByRandom","kind":"class","full_name":"Avram::OrderByRandom","name":"OrderByRandom"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L3"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":""}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L4"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":""}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":true,"location":{"filename":"src/avram/order_by_clause.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause.cr#L5"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/OrderByRandom","path":"Avram/OrderByRandom.html","kind":"class","full_name":"Avram::OrderByRandom","name":"OrderByRandom","abstract":false,"superclass":{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},"ancestors":[{"html_id":"avram/Avram/OrderByClause","kind":"class","full_name":"Avram::OrderByClause","name":"OrderByClause"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L3"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"column:String|Symbol-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L5"},"def":{"name":"column","return_type":"String | Symbol","visibility":"Public","body":"@column"}},{"html_id":"prepare:String-instance-method","name":"prepare","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L7"},"def":{"name":"prepare","return_type":"String","visibility":"Public","body":"\"RANDOM ()\""}},{"html_id":"reversed:self-instance-method","name":"reversed","abstract":false,"location":{"filename":"src/avram/order_by_clause/order_by_random.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/order_by_clause/order_by_random.cr#L11"},"def":{"name":"reversed","return_type":"self","visibility":"Public","body":"self"}}]},{"html_id":"avram/Avram/Paramable","path":"Avram/Paramable.html","kind":"module","full_name":"Avram::Paramable","name":"Paramable","abstract":false,"locations":[{"filename":"src/avram/paramable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Params","kind":"class","full_name":"Avram::Params","name":"Params"},{"html_id":"avram/Lucky/Params","kind":"class","full_name":"Lucky::Params","name":"Params"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"get(key:String)-instance-method","name":"get","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L9"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get?(key:String)-instance-method","name":"get?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L8"},"def":{"name":"get?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get_all(key:String)-instance-method","name":"get_all","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L11"},"def":{"name":"get_all","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"get_all?(key:String)-instance-method","name":"get_all?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/paramable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L10"},"def":{"name":"get_all?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":""}},{"html_id":"has_key_for?(operation:Avram::Operation.class|Avram::SaveOperation.class):Bool-instance-method","name":"has_key_for?","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":"Avram::Operation.class | Avram::SaveOperation.class"}],"args_string":"(operation : Avram::Operation.class | Avram::SaveOperation.class) : Bool","args_html":"(operation : Avram::Operation.class | Avram::SaveOperation.class) : Bool","location":{"filename":"src/avram/paramable.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L13"},"def":{"name":"has_key_for?","args":[{"name":"operation","external_name":"operation","restriction":"Avram::Operation.class | Avram::SaveOperation.class"}],"return_type":"Bool","visibility":"Public","body":"!(nested?(operation.param_key)).empty?"}},{"html_id":"many_nested(key:String):Array(Hash(String,String))-instance-method","name":"many_nested","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/paramable.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L7"},"def":{"name":"many_nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":""}},{"html_id":"many_nested?(key:String):Array(Hash(String,String))-instance-method","name":"many_nested?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/paramable.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L6"},"def":{"name":"many_nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":""}},{"html_id":"nested(key:String):Hash(String,String)-instance-method","name":"nested","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/paramable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L3"},"def":{"name":"nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":""}},{"html_id":"nested?(key:String):Hash(String,String)-instance-method","name":"nested?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/paramable.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L2"},"def":{"name":"nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":""}},{"html_id":"nested_arrays(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/paramable.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L5"},"def":{"name":"nested_arrays","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":""}},{"html_id":"nested_arrays?(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays?","abstract":true,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/paramable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/paramable.cr#L4"},"def":{"name":"nested_arrays?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/ParamKeyOverride","path":"Avram/ParamKeyOverride.html","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride","abstract":false,"locations":[{"filename":"src/avram/param_key_override.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/param_key_override.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"define_param_key_override-macro","name":"define_param_key_override","abstract":false,"location":{"filename":"src/avram/param_key_override.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/param_key_override.cr#L10"},"def":{"name":"define_param_key_override","visibility":"Public","body":" macro param_key(key)\n def self.param_key : String\n \n\\{\n{ key.id.stringify }}\n \nend\n \nend\n \n"}}]},{"html_id":"avram/Avram/Params","path":"Avram/Params.html","kind":"class","full_name":"Avram::Params","name":"Params","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/Paramable","kind":"module","full_name":"Avram::Paramable","name":"Paramable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/params.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Paramable","kind":"module","full_name":"Avram::Paramable","name":"Paramable"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(hash:Hash(String,Array(String)|String)|Hash(String,Array(String))|Hash(String,String))-class-method","name":"new","abstract":false,"args":[{"name":"hash","external_name":"hash","restriction":"::Hash(::String, ::Array(::String) | ::String) | ::Hash(::String, ::Array(::String)) | ::Hash(::String, ::String)"}],"args_string":"(hash : Hash(String, Array(String) | String) | Hash(String, Array(String)) | Hash(String, String))","args_html":"(hash : Hash(String, Array(String) | String) | Hash(String, Array(String)) | Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L12"},"def":{"name":"new","args":[{"name":"hash","external_name":"hash","restriction":"::Hash(::String, ::Array(::String) | ::String) | ::Hash(::String, ::Array(::String)) | ::Hash(::String, ::String)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(hash)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/params.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L8"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"get(key:String)-instance-method","name":"get","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L51"},"def":{"name":"get","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"(get?(key)).not_nil!"}},{"html_id":"get?(key:String)-instance-method","name":"get?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L47"},"def":{"name":"get?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"@hash[key]?.try do |value|\n if value.is_a?(String)\n value\n end\nend"}},{"html_id":"get_all(key:String)-instance-method","name":"get_all","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L59"},"def":{"name":"get_all","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"(get_all?(key)).not_nil!"}},{"html_id":"get_all?(key:String)-instance-method","name":"get_all?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L55"},"def":{"name":"get_all?","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"@hash[key]?.try do |value|\n if value.is_a?(Array)\n value\n end\nend"}},{"html_id":"get_all_files(key:String)-instance-method","name":"get_all_files","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String)","args_html":"(key : String)","location":{"filename":"src/avram/params.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L71"},"def":{"name":"get_all_files","args":[{"name":"key","external_name":"key","restriction":"String"}],"visibility":"Public","body":"get_all(key)"}},{"html_id":"many_nested(key:String):Array(Hash(String,String))-instance-method","name":"many_nested","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L43"},"def":{"name":"many_nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":"[nested(key)]"}},{"html_id":"many_nested?(key:String):Array(Hash(String,String))-instance-method","name":"many_nested?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Array(Hash(String, String))","args_html":"(key : String) : Array(Hash(String, String))","location":{"filename":"src/avram/params.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L39"},"def":{"name":"many_nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Array(Hash(String, String))","visibility":"Public","body":"many_nested(key)"}},{"html_id":"nested(key:String):Hash(String,String)-instance-method","name":"nested","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L19"},"def":{"name":"nested","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"Hash(String, String).new.tap do |params|\n @hash.each do |_key, _value|\n if _value.is_a?(String)\n params[_key] = _value\n end\n end\nend"}},{"html_id":"nested?(key:String):Hash(String,String)-instance-method","name":"nested?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L15"},"def":{"name":"nested?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested(key)"}},{"html_id":"nested_arrays(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/params.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L31"},"def":{"name":"nested_arrays","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":"Hash(String, Array(String)).new.tap do |params|\n @hash.each do |_key, _value|\n if _value.is_a?(Array)\n params[_key] = _value\n end\n end\nend"}},{"html_id":"nested_arrays?(key:String):Hash(String,Array(String))-instance-method","name":"nested_arrays?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, Array(String))","args_html":"(key : String) : Hash(String, Array(String))","location":{"filename":"src/avram/params.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L27"},"def":{"name":"nested_arrays?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, Array(String))","visibility":"Public","body":"nested_arrays(key)"}},{"html_id":"nested_file(key:String):Hash(String,String)-instance-method","name":"nested_file","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L67"},"def":{"name":"nested_file","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested(key)"}},{"html_id":"nested_file?(key:String):Hash(String,String)-instance-method","name":"nested_file?","abstract":false,"args":[{"name":"key","external_name":"key","restriction":"String"}],"args_string":"(key : String) : Hash(String, String)","args_html":"(key : String) : Hash(String, String)","location":{"filename":"src/avram/params.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/params.cr#L63"},"def":{"name":"nested_file?","args":[{"name":"key","external_name":"key","restriction":"String"}],"return_type":"Hash(String, String)","visibility":"Public","body":"nested?(key)"}}]},{"html_id":"avram/Avram/PermittedAttribute","path":"Avram/PermittedAttribute.html","kind":"class","full_name":"Avram::PermittedAttribute(T)","name":"PermittedAttribute","abstract":false,"superclass":{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute","name":"Attribute"},"ancestors":[{"html_id":"avram/Avram/Attribute","kind":"class","full_name":"Avram::Attribute","name":"Attribute"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/permitted_attribute.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/permitted_attribute.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(name,value:T|Nil,param_key,param=nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":""},{"name":"param","default_value":"nil","external_name":"param","restriction":""}],"args_string":"(name, value : T | Nil, param_key, param = nil)","args_html":"(name, value : T | Nil, param_key, param = nil)","location":{"filename":"src/avram/attribute.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/attribute.cr#L13"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":""},{"name":"value","external_name":"value","restriction":"T | ::Nil"},{"name":"param_key","external_name":"param_key","restriction":""},{"name":"param","default_value":"nil","external_name":"param","restriction":""}],"visibility":"Public","body":"_ = PermittedAttribute(T).allocate\n_.initialize(name, value, param_key, param)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/PGClientNotInstalledError","path":"Avram/PGClientNotInstalledError.html","kind":"class","full_name":"Avram::PGClientNotInstalledError","name":"PGClientNotInstalledError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":105,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L105"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(original_message:String)-class-method","name":"new","abstract":false,"args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"args_string":"(original_message : String)","args_html":"(original_message : String)","location":{"filename":"src/avram/errors.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L106"},"def":{"name":"new","args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(original_message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/PGNotRunningError","path":"Avram/PGNotRunningError.html","kind":"class","full_name":"Avram::PGNotRunningError","name":"PGNotRunningError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L131"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(original_message:String)-class-method","name":"new","abstract":false,"args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"args_string":"(original_message : String)","args_html":"(original_message : String)","location":{"filename":"src/avram/errors.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L132"},"def":{"name":"new","args":[{"name":"original_message","external_name":"original_message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(original_message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Polymorphic","path":"Avram/Polymorphic.html","kind":"module","full_name":"Avram::Polymorphic","name":"Polymorphic","abstract":false,"locations":[{"filename":"src/avram/polymorphic.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/polymorphic.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Helpers for defining polymorphic associations","summary":"

Helpers for defining polymorphic associations

","macros":[{"html_id":"polymorphic(polymorphic_name,associations,optional=false)-macro","name":"polymorphic","doc":"# Save a comment for this video\nvideo = VideoQuery.first\nComment::SaveOperation.create!(video_id: video.id)\n```","summary":"

\n \n \nSave a comment for this video video = VideoQuery.first Comment::SaveOperation.create!(video_id: video.id) ```

","abstract":false,"args":[{"name":"polymorphic_name","external_name":"polymorphic_name","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"optional","default_value":"false","external_name":"optional","restriction":""}],"args_string":"(polymorphic_name, associations, optional = false)","args_html":"(polymorphic_name, associations, optional = false)","location":{"filename":"src/avram/polymorphic.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/polymorphic.cr#L104"},"def":{"name":"polymorphic","args":[{"name":"polymorphic_name","external_name":"polymorphic_name","restriction":""},{"name":"associations","external_name":"associations","restriction":""},{"name":"optional","default_value":"false","external_name":"optional","restriction":""}],"visibility":"Public","body":" \n{% polymorphic_name = polymorphic_name.id %}\n\n def \n{{ polymorphic_name }}\n\n \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable!\n\n \n# Generates something like: post || video\n\n \n{{ (associations.map(&.id).join(\" || \")).id }}\n{% if !optional %} || Avram::Polymorphic.raise_missing_polymorphic(:{{ polymorphic_name }}, self){% end %}\n\n \nend\n\n def \n{{ polymorphic_name }}\n!\n \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable!\n\n \n# Generates something like: post! || video!\n\n \n{% associations_with_a_bang = associations.map(&.id).map do |assoc|\n \"#{assoc}!\"\nend %}\n\n \n{{ (associations_with_a_bang.join(\" || \")).id }}\n{% if !optional %} || Avram::Polymorphic.raise_missing_polymorphic(:{{ polymorphic_name }}, self){% end %}\n\n \nend\n\n private def \nensure_\n{{ polymorphic_name }}\n_belongs_to_are_nilable! : Nil\n if should_check_polymorphism_at_runtime?\n \n{% associations_to_check = associations.map(&.id).map do |assoc|\n \"#{assoc}.as(Nil)\"\nend %}\n\n \n{{ (associations_to_check.join(\" || \")).id }}\n \n# Ensure polymorphic associations are nilable\n\n \nend\n \nend\n\n \n# This is a bit of a hack to get around Crystal's smart compiler :)\n\n \n# In the ensure_\n{assoc}_belongs_to_are_nilable! we need to check that the\n\n \n# compiler *can* cast to nil, but we don't want to *actually* check it at\n\n \n# runtime. The problem is that we can't do `if false` because Crystal realizes\n\n \n# That will never match and so doesn't even check the `as(Nil)`\n\n \n# We have to trick it by extracting the false to a method. That way\n\n \n# Crystal doesn't realize it is always 'false' and will still check\n\n \n# That the types can be cast to Nil at compile, without actually casting it\n\n \n# at runtime.\n\n private def should_check_polymorphism_at_runtime? : Bool\n false\n \nend\n\n macro finished\n class SaveOperation\n \n# These validations must be run after all of the `before_save`\n\n \n# in case anyone sets their polymorphic association in a callback.\n\n \n# These are ran in the SaveOperation#valid? method\n\n default_validations do\n \n{% list_of_foreign_keys = associations.map(&.id).map do |assoc|\n \"#{assoc.id}_id\".id\nend %}\n\n\n \n# TODO: Needs to actually get the foreign key from the ASSOCIATIONS constant\n\n \n{% if optional %}\n validate_at_most_one_filled {{ (list_of_foreign_keys.map(&.id).join(\", \")).id }}\n {% else %}\n validate_exactly_one_filled {{ (list_of_foreign_keys.map(&.id).join(\", \")).id }},\n message: \"at least one '{{ polymorphic_name.id }}' must be filled\"\n {% end %}\n\n \nend\n \nend\n\n class BaseQuery\n def preload_\n{{ polymorphic_name.id }}\n\n \n{% for association in associations %}\n preload_{{ association.id }}\n {% end %}\n\n \nend\n \nend\n \nend\n \n"}}]},{"html_id":"avram/Avram/PrimaryKeyMethods","path":"Avram/PrimaryKeyMethods.html","kind":"module","full_name":"Avram::PrimaryKeyMethods","name":"PrimaryKeyMethods","abstract":false,"locations":[{"filename":"src/avram/primary_key_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/avram/primary_key_methods.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L2"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if id == other.id\nelse\n return false\nend\nif model_name == other.model_name\nelse\n return false\nend\ntrue\n"}},{"html_id":"delete-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":75,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L75"},"def":{"name":"delete","visibility":"Public","body":"self.class.database.exec(\"DELETE FROM #{@@table_name} WHERE #{primary_key_name} = #{escape_primary_key(id)}\")"}},{"html_id":"primary_key_name:Symbol|Nil-instance-method","name":"primary_key_name","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L4"},"def":{"name":"primary_key_name","return_type":"Symbol | ::Nil","visibility":"Public","body":"self.class.primary_key_name"}},{"html_id":"reload:self-instance-method","name":"reload","doc":"Reload the model with the latest information from the database\n\nThis method will return a new model instance with the\nlatest data from the database. Note that this does\n**not** change the original instance, so you may need to\nassign the result to a variable or work directly with the return value.\n\nExample:\n\n```\nuser = SaveUser.create!(name: \"Original\")\nSaveUser.update!(user, name: \"Updated\")\n\n# Will be \"Original\"\nuser.name\n# Will return \"Updated\"\nuser.reload.name # Will be \"Updated\"\n# Will still be \"Original\" since the 'user' is the same model instance.\nuser.name\n\nInstead re-assign the variable. Now 'name' will return \"Updated\" since\n'user' references the reloaded model.\nuser = user.reload\nuser.name\n```","summary":"

Reload the model with the latest information from the database

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L33"},"def":{"name":"reload","return_type":"self","visibility":"Public","body":"base_query_class.find(id)"}},{"html_id":"reload(&):self-instance-method","name":"reload","doc":"Same as `reload` but allows passing a block to customize the query.\n\nThis is almost always used to preload additional relationships.\n\nExample:\n\n```\nuser = SaveUser.create(params)\n\n# We want to display the list of articles the user has commented on, so let's #\n# preload them to avoid N+1 performance issues\nuser = user.reload(&.preload_comments(CommentQuery.new.preload_article))\n\n# Now we can safely get all the comment authors\nuser.comments.map(&.article)\n```\n\nNote that the yielded query is the `BaseQuery` so it will not have any\nmethods defined on your customized query. This is usually fine since\ntypically reload only uses preloads.\n\nIf you do need to do something more custom you can manually reload:\n\n```\nuser = SaveUser.create!(name: \"Helen\")\nUserQuery.new.some_custom_preload_method.find(user.id)\n```","summary":"

Same as #reload but allows passing a block to customize the query.

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L64"},"def":{"name":"reload","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"query = yield base_query_class.new\nquery.find(id)\n"}},{"html_id":"to_param:String-instance-method","name":"to_param","doc":"For integration with Lucky\nThis allows an `Avram::Model` to be passed into a Lucky::Action to create a url/path","summary":"

For integration with Lucky This allows an Avram::Model to be passed into a Lucky::Action to create a url/path

","abstract":false,"location":{"filename":"src/avram/primary_key_methods.cr","line_number":71,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_methods.cr#L71"},"def":{"name":"to_param","return_type":"String","visibility":"Public","body":"id.to_s"}}]},{"html_id":"avram/Avram/PrimaryKeyQueryable","path":"Avram/PrimaryKeyQueryable.html","kind":"module","full_name":"Avram::PrimaryKeyQueryable(T)","name":"PrimaryKeyQueryable","abstract":false,"locations":[{"filename":"src/avram/primary_key_queryable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_queryable.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/PrimaryKeyType","path":"Avram/PrimaryKeyType.html","kind":"enum","full_name":"Avram::PrimaryKeyType","name":"PrimaryKeyType","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/primary_key_type.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_type.cr#L1"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Serial","name":"Serial","value":"0"},{"id":"UUID","name":"UUID","value":"1"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"serial?-instance-method","name":"serial?","abstract":false,"location":{"filename":"src/avram/primary_key_type.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_type.cr#L2"},"def":{"name":"serial?","visibility":"Public","body":"self == Serial"}},{"html_id":"uuid?-instance-method","name":"uuid?","abstract":false,"location":{"filename":"src/avram/primary_key_type.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/primary_key_type.cr#L3"},"def":{"name":"uuid?","visibility":"Public","body":"self == UUID"}}]},{"html_id":"avram/Avram/Queryable","path":"Avram/Queryable.html","kind":"module","full_name":"Avram::Queryable(T)","name":"Queryable","abstract":false,"ancestors":[{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"}],"locations":[{"filename":"src/avram/queryable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"add_preload(&block:Array(T)->Nil)-instance-method","name":"add_preload","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":273,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L273"},"def":{"name":"add_preload","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(Array(T) -> Nil)"},"visibility":"Public","body":"@preloads << block"}},{"html_id":"any?:Bool-instance-method","name":"any?","doc":"Returns `true` if at least one of the collection's members is truthy.\n\n```\n[nil, true, 99].any? # => true\n[nil, false].any? # => false\n```","summary":"

Returns true if at least one of the collection's members is truthy.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":223,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L223"},"def":{"name":"any?","return_type":"Bool","visibility":"Public","body":"cache_store.fetch(cache_key(:\"any?\"), as: Bool) do\n queryable = clone\n new_query = (queryable.query.limit(1)).select(\"1 AS one\")\n results = database.query_one?(new_query.statement, args: new_query.args, queryable: schema_class.name, as: ( Int32 | Int64))\n !results.nil?\nend"}},{"html_id":"cache_key(operation:Symbol):String-instance-method","name":"cache_key","abstract":false,"args":[{"name":"operation","external_name":"operation","restriction":"Symbol"}],"args_string":"(operation : Symbol) : String","args_html":"(operation : Symbol) : String","location":{"filename":"src/avram/queryable.cr","line_number":285,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L285"},"def":{"name":"cache_key","args":[{"name":"operation","external_name":"operation","restriction":"Symbol"}],"return_type":"String","visibility":"Public","body":"[cache_key, operation].join(':')"}},{"html_id":"cache_key:String-instance-method","name":"cache_key","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L281"},"def":{"name":"cache_key","return_type":"String","visibility":"Public","body":"[query.statement, query.args].join(':')"}},{"html_id":"cache_store-instance-method","name":"cache_store","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":277,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L277"},"def":{"name":"cache_store","visibility":"Public","body":"Fiber.current.query_cache"}},{"html_id":"database(*args,**options)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.database(*args, **options)"}},{"html_id":"database(*args,**options,&)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.database(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"delete:Int64-instance-method","name":"delete","doc":"Delete the records using the query's where clauses, or all records if no wheres are added.\n\nReturns the number of deleted records as `Int64`.\n\n```\n# DELETE FROM users WHERE age < 21\nUserQuery.new.age.lt(21).delete\n```","summary":"

Delete the records using the query's where clauses, or all records if no wheres are added.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":104,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L104"},"def":{"name":"delete","return_type":"Int64","visibility":"Public","body":"clone.delete!"}},{"html_id":"distinct:self-instance-method","name":"distinct","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L70"},"def":{"name":"distinct","return_type":"self","visibility":"Public","body":"clone.tap do |__arg0|\n __arg0.query.distinct\nend"}},{"html_id":"distinct_on(&):self-instance-method","name":"distinct_on","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":86,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L86"},"def":{"name":"distinct_on","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_distinct_on\n"}},{"html_id":"each(&)-instance-method","name":"each","doc":"Must yield this collection's elements to the block.","summary":"

Must yield this collection's elements to the block.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":265,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L265"},"def":{"name":"each","yields":1,"block_arity":1,"visibility":"Public","body":"results.each do |result|\n yield result\nend"}},{"html_id":"exec_scalar(&)-instance-method","name":"exec_scalar","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":303,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L303"},"def":{"name":"exec_scalar","yields":1,"block_arity":1,"visibility":"Public","body":"new_query = yield query.clone\ndatabase.scalar(new_query.statement, args: new_query.args, queryable: schema_class.name)\n"}},{"html_id":"first:T-instance-method","name":"first","doc":"Returns the first element in the collection. Raises `Enumerable::EmptyError`\nif the collection is empty.\n\n```\n([1, 2, 3]).first # => 1\n([] of Int32).first # raises Enumerable::EmptyError\n```","summary":"

Returns the first element in the collection.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":206,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L206"},"def":{"name":"first","return_type":"T","visibility":"Public","body":"first? || (raise(RecordNotFoundError.new(model: table_name, query: :first)))"}},{"html_id":"first?:T|Nil-instance-method","name":"first?","doc":"Returns the first element in the collection.\nWhen the collection is empty, returns `nil`.\n\n```\n([1, 2, 3]).first? # => 1\n([] of Int32).first? # => nil\n```","summary":"

Returns the first element in the collection.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":199,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L199"},"def":{"name":"first?","return_type":"T | ::Nil","visibility":"Public","body":"(with_ordered_query.limit(1)).results.first?"}},{"html_id":"group(&):self-instance-method","name":"group","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":182,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L182"},"def":{"name":"group","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_group\n"}},{"html_id":"group_count:Hash(Array(PGValue),Int64)-instance-method","name":"group_count","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":252,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L252"},"def":{"name":"group_count","return_type":"Hash(Array(PGValue), Int64)","visibility":"Public","body":"(database.query_all((query.select_direct(query.groups + [\"COUNT(*)\"])).statement, args: query.args, queryable: schema_class.name) do |rs|\n {query.groups.map do\n rs.read(PGValue)\n end, rs.read(Int64)}\nend).to_h"}},{"html_id":"join(join_clause:Avram::Join::SqlClause):self-instance-method","name":"join","abstract":false,"args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"args_string":"(join_clause : Avram::Join::SqlClause) : self","args_html":"(join_clause : Avram::Join::SqlClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":123,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L123"},"def":{"name":"join","args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg4|\n __arg4.query.join(join_clause)\nend"}},{"html_id":"last:T-instance-method","name":"last","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":219,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L219"},"def":{"name":"last","return_type":"T","visibility":"Public","body":"last? || (raise(RecordNotFoundError.new(model: table_name, query: :last)))"}},{"html_id":"last?:T|Nil-instance-method","name":"last?","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":210,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L210"},"def":{"name":"last?","return_type":"T | ::Nil","visibility":"Public","body":"(with_ordered_query.clone.tap() do |__arg19|\n __arg19.query.reverse_order\nend.limit(1)).results.first?"}},{"html_id":"limit(amount):self-instance-method","name":"limit","abstract":false,"args":[{"name":"amount","external_name":"amount","restriction":""}],"args_string":"(amount) : self","args_html":"(amount) : self","location":{"filename":"src/avram/queryable.cr","line_number":191,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L191"},"def":{"name":"limit","args":[{"name":"amount","external_name":"amount","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg17|\n __arg17.query.limit(amount)\nend"}},{"html_id":"merge_query(query_to_merge:Avram::QueryBuilder):self-instance-method","name":"merge_query","abstract":false,"args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"args_string":"(query_to_merge : Avram::QueryBuilder) : self","args_html":"(query_to_merge : Avram::QueryBuilder) : self","location":{"filename":"src/avram/queryable.cr","line_number":156,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L156"},"def":{"name":"merge_query","args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg12|\n __arg12.query.merge(query_to_merge)\nend"}},{"html_id":"none:self-instance-method","name":"none","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":187,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L187"},"def":{"name":"none","return_type":"self","visibility":"Public","body":"clone.tap do |__arg16|\n __arg16.query.where(Avram::Where::Equal.new(\"1\", \"0\"))\nend"}},{"html_id":"none?:Bool-instance-method","name":"none?","doc":"Returns `true` if all of the elements of the collection are falsey.\n\n```\n[nil, false].none? # => true\n[nil, false, true].none? # => false\n```\n\nIt's the opposite of `all?`.","summary":"

Returns true if all of the elements of the collection are falsey.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":232,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L232"},"def":{"name":"none?","return_type":"Bool","visibility":"Public","body":"!any?"}},{"html_id":"offset(amount):self-instance-method","name":"offset","abstract":false,"args":[{"name":"amount","external_name":"amount","restriction":""}],"args_string":"(amount) : self","args_html":"(amount) : self","location":{"filename":"src/avram/queryable.cr","line_number":195,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L195"},"def":{"name":"offset","args":[{"name":"amount","external_name":"amount","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg18|\n __arg18.query.offset(amount)\nend"}},{"html_id":"or(&):self-instance-method","name":"or","doc":"Run the `or` block first to grab the last WHERE clause and set its\nconjunction to OR. Then call yield to set the next set of ORs","summary":"

Run the #or block first to grab the last WHERE clause and set its conjunction to OR.

","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L162"},"def":{"name":"or","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"query.or(&.itself)\nyield self\n"}},{"html_id":"order_by(column,direction):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"column","external_name":"column","restriction":""},{"name":"direction","external_name":"direction","restriction":""}],"args_string":"(column, direction) : self","args_html":"(column, direction) : self","location":{"filename":"src/avram/queryable.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L167"},"def":{"name":"order_by","args":[{"name":"column","external_name":"column","restriction":""},{"name":"direction","external_name":"direction","restriction":""}],"return_type":"self","visibility":"Public","body":"begin\n direction = Avram::OrderBy::Direction.parse(direction.to_s)\n order_by(Avram::OrderBy.new(column, direction))\nrescue e : ArgumentError\n raise(\"#{e.message}. Accepted values are: :asc, :desc\")\nend"}},{"html_id":"order_by(order:Avram::OrderByClause):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"order","external_name":"order","restriction":"Avram::OrderByClause"}],"args_string":"(order : Avram::OrderByClause) : self","args_html":"(order : Avram::OrderByClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":174,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L174"},"def":{"name":"order_by","args":[{"name":"order","external_name":"order","restriction":"Avram::OrderByClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg14|\n __arg14.query.order_by(order)\nend"}},{"html_id":"preloads-instance-method","name":"preloads","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":271,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L271"},"def":{"name":"preloads","visibility":"Public","body":"@preloads"}},{"html_id":"primary_key_name(*args,**options)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.primary_key_name(*args, **options)"}},{"html_id":"primary_key_name(*args,**options,&)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.primary_key_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"query:Avram::QueryBuilder-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L4"},"def":{"name":"query","return_type":"Avram::QueryBuilder","visibility":"Public","body":"if (value = @query).nil?\n @query = (Avram::QueryBuilder.new(table: table_name).select(schema_class.column_names))\nelse\n value\nend"}},{"html_id":"query=(query:Avram::QueryBuilder)-instance-method","name":"query=","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"Avram::QueryBuilder"}],"args_string":"(query : Avram::QueryBuilder)","args_html":"(query : Avram::QueryBuilder)","location":{"filename":"src/avram/queryable.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L4"},"def":{"name":"query=","args":[{"name":"query","external_name":"query","restriction":"Avram::QueryBuilder"}],"visibility":"Public","body":"@query = query"}},{"html_id":"random_order:self-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":178,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L178"},"def":{"name":"random_order","return_type":"self","visibility":"Public","body":"clone.tap do |__arg15|\n __arg15.query.random_order\nend"}},{"html_id":"reset_limit:self-instance-method","name":"reset_limit","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L78"},"def":{"name":"reset_limit","return_type":"self","visibility":"Public","body":"clone.tap do |__arg2|\n __arg2.query.limit(nil)\nend"}},{"html_id":"reset_offset:self-instance-method","name":"reset_offset","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L82"},"def":{"name":"reset_offset","return_type":"self","visibility":"Public","body":"clone.tap do |__arg3|\n __arg3.query.offset(nil)\nend"}},{"html_id":"reset_order:self-instance-method","name":"reset_order","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L74"},"def":{"name":"reset_order","return_type":"self","visibility":"Public","body":"clone.tap do |__arg1|\n __arg1.query.reset_order\nend"}},{"html_id":"reset_where(&):self-instance-method","name":"reset_where","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":91,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L91"},"def":{"name":"reset_where","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"criteria = yield clone\ncriteria.private_reset_where\n"}},{"html_id":"results:Array(T)-instance-method","name":"results","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":289,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L289"},"def":{"name":"results","return_type":"Array(T)","visibility":"Public","body":"cache_store.fetch(cache_key, as: Array(T)) do\n exec_query.tap do |records|\n preloads.each(&.call(records))\n end\nend"}},{"html_id":"schema_class:T.class-instance-method","name":"schema_class","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L66"},"def":{"name":"schema_class","return_type":"T.class","visibility":"Public","body":"T"}},{"html_id":"select_count:Int64-instance-method","name":"select_count","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":236,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L236"},"def":{"name":"select_count","return_type":"Int64","visibility":"Public","body":"cache_store.fetch(cache_key(:select_count), as: Int64) do\n begin\n table = \"(#{query.statement}) AS temp\"\n new_query = (Avram::QueryBuilder.new(table)).select_count\n result = database.scalar(new_query.statement, args: query.args, queryable: schema_class.name)\n result.as(Int64)\n rescue e : DB::NoResultsError\n 0_i64\n end\nend"}},{"html_id":"table_name(*args,**options)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.table_name(*args, **options)"}},{"html_id":"table_name(*args,**options,&)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/queryable.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L10"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.table_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"to_prepared_sql-instance-method","name":"to_prepared_sql","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":340,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L340"},"def":{"name":"to_prepared_sql","visibility":"Public","body":"query.to_prepared_sql"}},{"html_id":"to_sql-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":336,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L336"},"def":{"name":"to_sql","visibility":"Public","body":"query.to_sql"}},{"html_id":"update:Int64-instance-method","name":"update","doc":"Update the records using the query's where clauses, or all records if no wheres are added.\n\nReturns the number of records updated as `Int64`.\n\n```\n# Update all comments with the word \"spam\" as spam\nCommentQuery.new.body.ilike(\"spam\").update(spam: true)\n```","summary":"

Update the records using the query's where clauses, or all records if no wheres are added.

","abstract":true,"location":{"filename":"src/avram/queryable.cr","line_number":121,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L121"},"def":{"name":"update","return_type":"Int64","visibility":"Public","body":""}},{"html_id":"where(column:Symbol,value):self-instance-method","name":"where","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"value","external_name":"value","restriction":""}],"args_string":"(column : Symbol, value) : self","args_html":"(column : Symbol, value) : self","location":{"filename":"src/avram/queryable.cr","line_number":127,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L127"},"def":{"name":"where","args":[{"name":"column","external_name":"column","restriction":"Symbol"},{"name":"value","external_name":"value","restriction":""}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg5|\n __arg5.query.where(Avram::Where::Equal.new(column, value.to_s))\nend"}},{"html_id":"where(sql_clause:Avram::Where::SqlClause):self-instance-method","name":"where","abstract":false,"args":[{"name":"sql_clause","external_name":"sql_clause","restriction":"Avram::Where::SqlClause"}],"args_string":"(sql_clause : Avram::Where::SqlClause) : self","args_html":"(sql_clause : Avram::Where::SqlClause) : self","location":{"filename":"src/avram/queryable.cr","line_number":139,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L139"},"def":{"name":"where","args":[{"name":"sql_clause","external_name":"sql_clause","restriction":"Avram::Where::SqlClause"}],"return_type":"self","visibility":"Public","body":"clone.tap do |__arg7|\n __arg7.query.where(sql_clause)\nend"}},{"html_id":"where(statement:String,*bind_vars):self-instance-method","name":"where","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"args_string":"(statement : String, *bind_vars) : self","args_html":"(statement : String, *bind_vars) : self","location":{"filename":"src/avram/queryable.cr","line_number":131,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L131"},"def":{"name":"where","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"splat_index":1,"return_type":"self","visibility":"Public","body":"where(statement, args: bind_vars.to_a)"}},{"html_id":"where(statement:String,*,argsbind_vars:Array):self-instance-method","name":"where","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"args_string":"(statement : String, *, args bind_vars : Array) : self","args_html":"(statement : String, *, args bind_vars : Array) : self","location":{"filename":"src/avram/queryable.cr","line_number":135,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L135"},"def":{"name":"where","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"splat_index":1,"return_type":"self","visibility":"Public","body":"clone.tap do |__arg6|\n __arg6.query.where(Avram::Where::Raw.new(statement, args: bind_vars))\nend"}},{"html_id":"where(&):self-instance-method","name":"where","abstract":false,"location":{"filename":"src/avram/queryable.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L143"},"def":{"name":"where","yields":1,"block_arity":1,"return_type":"self","visibility":"Public","body":"cloned = clone.tap do |__arg8|\n __arg8.query.where(Avram::Where::PrecedenceStart.new)\nend\nresult = yield cloned\nif result.query.wheres.last.is_a?(Avram::Where::PrecedenceStart)\n result.clone.tap do |__arg9|\n __arg9.query.remove_last_where\n end\nelse\n cloned = result.clone.tap do |__arg10|\n __arg10.query.clear_conjunction\n end\n cloned.clone.tap do |__arg11|\n __arg11.query.where(Avram::Where::PrecedenceEnd.new)\n end\nend\n"}}],"types":[{"html_id":"avram/Avram/Queryable/PGValue","path":"Avram/Queryable/PGValue.html","kind":"alias","full_name":"Avram::Queryable::PGValue","name":"PGValue","abstract":false,"locations":[{"filename":"src/avram/queryable.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/queryable.cr#L250"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Bool | Float32 | Float64 | Int16 | Int32 | Int64 | PG::Numeric | String | Time | UUID | Nil)","aliased_html":"Bool | Float32 | Float64 | Int16 | Int32 | Int64 | PG::Numeric | String | Time | UUID | Nil","const":false,"namespace":{"html_id":"avram/Avram/Queryable","kind":"module","full_name":"Avram::Queryable(T)","name":"Queryable"},"doc":"Remove when PG::PGValue matches rs.read possibilities","summary":"

Remove when PG::PGValue matches rs.read possibilities

"}]},{"html_id":"avram/Avram/QueryBuilder","path":"Avram/QueryBuilder.html","kind":"class","full_name":"Avram::QueryBuilder","name":"QueryBuilder","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/query_builder.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"constructors":[{"html_id":"new(table:String|Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"table","external_name":"table","restriction":"::String | ::Symbol"}],"args_string":"(table : String | Symbol)","args_html":"(table : String | Symbol)","location":{"filename":"src/avram/query_builder.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L18"},"def":{"name":"new","args":[{"name":"table","external_name":"table","restriction":"::String | ::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(table)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"args:Array(String|Array(String)|Array(Int32))-instance-method","name":"args","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":106,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L106"},"def":{"name":"args","return_type":"Array(String | Array(String) | Array(Int32))","visibility":"Public","body":"prepared_statement_values"}},{"html_id":"args_for_update(params)-instance-method","name":"args_for_update","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""}],"args_string":"(params)","args_html":"(params)","location":{"filename":"src/avram/query_builder.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L77"},"def":{"name":"args_for_update","args":[{"name":"params","external_name":"params","restriction":""}],"visibility":"Public","body":"(param_values(params)) + prepared_statement_values"}},{"html_id":"clear_conjunction-instance-method","name":"clear_conjunction","doc":"Clears the last conjunction\ne.g. users.age = $1 AND -> users.age = $1","summary":"

Clears the last conjunction e.g.

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":334,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L334"},"def":{"name":"clear_conjunction","visibility":"Public","body":"if @wheres.empty?\nelse\n @wheres.last.conjunction = Avram::Where::Conjunction::None\nend"}},{"html_id":"clone-instance-method","name":"clone","doc":"Returns a copy of `self` with all instance variables cloned.","summary":"

Returns a copy of self with all instance variables cloned.

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L2"},"def":{"name":"clone","visibility":"Public","body":"{% if @type < Reference && (!@type.instance_vars.map(&.type).all? do |t|\n ((((t == ::Bool) || (t == ::Char)) || (t == ::Symbol)) || (t == ::String)) || t < ::Number::Primitive\nend) %}\n exec_recursive_clone do |hash|\n clone = {{ @type }}.allocate\n hash[object_id] = clone.object_id\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n end\n {% else %}\n clone = {{ @type }}.allocate\n clone.initialize_copy(self)\n GC.add_finalizer(clone) if clone.responds_to?(:finalize)\n clone\n {% end %}"}},{"html_id":"delete:self-instance-method","name":"delete","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":114,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L114"},"def":{"name":"delete","return_type":"self","visibility":"Public","body":"@delete = true\nself\n"}},{"html_id":"distinct:self-instance-method","name":"distinct","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":119,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L119"},"def":{"name":"distinct","return_type":"self","visibility":"Public","body":"@distinct = true\nself\n"}},{"html_id":"distinct?:Bool-instance-method","name":"distinct?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":129,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L129"},"def":{"name":"distinct?","return_type":"Bool","visibility":"Public","body":"@distinct || has_distinct_on?"}},{"html_id":"distinct_on(column:ColumnName):self-instance-method","name":"distinct_on","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":124,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L124"},"def":{"name":"distinct_on","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@distinct_on = column\nself\n"}},{"html_id":"distinct_on:ColumnName|Nil-instance-method","name":"distinct_on","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L6"},"def":{"name":"distinct_on","return_type":"ColumnName | Nil","visibility":"Public","body":"@distinct_on"}},{"html_id":"group_by(column:ColumnName):self-instance-method","name":"group_by","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":189,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L189"},"def":{"name":"group_by","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@groups << column\nself\n"}},{"html_id":"group_sql:String|Nil-instance-method","name":"group_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":194,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L194"},"def":{"name":"group_sql","return_type":"String | ::Nil","visibility":"Public","body":"if grouped?\n \"GROUP BY \" + (groups.join(\", \"))\nend"}},{"html_id":"grouped?:Bool-instance-method","name":"grouped?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":204,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L204"},"def":{"name":"grouped?","return_type":"Bool","visibility":"Public","body":"!@groups.empty?"}},{"html_id":"groups:Array(ColumnName)-instance-method","name":"groups","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":200,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L200"},"def":{"name":"groups","return_type":"Array(ColumnName)","visibility":"Public","body":"@groups"}},{"html_id":"has_distinct_on?:Bool-instance-method","name":"has_distinct_on?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L133"},"def":{"name":"has_distinct_on?","return_type":"Bool","visibility":"Public","body":"!(!@distinct_on)"}},{"html_id":"join(join_clause:Avram::Join::SqlClause):self-instance-method","name":"join","abstract":false,"args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"args_string":"(join_clause : Avram::Join::SqlClause) : self","args_html":"(join_clause : Avram::Join::SqlClause) : self","location":{"filename":"src/avram/query_builder.cr","line_number":302,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L302"},"def":{"name":"join","args":[{"name":"join_clause","external_name":"join_clause","restriction":"Avram::Join::SqlClause"}],"return_type":"self","visibility":"Public","body":"if (join_clause.to != table) && @joins.none? do |join|\n join.to == join_clause.to\nend\n @joins << join_clause\nend\nself\n"}},{"html_id":"joins:Array(Avram::Join::SqlClause)-instance-method","name":"joins","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":309,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L309"},"def":{"name":"joins","return_type":"Array(Avram::Join::SqlClause)","visibility":"Public","body":"@joins.uniq(&.to_sql)"}},{"html_id":"limit(limit:Int32|Nil):self-instance-method","name":"limit","abstract":false,"args":[{"name":"limit","external_name":"limit","restriction":"Int32 | ::Nil"}],"args_string":"(limit : Int32 | Nil) : self","args_html":"(limit : Int32 | Nil) : self","location":{"filename":"src/avram/query_builder.cr","line_number":141,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L141"},"def":{"name":"limit","args":[{"name":"limit","external_name":"limit","restriction":"Int32 | ::Nil"}],"return_type":"self","visibility":"Public","body":"@limit = limit\nself\n"}},{"html_id":"limit:Int32|Nil-instance-method","name":"limit","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L137"},"def":{"name":"limit","return_type":"Int32 | ::Nil","visibility":"Public","body":"@limit"}},{"html_id":"merge(query_to_merge:Avram::QueryBuilder)-instance-method","name":"merge","doc":"Merges the wheres, joins, and orders from the passed in query","summary":"

Merges the wheres, joins, and orders from the passed in query

","abstract":false,"args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"args_string":"(query_to_merge : Avram::QueryBuilder)","args_html":"(query_to_merge : Avram::QueryBuilder)","location":{"filename":"src/avram/query_builder.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L39"},"def":{"name":"merge","args":[{"name":"query_to_merge","external_name":"query_to_merge","restriction":"Avram::QueryBuilder"}],"visibility":"Public","body":"query_to_merge.wheres.each do |where|\n where(where)\nend\nquery_to_merge.joins.each do |join|\n join(join)\nend\nquery_to_merge.orders.each do |order|\n order_by(order)\nend\nquery_to_merge.groups.each do |group|\n group_by(group)\nend\n"}},{"html_id":"offset(offset:Int32|Nil):self-instance-method","name":"offset","abstract":false,"args":[{"name":"offset","external_name":"offset","restriction":"Int32 | ::Nil"}],"args_string":"(offset : Int32 | Nil) : self","args_html":"(offset : Int32 | Nil) : self","location":{"filename":"src/avram/query_builder.cr","line_number":149,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L149"},"def":{"name":"offset","args":[{"name":"offset","external_name":"offset","restriction":"Int32 | ::Nil"}],"return_type":"self","visibility":"Public","body":"@offset = offset\nself\n"}},{"html_id":"offset:Int32|Nil-instance-method","name":"offset","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":145,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L145"},"def":{"name":"offset","return_type":"Int32 | ::Nil","visibility":"Public","body":"@offset"}},{"html_id":"or(&block:Avram::QueryBuilder->Avram::QueryBuilder):self-instance-method","name":"or","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":322,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L322"},"def":{"name":"or","yields":1,"block_arity":1,"block_arg":{"name":"block","external_name":"block","restriction":"(Avram::QueryBuilder -> Avram::QueryBuilder)"},"return_type":"self","visibility":"Public","body":"if @wheres.empty?\n raise(Avram::InvalidQueryError.new(\"Cannot call `or` before calling a `where`\"))\nend\n@wheres.last.conjunction = Avram::Where::Conjunction::Or\nblock.call(self)\n"}},{"html_id":"order_by(order:OrderByClause):self-instance-method","name":"order_by","abstract":false,"args":[{"name":"order","external_name":"order","restriction":"OrderByClause"}],"args_string":"(order : OrderByClause) : self","args_html":"(order : OrderByClause) : self","location":{"filename":"src/avram/query_builder.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L153"},"def":{"name":"order_by","args":[{"name":"order","external_name":"order","restriction":"OrderByClause"}],"return_type":"self","visibility":"Public","body":"if ordered_randomly?\n reset_order\nend\n@orders << order\nself\n"}},{"html_id":"order_sql:String|Nil-instance-method","name":"order_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":179,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L179"},"def":{"name":"order_sql","return_type":"String | ::Nil","visibility":"Public","body":"if ordered?\n \"ORDER BY \" + (orders.join(\", \", &.prepare))\nend"}},{"html_id":"ordered?:Bool-instance-method","name":"ordered?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":271,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L271"},"def":{"name":"ordered?","return_type":"Bool","visibility":"Public","body":"!@orders.empty?"}},{"html_id":"ordered_randomly?:Bool-instance-method","name":"ordered_randomly?","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":275,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L275"},"def":{"name":"ordered_randomly?","return_type":"Bool","visibility":"Public","body":"ordered? && @orders.first.is_a?(Avram::OrderByRandom)"}},{"html_id":"orders:Array(Avram::OrderByClause)-instance-method","name":"orders","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":185,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L185"},"def":{"name":"orders","return_type":"Array(Avram::OrderByClause)","visibility":"Public","body":"@orders.uniq!(&.column)"}},{"html_id":"random_order:self-instance-method","name":"random_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":159,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L159"},"def":{"name":"random_order","return_type":"self","visibility":"Public","body":"reset_order\n@orders << Avram::OrderByRandom.new\nself\n"}},{"html_id":"remove_last_where-instance-method","name":"remove_last_where","doc":"Removes the last `Avram::Where` to be added","summary":"

Removes the last Avram::Where to be added

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":339,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L339"},"def":{"name":"remove_last_where","visibility":"Public","body":"@wheres.pop"}},{"html_id":"reset_order:Array(Avram::OrderByClause)-instance-method","name":"reset_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":170,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L170"},"def":{"name":"reset_order","return_type":"Array(Avram::OrderByClause)","visibility":"Public","body":"@orders.clear"}},{"html_id":"reset_where(column:ColumnName):self-instance-method","name":"reset_where","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":165,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L165"},"def":{"name":"reset_where","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"@wheres.reject! do |clause|\n clause.is_a?(Avram::Where::SqlClause) && (clause.column.to_s == column.to_s)\nend\nself\n"}},{"html_id":"reverse_order:self-instance-method","name":"reverse_order","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":174,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L174"},"def":{"name":"reverse_order","return_type":"self","visibility":"Public","body":"if ordered_randomly?\nelse\n @orders = @orders.map(&.reversed).reverse!\nend\nself\n"}},{"html_id":"select(selection:Array(ColumnName)):self-instance-method","name":"select","abstract":false,"args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"args_string":"(selection : Array(ColumnName)) : self","args_html":"(selection : Array(ColumnName)) : self","location":{"filename":"src/avram/query_builder.cr","line_number":262,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L262"},"def":{"name":"select","args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"return_type":"self","visibility":"Public","body":"@selections = selection.join(\", \") do |column|\n \"#{@table}.#{column}\"\nend\nself\n"}},{"html_id":"select(selections:String):self-instance-method","name":"select","abstract":false,"args":[{"name":"selections","external_name":"selections","restriction":"String"}],"args_string":"(selections : String) : self","args_html":"(selections : String) : self","location":{"filename":"src/avram/query_builder.cr","line_number":267,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L267"},"def":{"name":"select","args":[{"name":"selections","external_name":"selections","restriction":"String"}],"return_type":"self","visibility":"Public","body":"@selections = selections\nself\n"}},{"html_id":"select_average(column:ColumnName):self-instance-method","name":"select_average","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":220,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L220"},"def":{"name":"select_average","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"AVG(#{column})\")"}},{"html_id":"select_count:self-instance-method","name":"select_count","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":208,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L208"},"def":{"name":"select_count","return_type":"self","visibility":"Public","body":"add_aggregate(\"COUNT(*)\")"}},{"html_id":"select_direct(selection:Array(ColumnName)):self-instance-method","name":"select_direct","abstract":false,"args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"args_string":"(selection : Array(ColumnName)) : self","args_html":"(selection : Array(ColumnName)) : self","location":{"filename":"src/avram/query_builder.cr","line_number":257,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L257"},"def":{"name":"select_direct","args":[{"name":"selection","external_name":"selection","restriction":"Array(ColumnName)"}],"return_type":"self","visibility":"Public","body":"@selections = selection.join(\", \")\nself\n"}},{"html_id":"select_max(column:ColumnName):self-instance-method","name":"select_max","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":216,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L216"},"def":{"name":"select_max","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"MAX(#{column})\")"}},{"html_id":"select_min(column:ColumnName):self-instance-method","name":"select_min","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":212,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L212"},"def":{"name":"select_min","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"MIN(#{column})\")"}},{"html_id":"select_sum(column:ColumnName):self-instance-method","name":"select_sum","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"args_string":"(column : ColumnName) : self","args_html":"(column : ColumnName) : self","location":{"filename":"src/avram/query_builder.cr","line_number":224,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L224"},"def":{"name":"select_sum","args":[{"name":"column","external_name":"column","restriction":"ColumnName"}],"return_type":"self","visibility":"Public","body":"add_aggregate(\"SUM(#{column})\")"}},{"html_id":"selects:Array(String)-instance-method","name":"selects","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":251,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L251"},"def":{"name":"selects","return_type":"Array(String)","visibility":"Public","body":"(@selections.split(\", \")).map() do |__arg3|\n (__arg3.split('.')).last\nend"}},{"html_id":"statement:String-instance-method","name":"statement","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L57"},"def":{"name":"statement","return_type":"String","visibility":"Public","body":"clone.statement!"}},{"html_id":"statement!:String-instance-method","name":"statement!","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L61"},"def":{"name":"statement!","return_type":"String","visibility":"Public","body":"join_sql([@delete ? delete_sql : select_sql] + sql_condition_clauses)"}},{"html_id":"statement_for_update(params,return_columnsreturning?:Bool=true)-instance-method","name":"statement_for_update","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"args_string":"(params, return_columns returning? : Bool = true)","args_html":"(params, return_columns returning? : Bool = true)","location":{"filename":"src/avram/query_builder.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L65"},"def":{"name":"statement_for_update","args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"visibility":"Public","body":"clone.statement_for_update!(params, returning?)"}},{"html_id":"statement_for_update!(params,return_columnsreturning?:Bool=true)-instance-method","name":"statement_for_update!","abstract":false,"args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"args_string":"(params, return_columns returning? : Bool = true)","args_html":"(params, return_columns returning? : Bool = true)","location":{"filename":"src/avram/query_builder.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L69"},"def":{"name":"statement_for_update!","args":[{"name":"params","external_name":"params","restriction":""},{"name":"returning?","default_value":"true","external_name":"return_columns","restriction":"Bool"}],"visibility":"Public","body":"sql = [\"UPDATE #{table}\", set_sql_clause(params)]\nsql = sql + sql_condition_clauses\nif returning?\n sql = sql + [\"RETURNING #{@selections}\"]\nend\njoin_sql(sql)\n"}},{"html_id":"table:TableName-instance-method","name":"table","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L5"},"def":{"name":"table","return_type":"TableName","visibility":"Public","body":"@table"}},{"html_id":"to_prepared_sql:String-instance-method","name":"to_prepared_sql","doc":"Prepares the SQL statement by combining the `args` and `statement`\nin to a single `String`","summary":"

Prepares the SQL statement by combining the #args and #statement in to a single String

","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L27"},"def":{"name":"to_prepared_sql","return_type":"String","visibility":"Public","body":"params = args.map do |arg|\n \"'#{String.new((PQ::Param.encode(arg)).slice)}'\"\nend\ni = 0\nsql = statement\nsql.scan(/\\$\\d+/) do |match|\n sql = sql.sub(match[0], params[i])\n i = i + 1\nend\nsql\n"}},{"html_id":"to_sql:Array(Array(Int32)|Array(String)|String)-instance-method","name":"to_sql","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L21"},"def":{"name":"to_sql","return_type":"Array(Array(Int32) | Array(String) | String)","visibility":"Public","body":"[statement] + args"}},{"html_id":"where(where_clause:Avram::Where::Condition):self-instance-method","name":"where","abstract":false,"args":[{"name":"where_clause","external_name":"where_clause","restriction":"Avram::Where::Condition"}],"args_string":"(where_clause : Avram::Where::Condition) : self","args_html":"(where_clause : Avram::Where::Condition) : self","location":{"filename":"src/avram/query_builder.cr","line_number":317,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L317"},"def":{"name":"where","args":[{"name":"where_clause","external_name":"where_clause","restriction":"Avram::Where::Condition"}],"return_type":"self","visibility":"Public","body":"@wheres << where_clause\nself\n"}},{"html_id":"wheres:Array(Avram::Where::Condition)-instance-method","name":"wheres","abstract":false,"location":{"filename":"src/avram/query_builder.cr","line_number":361,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L361"},"def":{"name":"wheres","return_type":"Array(Avram::Where::Condition)","visibility":"Public","body":"@wheres"}}],"types":[{"html_id":"avram/Avram/QueryBuilder/ColumnName","path":"Avram/QueryBuilder/ColumnName.html","kind":"alias","full_name":"Avram::QueryBuilder::ColumnName","name":"ColumnName","abstract":false,"locations":[{"filename":"src/avram/query_builder.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/query_builder.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(String | Symbol)","aliased_html":"String | Symbol","const":false,"namespace":{"html_id":"avram/Avram/QueryBuilder","kind":"class","full_name":"Avram::QueryBuilder","name":"QueryBuilder"}}]},{"html_id":"avram/Avram/RecordNotFoundError","path":"Avram/RecordNotFoundError.html","kind":"class","full_name":"Avram::RecordNotFoundError","name":"RecordNotFoundError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when Avram cannot find a record by given id","summary":"

Raised when Avram cannot find a record by given id

","constructors":[{"html_id":"new(model:TableName,id:String)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"id","external_name":"id","restriction":"String"}],"args_string":"(model : TableName, id : String)","args_html":"(model : TableName, id : String)","location":{"filename":"src/avram/errors.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L31"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"id","external_name":"id","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, id)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(model:TableName,query:Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"query","external_name":"query","restriction":"Symbol"}],"args_string":"(model : TableName, query : Symbol)","args_html":"(model : TableName, query : Symbol)","location":{"filename":"src/avram/errors.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L35"},"def":{"name":"new","args":[{"name":"model","external_name":"model","restriction":"TableName"},{"name":"query","external_name":"query","restriction":"Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model, query)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"id:String|Nil-instance-method","name":"id","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L28"},"def":{"name":"id","return_type":"String | ::Nil","visibility":"Public","body":"@id"}},{"html_id":"model:TableName-instance-method","name":"model","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L27"},"def":{"name":"model","return_type":"TableName","visibility":"Public","body":"@model"}},{"html_id":"query:Symbol|Nil-instance-method","name":"query","abstract":false,"location":{"filename":"src/avram/errors.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L29"},"def":{"name":"query","return_type":"Symbol | ::Nil","visibility":"Public","body":"@query"}}]},{"html_id":"avram/Avram/Rollback","path":"Avram/Rollback.html","kind":"class","full_name":"Avram::Rollback","name":"Rollback","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raise to rollback a transaction.","summary":"

Raise to rollback a transaction.

"},{"html_id":"avram/Avram/SaveOperation","path":"Avram/SaveOperation.html","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Upsert","kind":"module","full_name":"Avram::Upsert","name":"Upsert"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/MarkAsFailed","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed"},{"html_id":"avram/Avram/NestedSaveOperation","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation"},{"html_id":"avram/Avram/DatabaseValidations","kind":"module","full_name":"Avram::DatabaseValidations","name":"DatabaseValidations"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L13"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ATTRIBUTES","name":"ATTRIBUTES","value":"[] of Nil"},{"id":"OPERATION_NEEDS","name":"OPERATION_NEEDS","value":"[] of Nil"}],"included_modules":[{"html_id":"avram/Avram/AddColumnAttributes","kind":"module","full_name":"Avram::AddColumnAttributes","name":"AddColumnAttributes"},{"html_id":"avram/Avram/Callbacks","kind":"module","full_name":"Avram::Callbacks","name":"Callbacks"},{"html_id":"avram/Avram/DatabaseValidations","kind":"module","full_name":"Avram::DatabaseValidations","name":"DatabaseValidations"},{"html_id":"avram/Avram/DefineAttribute","kind":"module","full_name":"Avram::DefineAttribute","name":"DefineAttribute"},{"html_id":"avram/Avram/InheritColumnAttributes","kind":"module","full_name":"Avram::InheritColumnAttributes","name":"InheritColumnAttributes"},{"html_id":"avram/Avram/MarkAsFailed","kind":"module","full_name":"Avram::MarkAsFailed","name":"MarkAsFailed"},{"html_id":"avram/Avram/NeedyInitializerAndSaveMethods","kind":"module","full_name":"Avram::NeedyInitializerAndSaveMethods","name":"NeedyInitializerAndSaveMethods"},{"html_id":"avram/Avram/NestedSaveOperation","kind":"module","full_name":"Avram::NestedSaveOperation","name":"NestedSaveOperation"},{"html_id":"avram/Avram/OperationErrors","kind":"module","full_name":"Avram::OperationErrors","name":"OperationErrors"},{"html_id":"avram/Avram/ParamKeyOverride","kind":"module","full_name":"Avram::ParamKeyOverride","name":"ParamKeyOverride"},{"html_id":"avram/Avram/Upsert","kind":"module","full_name":"Avram::Upsert","name":"Upsert"},{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"param_key:String-class-method","name":"param_key","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L44"},"def":{"name":"param_key","return_type":"String","visibility":"Public","body":"T.name.underscore"}},{"html_id":"upsert(*args,**named_args)-class-method","name":"upsert","doc":"Performs a create or update depending on if there is a conflicting row in the database.\n\nSee `Avram::Upsert.upsert_lookup_columns` for full documentation and examples.","summary":"

Performs a create or update depending on if there is a conflicting row in the database.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/save_operation.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L24"},"def":{"name":"upsert","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"{% raise(\"Please use the 'upsert_lookup_columns' macro in #{@type} before using 'upsert'\") %}"}},{"html_id":"upsert!(*args,**named_args)-class-method","name":"upsert!","doc":"Performs a create or update depending on if there is a conflicting row in the database.\n\nSee `Avram::Upsert.upsert_lookup_columns` for full documentation and examples.","summary":"

Performs a create or update depending on if there is a conflicting row in the database.

","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **named_args)","args_html":"(*args, **named_args)","location":{"filename":"src/avram/save_operation.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L24"},"def":{"name":"upsert!","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":0,"visibility":"Public","body":"{% raise(\"Please use the 'upsert_lookup_columns' macro in #{@type} before using 'upsert!'\") %}"}}],"constructors":[{"html_id":"new(params:Avram::Paramable)-class-method","name":"new","abstract":false,"args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"args_string":"(params : Avram::Paramable)","args_html":"(params : Avram::Paramable)","location":{"filename":"src/avram/save_operation.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L48"},"def":{"name":"new","args":[{"name":"params","external_name":"params","restriction":"::Avram::Paramable"}],"visibility":"Public","body":"_ = SaveOperation(T).allocate\n_.initialize(params)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L51"},"def":{"name":"new","visibility":"Public","body":"_ = SaveOperation(T).allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"after_commit(_record:T)-instance-method","name":"after_commit","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/save_operation.cr","line_number":283,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L283"},"def":{"name":"after_commit","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"after_save(_record:T)-instance-method","name":"after_save","abstract":false,"args":[{"name":"_record","external_name":"_record","restriction":"T"}],"args_string":"(_record : T)","args_html":"(_record : T)","location":{"filename":"src/avram/save_operation.cr","line_number":281,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L281"},"def":{"name":"after_save","args":[{"name":"_record","external_name":"_record","restriction":"T"}],"visibility":"Public","body":""}},{"html_id":"attributes-instance-method","name":"attributes","abstract":true,"location":{"filename":"src/avram/save_operation.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L42"},"def":{"name":"attributes","visibility":"Public","body":""}},{"html_id":"before_save-instance-method","name":"before_save","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":279,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L279"},"def":{"name":"before_save","visibility":"Public","body":""}},{"html_id":"changes:Hash(Symbol,String|Nil)-instance-method","name":"changes","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L193"},"def":{"name":"changes","return_type":"Hash(Symbol, String | ::Nil)","visibility":"Public","body":"attributes_to_hash(column_attributes.select(&.changed?))"}},{"html_id":"created?:Bool-instance-method","name":"created?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L133"},"def":{"name":"created?","return_type":"Bool","visibility":"Public","body":"saved? && new_record?"}},{"html_id":"custom_errors:Hash(Symbol,Array(String))-instance-method","name":"custom_errors","abstract":false,"def":{"name":"custom_errors","return_type":"Hash(Symbol, Array(String))","visibility":"Public","body":"@custom_errors"}},{"html_id":"database(*args,**options)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.database(*args, **options)"}},{"html_id":"database(*args,**options,&)-instance-method","name":"database","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"database","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.database(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"generic_attributes:Array(Avram::GenericAttribute)-instance-method","name":"generic_attributes","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L64"},"def":{"name":"generic_attributes","return_type":"Array(Avram::GenericAttribute)","visibility":"Public","body":"attributes.map do |attr|\n Avram::GenericAttribute.new(name: attr.name, param: attr.param.try(&.to_s), value: attr.value.try(&.to_s), original_value: attr.original_value.try(&.to_s), param_key: attr.param_key, errors: attr.errors)\nend"}},{"html_id":"new_record?:Bool-instance-method","name":"new_record?","doc":"`#persisted?` always returns `true` in `after_*` hooks, whether\na new record was created, or an existing one was updated.\n\nThis method should always return `true` for a create or `false`\nfor an update, independent of the stage we are at in the operation.","summary":"

#persisted? always returns true in after_* hooks, whether a new record was created, or an existing one was updated.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L263"},"def":{"name":"new_record?","return_type":"Bool","visibility":"Public","body":"({{ (T.constant(:PRIMARY_KEY_NAME)).id }}).value.nil?"}},{"html_id":"params:Avram::Paramable-instance-method","name":"params","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L39"},"def":{"name":"params","return_type":"Avram::Paramable","visibility":"Public","body":"@params"}},{"html_id":"persisted?:Bool-instance-method","name":"persisted?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":254,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L254"},"def":{"name":"persisted?","return_type":"Bool","visibility":"Public","body":"!(!record_id)"}},{"html_id":"primary_key_name(*args,**options)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.primary_key_name(*args, **options)"}},{"html_id":"primary_key_name(*args,**options,&)-instance-method","name":"primary_key_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"primary_key_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.primary_key_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"run_default_validations:Nil-instance-method","name":"run_default_validations","doc":"Runs all required validations for required types\nas well as any additional valitaions the type needs to run\ne.g. polymorphic validations","summary":"

Runs all required validations for required types as well as any additional valitaions the type needs to run e.g.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":100,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L100"},"def":{"name":"run_default_validations","return_type":"Nil","visibility":"Public","body":"validate_required(*required_attributes)\ndefault_validations\n"}},{"html_id":"save:Bool-instance-method","name":"save","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":212,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L212"},"def":{"name":"save","return_type":"Bool","visibility":"Public","body":"before_save\nif valid?\n transaction_committed = database.transaction do\n if (!changes.empty?) || (!persisted?)\n insert_or_update\n end\n after_save(record.as(T))\n true\n end\n if transaction_committed\n self.save_status = OperationStatus::Saved\n after_commit(record.as(T))\n Avram::Events::SaveSuccessEvent.publish(operation_class: self.class.name, attributes: generic_attributes)\n true\n else\n mark_as_failed\n publish_save_failed_event\n false\n end\nelse\n mark_as_failed\n publish_save_failed_event\n false\nend\n"}},{"html_id":"save!:T-instance-method","name":"save!","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":242,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L242"},"def":{"name":"save!","return_type":"T","visibility":"Public","body":"if save\n record.as(T)\nelse\n raise(Avram::InvalidOperationError.new(operation: self))\nend"}},{"html_id":"save_failed?:Bool-instance-method","name":"save_failed?","doc":"Return true if the operation has run and the record failed to save","summary":"

Return true if the operation has run and the record failed to save

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L142"},"def":{"name":"save_failed?","return_type":"Bool","visibility":"Public","body":"save_status == OperationStatus::SaveFailed"}},{"html_id":"save_status:OperationStatus-instance-method","name":"save_status","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L40"},"def":{"name":"save_status","return_type":"OperationStatus","visibility":"Public","body":"@save_status"}},{"html_id":"save_status=(save_status:OperationStatus)-instance-method","name":"save_status=","abstract":false,"args":[{"name":"save_status","external_name":"save_status","restriction":"OperationStatus"}],"args_string":"(save_status : OperationStatus)","args_html":"(save_status : OperationStatus)","location":{"filename":"src/avram/save_operation.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L40"},"def":{"name":"save_status=","args":[{"name":"save_status","external_name":"save_status","restriction":"OperationStatus"}],"visibility":"Public","body":"@save_status = save_status"}},{"html_id":"saved?:Bool-instance-method","name":"saved?","doc":"Returns true if the operation has run and saved the record successfully","summary":"

Returns true if the operation has run and saved the record successfully

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":129,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L129"},"def":{"name":"saved?","return_type":"Bool","visibility":"Public","body":"save_status == OperationStatus::Saved"}},{"html_id":"table_name(*args,**options)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options)","args_html":"(*args, **options)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"visibility":"Public","body":"T.table_name(*args, **options)"}},{"html_id":"table_name(*args,**options,&)-instance-method","name":"table_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":""}],"args_string":"(*args, **options, &)","args_html":"(*args, **options, &)","location":{"filename":"src/avram/save_operation.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L55"},"def":{"name":"table_name","args":[{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"splat_index":0,"yields":1,"block_arity":1,"visibility":"Public","body":"T.table_name(*args, **options) do |*yield_args|\n yield *yield_args\nend"}},{"html_id":"update!:T-instance-method","name":"update!","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":250,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L250"},"def":{"name":"update!","return_type":"T","visibility":"Public","body":"save!"}},{"html_id":"updated?:Bool-instance-method","name":"updated?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L137"},"def":{"name":"updated?","return_type":"Bool","visibility":"Public","body":"saved? && (!new_record?)"}},{"html_id":"valid?:Bool-instance-method","name":"valid?","doc":"Runs required validation,\nthen returns `true` if all attributes are valid,\nand there's no custom errors","summary":"

Runs required validation, then returns true if all attributes are valid, and there's no custom errors

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":120,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L120"},"def":{"name":"valid?","return_type":"Bool","visibility":"Public","body":"run_default_validations\ncustom_errors.empty? && attributes.all?(&.valid?)\n"}}],"macros":[{"html_id":"add_cast_value_methods(columns)-macro","name":"add_cast_value_methods","abstract":false,"args":[{"name":"columns","external_name":"columns","restriction":""}],"args_string":"(columns)","args_html":"(columns)","location":{"filename":"src/avram/save_operation.cr","line_number":197,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L197"},"def":{"name":"add_cast_value_methods","args":[{"name":"columns","external_name":"columns","restriction":""}],"visibility":"Public","body":" private def cast_value(value : Nil)\n nil\n \nend\n\n \n{% for column in columns %}\n # pass `value` to it's `Lucky.to_db` for parsing.\n # In most cases, that's just calling `to_s`, but in the case of an Array,\n # `value` is passed to `PQ::Param` to properly encode `[true]` to `{t}`, etc...\n private def cast_value(value : {{ column[:type] }})\n value.class.adapter.to_db(value.as({{ column[:type] }}))\n end\n {% end %}\n\n \n"}},{"html_id":"param_key(key)-macro","name":"param_key","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""}],"args_string":"(key)","args_html":"(key)","def":{"name":"param_key","args":[{"name":"key","external_name":"key","restriction":""}],"visibility":"Public","body":" def self.param_key : String\n \n{{ key.id.stringify }}\n\n \nend\n \n"}},{"html_id":"permit_columns(*attribute_names)-macro","name":"permit_columns","abstract":false,"args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"args_string":"(*attribute_names)","args_html":"(*attribute_names)","location":{"filename":"src/avram/save_operation.cr","line_number":146,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L146"},"def":{"name":"permit_columns","args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"splat_index":0,"visibility":"Public","body":" \n{% for attribute_name in attribute_names %}\n {% if attribute_name.is_a?(TypeDeclaration) %}\n {% raise(\"Must use a Symbol or a bare word in 'permit_columns'. Instead, got: #{attribute_name}\\n\\nTry this...\\n\\n ▸ permit_columns #{attribute_name.var}\\n\") %}\n {% end %}\n {% if attribute_name.is_a?(SymbolLiteral) || attribute_name.is_a?(Call) %}{% else %}\n {% raise(\"Must use a Symbol or a bare word in 'permit_columns'. Instead, got: #{attribute_name}\\n\\nTry this...\\n\\n ▸ Use a bare word (recommended): 'permit_columns name'\\n ▸ Use a Symbol: 'permit_columns :name'\\n\") %}\n {% end %}\n {% if COLUMN_ATTRIBUTES.any? do |attribute|\n attribute[:name].id == attribute_name.id\nend %}\n def {{ attribute_name.id }}\n _{{ attribute_name.id }}.permitted\n end\n\n @@permitted_param_keys << \"{{ attribute_name.id }}\"\n {% else %}\n {% raise(\"Can't permit '#{attribute_name}' because the column has not been defined on the model for #{@type}.\\n\\nTry this...\\n\\n ▸ Make sure you spelled the column correctly.\\n ▸ Add the column to the model if it doesn't exist.\\n ▸ Use 'attribute' if you want an attribute that is not saved to the database.\\n\") %}\n {% end %}\n {% end %}\n\n \n"}},{"html_id":"skip_default_validations-macro","name":"skip_default_validations","doc":"This allows you to skip the default validations\nwhich may be used as an escape hatch when you want\nto allow storing an empty string value.","summary":"

This allows you to skip the default validations which may be used as an escape hatch when you want to allow storing an empty string value.

","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":112,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L112"},"def":{"name":"skip_default_validations","visibility":"Public","body":" def run_default_validations\n \nend\n \n"}}],"types":[{"html_id":"avram/Avram/SaveOperation/OperationStatus","path":"Avram/SaveOperation/OperationStatus.html","kind":"enum","full_name":"Avram::SaveOperation::OperationStatus","name":"OperationStatus","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L27"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"Saved","name":"Saved","value":"0"},{"id":"SaveFailed","name":"SaveFailed","value":"1"},{"id":"Unperformed","name":"Unperformed","value":"2"}],"namespace":{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"},"instance_methods":[{"html_id":"save_failed?-instance-method","name":"save_failed?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L29"},"def":{"name":"save_failed?","visibility":"Public","body":"self == SaveFailed"}},{"html_id":"saved?-instance-method","name":"saved?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L28"},"def":{"name":"saved?","visibility":"Public","body":"self == Saved"}},{"html_id":"unperformed?-instance-method","name":"unperformed?","abstract":false,"location":{"filename":"src/avram/save_operation.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation.cr#L30"},"def":{"name":"unperformed?","visibility":"Public","body":"self == Unperformed"}}]}]},{"html_id":"avram/Avram/SaveOperationTemplate","path":"Avram/SaveOperationTemplate.html","kind":"class","full_name":"Avram::SaveOperationTemplate","name":"SaveOperationTemplate","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/save_operation_template.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation_template.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"setup(type,columns,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, columns, *args, **named_args)","args_html":"(type, columns, *args, **named_args)","location":{"filename":"src/avram/save_operation_template.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/save_operation_template.cr#L2"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"columns","external_name":"columns","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":2,"visibility":"Public","body":" \n# This makes it easy for plugins and extensions to use the base SaveOperation\n\n def base_query_class : ::\n{{ type }}\n::BaseQuery.class\n ::\n{{ type }}\n::BaseQuery\n \nend\n\n def save_operation_class : ::\n{{ type }}\n::SaveOperation.class\n ::\n{{ type }}\n::SaveOperation\n \nend\n\n class ::\n{{ type }}\n::SaveOperation < Avram::SaveOperation(\n{{ type }}\n)\n \n{% primary_key_type = type.resolve.constant(\"PRIMARY_KEY_TYPE\") %}\n\n\n macro inherited\n FOREIGN_KEY = \"\n{{ type.stringify.underscore.id }}\n_id\"\n \nend\n\n add_column_attributes(\n{{ columns }}\n)\n add_cast_value_methods(\n{{ columns }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/SchemaEnforcer","path":"Avram/SchemaEnforcer.html","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer","abstract":false,"locations":[{"filename":"src/avram/schema_enforcer.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer.cr#L4"},{"filename":"src/avram/schema_enforcer/validation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/validation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"ALL_MODELS","name":"ALL_MODELS","value":"[] of Avram::Model.class"},{"id":"MODELS_TO_SKIP","name":"MODELS_TO_SKIP","value":"[] of String"}],"including_types":[{"html_id":"avram/Avram/Model","kind":"class","full_name":"Avram::Model","name":"Model"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"ensure_correct_column_mappings!-class-method","name":"ensure_correct_column_mappings!","abstract":false,"location":{"filename":"src/avram/schema_enforcer.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer.cr#L22"},"def":{"name":"ensure_correct_column_mappings!","visibility":"Public","body":"{% if !ALL_MODELS.empty? %}\n ALL_MODELS.each do |model|\n model.ensure_correct_column_mappings!\n end\n {% end %}"}}],"macros":[{"html_id":"setup(type,*args,**named_args)-macro","name":"setup","abstract":false,"args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"args_string":"(type, *args, **named_args)","args_html":"(type, *args, **named_args)","location":{"filename":"src/avram/schema_enforcer.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer.cr#L8"},"def":{"name":"setup","args":[{"name":"type","external_name":"type","restriction":""},{"name":"args","external_name":"args","restriction":""}],"double_splat":{"name":"named_args","external_name":"named_args","restriction":""},"splat_index":1,"visibility":"Public","body":" class_getter schema_enforcer_validations = [] of Avram::SchemaEnforcer::Validation\n\n def self.ensure_correct_column_mappings!\n return if Avram::SchemaEnforcer::MODELS_TO_SKIP.includes?(self.name)\n\n schema_enforcer_validations.each(&.validate!)\n \nend\n\n \n{% if !type.resolve.abstract? %}\n {% Avram::SchemaEnforcer::ALL_MODELS << type %}\n {% end %}\n\n \n"}},{"html_id":"skip_schema_enforcer-macro","name":"skip_schema_enforcer","abstract":false,"location":{"filename":"src/avram/schema_enforcer.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer.cr#L30"},"def":{"name":"skip_schema_enforcer","visibility":"Public","body":" \n{% Avram::SchemaEnforcer::MODELS_TO_SKIP << @type.stringify %}\n\n \n"}}],"types":[{"html_id":"avram/Avram/SchemaEnforcer/EnsureExistingTable","path":"Avram/SchemaEnforcer/EnsureExistingTable.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureExistingTable","name":"EnsureExistingTable","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_existing_table.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_existing_table.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_existing_table.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_existing_table.cr#L2"},"def":{"name":"validate!","visibility":"Public","body":"if table_missing?\n best_match = Levenshtein::Finder.find(table_name, database_info.table_names, tolerance: 2)\n message = String.build do |string|\n string << \"#{model_class.name.colorize.bold} wants to use the '#{table_name.colorize.bold}' table but it is missing.\\n\"\n if best_match\n string << \"\\nIf you meant for #{model_class.name.colorize.bold} to use the '#{best_match.colorize.yellow.bold}' table, try this...\\n\\n ▸ Change the table name in #{model_class.name.colorize.bold}:\\n\\n table :#{best_match.colorize.bold} do\\n # ..columns\\n end\\n\"\n end\n string << \"\\nIf you need to create the '#{table_name}' table...\\n\\n ▸ Generate a migration:\\n\\n lucky gen.migration Create#{Wordsmith::Inflector.pluralize(model_class.name)}\\n\\n ▸ Create the table in the migration:\\n\\n create table_for(#{model_class.name}) do/end\\n\"\n string << \"\\nOr, you can skip schema checks for this model:\\n\\n class #{model_class.name} < BaseModel\\n # Great for models used in migrations, or for legacy schemas\\n skip_schema_enforcer\\n end\\n\\n\"\n end\n raise(Avram::SchemaMismatchError.new(message))\nend"}}]},{"html_id":"avram/Avram/SchemaEnforcer/EnsureMatchingColumns","path":"Avram/SchemaEnforcer/EnsureMatchingColumns.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureMatchingColumns","name":"EnsureMatchingColumns","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_matching_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"constructors":[{"html_id":"new(model_class,check_required:Bool)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":""},{"name":"check_required","external_name":"check_required","restriction":"::Bool"}],"args_string":"(model_class, check_required : Bool)","args_html":"(model_class, check_required : Bool)","location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_matching_columns.cr#L11"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":""},{"name":"check_required","external_name":"check_required","restriction":"::Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class, check_required)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(model_class)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":""}],"args_string":"(model_class)","args_html":"(model_class)","location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_matching_columns.cr#L7"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_matching_columns.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_matching_columns.cr#L14"},"def":{"name":"validate!","visibility":"Public","body":"model_class.columns.each do |attribute|\n check_column_matches(attribute)\nend\nif matching_error?\n message = (@missing_columns + @optional_attribute_errors) + @required_attribute_errors\n raise(Avram::SchemaMismatchError.new(message.join(\"\\n\\n\")))\nend\n"}}]},{"html_id":"avram/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault","path":"Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault.html","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureUUIDPrimaryKeyHasDefault","name":"EnsureUUIDPrimaryKeyHasDefault","abstract":false,"superclass":{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},"ancestors":[{"html_id":"avram/Avram/SchemaEnforcer/Validation","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"instance_methods":[{"html_id":"has_primary_key?:Bool-instance-method","name":"has_primary_key?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L25"},"def":{"name":"has_primary_key?","return_type":"Bool","visibility":"Public","body":"!model_class.primary_key_name.nil?"}},{"html_id":"missing_column_default?:Bool-instance-method","name":"missing_column_default?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L33"},"def":{"name":"missing_column_default?","return_type":"Bool","visibility":"Public","body":"primary_key_info.column_default.nil?"}},{"html_id":"primary_key_info:Avram::Database::ColumnInfo-instance-method","name":"primary_key_info","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L37"},"def":{"name":"primary_key_info","return_type":"Avram::Database::ColumnInfo","visibility":"Public","body":"pkey_name = model_class.primary_key_name.to_s\n(table_info.column(pkey_name)).as(Avram::Database::ColumnInfo)\n"}},{"html_id":"uuid_primary_key?:Bool-instance-method","name":"uuid_primary_key?","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L29"},"def":{"name":"uuid_primary_key?","return_type":"Bool","visibility":"Public","body":"primary_key_info.data_type == \"uuid\""}},{"html_id":"validate!-instance-method","name":"validate!","abstract":false,"location":{"filename":"src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/ensure_uuid_primary_key_has_default.cr#L2"},"def":{"name":"validate!","visibility":"Public","body":"if (has_primary_key? && uuid_primary_key?) && missing_column_default?\nelse\n return\nend\nmessage = \"Primary key on the '#{table_name.colorize.bold}' table has the type set as uuid but does not have a default value.\\n\\nTo add a default value...\\n\\n ▸ Generate a migration:\\n\\n lucky gen.migration AddDefaultTo#{Wordsmith::Inflector.pluralize(model_class.name)}PrimaryKey\\n\\n ▸ Enable a Postgres extension to generate uuids if one is not already available in the migration:\\n\\n enable_extension \\\"pgcrypto\\\" # https://www.postgresql.org/docs/current/pgcrypto.html\\n\\n ▸ Update the primary key column to have a default value in the migration:\\n\\n execute(\\\"ALTER TABLE #{table_name.colorize.bold} ALTER COLUMN #{primary_key_info.column_name.colorize.bold} SET DEFAULT gen_random_uuid();\\\")\"\nraise(Avram::SchemaMismatchError.new(message))\n"}}]},{"html_id":"avram/Avram/SchemaEnforcer/Validation","path":"Avram/SchemaEnforcer/Validation.html","kind":"class","full_name":"Avram::SchemaEnforcer::Validation","name":"Validation","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/schema_enforcer/validation.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/validation.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/SchemaEnforcer/EnsureExistingTable","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureExistingTable","name":"EnsureExistingTable"},{"html_id":"avram/Avram/SchemaEnforcer/EnsureMatchingColumns","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureMatchingColumns","name":"EnsureMatchingColumns"},{"html_id":"avram/Avram/SchemaEnforcer/EnsureUUIDPrimaryKeyHasDefault","kind":"class","full_name":"Avram::SchemaEnforcer::EnsureUUIDPrimaryKeyHasDefault","name":"EnsureUUIDPrimaryKeyHasDefault"}],"namespace":{"html_id":"avram/Avram/SchemaEnforcer","kind":"module","full_name":"Avram::SchemaEnforcer","name":"SchemaEnforcer"},"constructors":[{"html_id":"new(model_class:::Avram::Model.class)-class-method","name":"new","abstract":false,"args":[{"name":"model_class","external_name":"model_class","restriction":"::Avram::Model.class"}],"args_string":"(model_class : ::Avram::Model.class)","args_html":"(model_class : ::Avram::Model.class)","location":{"filename":"src/avram/schema_enforcer/validation.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/validation.cr#L4"},"def":{"name":"new","args":[{"name":"model_class","external_name":"model_class","restriction":"::Avram::Model.class"}],"visibility":"Public","body":"_ = allocate\n_.initialize(model_class)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"validate!-instance-method","name":"validate!","abstract":true,"location":{"filename":"src/avram/schema_enforcer/validation.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/schema_enforcer/validation.cr#L7"},"def":{"name":"validate!","visibility":"Public","body":""}}]}]},{"html_id":"avram/Avram/SchemaMismatchError","path":"Avram/SchemaMismatchError.html","kind":"class","full_name":"Avram::SchemaMismatchError","name":"SchemaMismatchError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L11"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised by Avram::SchemaEnforcer when columns or tables don't match the database.","summary":"

Raised by Avram::SchemaEnforcer when columns or tables don't match the database.

"},{"html_id":"avram/Avram/Slugify","path":"Avram/Slugify.html","kind":"module","full_name":"Avram::Slugify","name":"Slugify","abstract":false,"locations":[{"filename":"src/avram/slugify.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"extended_modules":[{"html_id":"avram/Avram/Slugify","kind":"module","full_name":"Avram::Slugify","name":"Slugify"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Converts a column value to a URL safe String that\ncan be used as a parameter for finding records. A\n`slug` is a `String` column you define on your model\nthat will be passed through the URL instead of an `id`.\n\ne.g. /articles/1 -> /articles/how-to-slugify\n\nUse this module in your `SaveOperation#before_save`.\n\n```\nclass Article < BaseModel\n table do\n column title : String\n column slug : String\n end\nend\n\nclass SaveArticle < Article::SaveOperation\n before_save do\n Avram::Slugify.set slug,\n using: title,\n query: ArticleQuery.new\n end\nend\n```\n\nThe `set` method will use `query` to determine if that `slug` has already\nbeen used, and fall back to appending a random UUID to the end. If the `slug`\nvalue has already been set, then no new slug will be generated. If you just need\nthe value to set on your own, you can use the `generate` method as an escape hatch.\nThis method returns the String value used in the `set` method.\n\n```\nclass SaveArticle < Article::SaveOperation\n before_save do\n if title.changed?\n slug_value = Avram::Slugify.generate(slug,\n using: title,\n query: ArticleQuery.new)\n slug.value = slug_value\n end\n end\nend\n```","summary":"

Converts a column value to a URL safe String that can be used as a parameter for finding records.

","instance_methods":[{"html_id":"generate(slug:Avram::Attribute(String),usingslug_candidate:Avram::Attribute(String)|String,query:Avram::Queryable):String|Nil-instance-method","name":"generate","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : String | Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : String | Nil","location":{"filename":"src/avram/slugify.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L62"},"def":{"name":"generate","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"String | ::Nil","visibility":"Public","body":"generate(slug, [slug_candidate], query)"}},{"html_id":"generate(slug:Avram::Attribute(String),usingslug_candidates:Array(String|Avram::Attribute(String)|Array(Avram::Attribute(String))),query:Avram::Queryable):String|Nil-instance-method","name":"generate","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : String | Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : String | Nil","location":{"filename":"src/avram/slugify.cr","line_number":68,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L68"},"def":{"name":"generate","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"String | ::Nil","visibility":"Public","body":"slug_candidates = format_candidates(slug_candidates)\nresult = slug_candidates.find do |candidate|\n (query.where(slug.name, candidate)).none?\nend\nif result\n result\nelse\n if candidate = slug_candidates.first?\n \"#{candidate}-#{UUID.random}\"\n end\nend\n"}},{"html_id":"set(slug:Avram::Attribute(String),usingslug_candidate:Avram::Attribute(String)|String,query:Avram::Queryable):Nil-instance-method","name":"set","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidate : Avram::Attribute(String) | String, query : Avram::Queryable) : Nil","location":{"filename":"src/avram/slugify.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L48"},"def":{"name":"set","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidate","external_name":"using","restriction":"Avram::Attribute(String) | String"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"Nil","visibility":"Public","body":"set(slug, [slug_candidate], query)"}},{"html_id":"set(slug:Avram::Attribute(String),usingslug_candidates:Array(String|Avram::Attribute(String)|Array(Avram::Attribute(String))),query:Avram::Queryable):Nil-instance-method","name":"set","abstract":false,"args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"args_string":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : Nil","args_html":"(slug : Avram::Attribute(String), using slug_candidates : Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String))), query : Avram::Queryable) : Nil","location":{"filename":"src/avram/slugify.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/slugify.cr#L54"},"def":{"name":"set","args":[{"name":"slug","external_name":"slug","restriction":"Avram::Attribute(String)"},{"name":"slug_candidates","external_name":"using","restriction":"Array(String | Avram::Attribute(String) | Array(Avram::Attribute(String)))"},{"name":"query","external_name":"query","restriction":"Avram::Queryable"}],"return_type":"Nil","visibility":"Public","body":"if slug.value.blank?\n slug.value = generate(slug, slug_candidates, query)\nend"}}]},{"html_id":"avram/Avram/SoftDelete","path":"Avram/SoftDelete.html","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete","abstract":false,"locations":[{"filename":"src/avram/soft_delete/model.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/SoftDelete/Model","path":"Avram/SoftDelete/Model.html","kind":"module","full_name":"Avram::SoftDelete::Model","name":"Model","abstract":false,"locations":[{"filename":"src/avram/soft_delete/model.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L27"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SoftDelete","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete"},"doc":" table do\n column soft_deleted_at : Time?\n end\nend\n```\n\nYou should also add the `Avram::SoftDeleteQuery` to your query\n\n```\nclass ArticleQuery < Article::BaseQuery\n include Avram::SoftDelete::Query\nend\n```","summary":"

table do column soft_deleted_at : Time? end end ```

","instance_methods":[{"html_id":"restore:self-instance-method","name":"restore","doc":"Restore the record\n\nThis will set `soft_deleted_at` to `nil`","summary":"

Restore the record

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L38"},"def":{"name":"restore","return_type":"self","visibility":"Public","body":"save_operation_class.update!(self, soft_deleted_at: nil)"}},{"html_id":"save_operation_class-instance-method","name":"save_operation_class","abstract":true,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L42"},"def":{"name":"save_operation_class","visibility":"Public","body":""}},{"html_id":"soft_delete:self-instance-method","name":"soft_delete","doc":"Soft delete the record\n\nThis will set `soft_deleted_at` to the current time (`Time.utc`)","summary":"

Soft delete the record

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L31"},"def":{"name":"soft_delete","return_type":"self","visibility":"Public","body":"save_operation_class.update!(self, soft_deleted_at: Time.utc)"}},{"html_id":"soft_deleted?:Bool-instance-method","name":"soft_deleted?","doc":"Returns true if soft deleted, otherwise false\n\nIf the `soft_deleted_at` has a time value the record is \"soft deleted\".\nIf `soft_deleted_at` is `nil` the record has not been deleted yet.","summary":"

Returns true if soft deleted, otherwise false

","abstract":false,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L48"},"def":{"name":"soft_deleted?","return_type":"Bool","visibility":"Public","body":"soft_deleted_at.present?"}},{"html_id":"soft_deleted_at:Time|Nil-instance-method","name":"soft_deleted_at","abstract":true,"location":{"filename":"src/avram/soft_delete/model.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/model.cr#L52"},"def":{"name":"soft_deleted_at","return_type":"Time | ::Nil","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/SoftDelete/Query","path":"Avram/SoftDelete/Query.html","kind":"module","full_name":"Avram::SoftDelete::Query","name":"Query","abstract":false,"locations":[{"filename":"src/avram/soft_delete/query.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L12"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/SoftDelete","kind":"module","full_name":"Avram::SoftDelete","name":"SoftDelete"},"doc":"Add methods for querying/updating soft deleted and kept records.\n\nFirst include the model module in your model: `Avram::SoftDelete::Model`\n\nThen add this module your query\n\n```\nclass ArticleQuery < Article::BaseQuery\n include Avram::SoftDelete::Query\nend\n```","summary":"

Add methods for querying/updating soft deleted and kept records.

","instance_methods":[{"html_id":"only_kept-instance-method","name":"only_kept","doc":"Only return kept records\n\nKept records are considered \"kept/not soft deleted\" if the\n`soft_deleted_at` column is `nil`","summary":"

Only return kept records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L17"},"def":{"name":"only_kept","visibility":"Public","body":"reset_where(&.soft_deleted_at).soft_deleted_at.is_nil"}},{"html_id":"only_soft_deleted-instance-method","name":"only_soft_deleted","doc":"Only return soft deleted records\n\nSoft deleted records are considered \"soft deleted\" if the\n`soft_deleted_at` column has a non-nil value","summary":"

Only return soft deleted records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L25"},"def":{"name":"only_soft_deleted","visibility":"Public","body":"reset_where(&.soft_deleted_at).soft_deleted_at.is_not_nil"}},{"html_id":"restore:Int64-instance-method","name":"restore","doc":"Bulk restore records\n\n## Example\n\nThis will restore `Article` records updated in the last week:\n\n```\nArticleQuery.new.updated_at.gt(1.week.ago).restore\n```","summary":"

Bulk restore records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L60"},"def":{"name":"restore","return_type":"Int64","visibility":"Public","body":"only_soft_deleted.update(soft_deleted_at: nil)"}},{"html_id":"soft_delete-instance-method","name":"soft_delete","doc":"Bulk soft delete records\n\n## Example\n\nThis will soft delete all `Article` record older than 1 year:\n\n```\nArticleQuery.new.created_at.lt(1.year.ago).soft_delete\n```","summary":"

Bulk soft delete records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L47"},"def":{"name":"soft_delete","visibility":"Public","body":"only_kept.update(soft_deleted_at: Time.utc)"}},{"html_id":"soft_deleted_at-instance-method","name":"soft_deleted_at","abstract":true,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":64,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L64"},"def":{"name":"soft_deleted_at","visibility":"Public","body":""}},{"html_id":"with_soft_deleted-instance-method","name":"with_soft_deleted","doc":"Returns all records\n\nThis works be removing where clauses for the `soft_deleted_at` column.\nThat means you can do `MyQuery.new.only_kept.with_soft_deleted` and you\nwill get all records, not just the kept ones.","summary":"

Returns all records

","abstract":false,"location":{"filename":"src/avram/soft_delete/query.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/soft_delete/query.cr#L34"},"def":{"name":"with_soft_deleted","visibility":"Public","body":"reset_where(&.soft_deleted_at)"}}]}]},{"html_id":"avram/Avram/SpecHelper","path":"Avram/SpecHelper.html","kind":"module","full_name":"Avram::SpecHelper","name":"SpecHelper","abstract":false,"locations":[{"filename":"src/avram/spec_helper.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/spec_helper.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"NO_CASCADE","name":"NO_CASCADE","value":"\"no_cascade\""},{"id":"NO_RESTART_IDENTITY","name":"NO_RESTART_IDENTITY","value":"\"no_restart_identity\""},{"id":"TRUNCATE","name":"TRUNCATE","value":"\"truncate\""}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"wrap_spec_in_transaction(spec:Spec::Example::Procsy,*databases)-class-method","name":"wrap_spec_in_transaction","abstract":false,"args":[{"name":"spec","external_name":"spec","restriction":"Spec::Example::Procsy"},{"name":"databases","external_name":"databases","restriction":""}],"args_string":"(spec : Spec::Example::Procsy, *databases)","args_html":"(spec : Spec::Example::Procsy, *databases)","location":{"filename":"src/avram/spec_helper.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/spec_helper.cr#L12"},"def":{"name":"wrap_spec_in_transaction","args":[{"name":"spec","external_name":"spec","restriction":"Spec::Example::Procsy"},{"name":"databases","external_name":"databases","restriction":""}],"splat_index":1,"visibility":"Public","body":"if named_args = use_truncation?(spec)\n spec.run\n return databases.each(&.truncate(**named_args))\nend\ntracked_transactions = [] of DB::Transaction\ndatabases.each do |database|\n database.lock_id = Fiber.current.object_id\n database.connections.values.each do |conn|\n tracked_transactions << conn.begin_transaction.tap(&._avram_joinable = false)\n end\n database.setup_connection do |conn|\n tracked_transactions << conn.begin_transaction.tap(&._avram_joinable = false)\n end\nend\nspec.run\ntracked_transactions.each do |transaction|\n if transaction.closed? || transaction.connection.closed?\n next\n end\n transaction.rollback\n transaction.connection.release\nend\ntracked_transactions.clear\ndatabases.each do |database|\n database.connections.clear\n database.setup_connection do\n end\nend\n"}}],"macros":[{"html_id":"use_transactional_specs(*databases)-macro","name":"use_transactional_specs","abstract":false,"args":[{"name":"databases","external_name":"databases","restriction":""}],"args_string":"(*databases)","args_html":"(*databases)","location":{"filename":"src/avram/spec_helper.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/spec_helper.cr#L6"},"def":{"name":"use_transactional_specs","args":[{"name":"databases","external_name":"databases","restriction":""}],"splat_index":0,"visibility":"Public","body":" Spec.around_each do |spec|\n Avram::SpecHelper.wrap_spec_in_transaction(spec, \n{{ databases.splat }}\n)\n \nend\n \n"}}]},{"html_id":"avram/Avram/TableFor","path":"Avram/TableFor.html","kind":"module","full_name":"Avram::TableFor","name":"TableFor","abstract":false,"locations":[{"filename":"src/avram/table_for.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/table_for.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Migrator/StatementHelpers","kind":"module","full_name":"Avram::Migrator::StatementHelpers","name":"StatementHelpers"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"macros":[{"html_id":"table_for(model)-macro","name":"table_for","doc":"Returns a `Symbol` representing the table name\nof the `model` passed in.\ne.g. `User` => `:users`","summary":"

Returns a Symbol representing the table name of the model passed in.

","abstract":false,"args":[{"name":"model","external_name":"model","restriction":""}],"args_string":"(model)","args_html":"(model)","location":{"filename":"src/avram/table_for.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/table_for.cr#L5"},"def":{"name":"table_for","args":[{"name":"model","external_name":"model","restriction":""}],"visibility":"Public","body":" Wordsmith::Inflector.pluralize(\n{{ model.stringify }}\n.gsub(\"::\", \"\").underscore)\n \n"}}]},{"html_id":"avram/Avram/TableName","path":"Avram/TableName.html","kind":"alias","full_name":"Avram::TableName","name":"TableName","abstract":false,"locations":[{"filename":"src/avram.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram.cr#L39"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(String | Symbol)","aliased_html":"String | Symbol","const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"}},{"html_id":"avram/Avram/Type","path":"Avram/Type.html","kind":"module","full_name":"Avram::Type","name":"Type","abstract":false,"locations":[{"filename":"src/avram/type.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/Uploadable/Lucky","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky"},{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"},{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"},{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"},{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"},{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"},{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"},{"html_id":"avram/JSON/Any/Lucky","kind":"module","full_name":"JSON::Any::Lucky","name":"Lucky"},{"html_id":"avram/JSON/Serializable/Lucky","kind":"module","full_name":"JSON::Serializable::Lucky(T)","name":"Lucky"},{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"},{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"},{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"},{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"instance_methods":[{"html_id":"from_db!(value)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L6"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"parse!(value)"}},{"html_id":"parse(value:Nil)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Nil"}],"args_string":"(value : Nil)","args_html":"(value : Nil)","location":{"filename":"src/avram/type.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L10"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Nil"}],"visibility":"Public","body":"SuccessfulCast(Nil).new(nil)"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/type.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L14"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"casts = values.map do |value|\n parse(value)\nend\nif casts.all?(SuccessfulCast)\n values = casts.map do |c|\n (c.as(SuccessfulCast)).value\n end\n parse(values)\nelse\n FailedCast.new\nend\n"}},{"html_id":"parse!(value)-instance-method","name":"parse!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L24"},"def":{"name":"parse!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"((parse(value)).as(SuccessfulCast)).value"}},{"html_id":"to_db(value:Nil)-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Nil"}],"args_string":"(value : Nil)","args_html":"(value : Nil)","location":{"filename":"src/avram/type.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L28"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Nil"}],"visibility":"Public","body":"nil"}},{"html_id":"to_db!(value)-instance-method","name":"to_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/type.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L32"},"def":{"name":"to_db!","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"parsed_value = parse!(value)\nto_db(parsed_value)\n"}}],"types":[{"html_id":"avram/Avram/Type/FailedCast","path":"Avram/Type/FailedCast.html","kind":"class","full_name":"Avram::Type::FailedCast","name":"FailedCast","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/type.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L44"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"},"instance_methods":[{"html_id":"value-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/type.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L45"},"def":{"name":"value","visibility":"Public","body":"nil"}}]},{"html_id":"avram/Avram/Type/SuccessfulCast","path":"Avram/Type/SuccessfulCast.html","kind":"class","full_name":"Avram::Type::SuccessfulCast(T)","name":"SuccessfulCast","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/type.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L37"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"},"constructors":[{"html_id":"new(value:T)-class-method","name":"new","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T)","args_html":"(value : T)","location":{"filename":"src/avram/type.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L40"},"def":{"name":"new","args":[{"name":"value","external_name":"value","restriction":"T"}],"visibility":"Public","body":"_ = SuccessfulCast(T).allocate\n_.initialize(value)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"value-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/type.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/type.cr#L38"},"def":{"name":"value","visibility":"Public","body":"@value"}}]}]},{"html_id":"avram/Avram/UnsupportedQueryError","path":"Avram/UnsupportedQueryError.html","kind":"class","full_name":"Avram::UnsupportedQueryError","name":"UnsupportedQueryError","abstract":false,"superclass":{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},"ancestors":[{"html_id":"avram/Avram/AvramError","kind":"class","full_name":"Avram::AvramError","name":"AvramError"},{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/errors.cr","line_number":76,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L76"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Raised when an unimplemented or deprecated query is made.","summary":"

Raised when an unimplemented or deprecated query is made.

","constructors":[{"html_id":"new(message:String)-class-method","name":"new","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(message : String)","args_html":"(message : String)","location":{"filename":"src/avram/errors.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/errors.cr#L77"},"def":{"name":"new","args":[{"name":"message","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/Avram/Uploadable","path":"Avram/Uploadable.html","kind":"module","full_name":"Avram::Uploadable","name":"Uploadable","abstract":false,"locations":[{"filename":"src/avram/uploadable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Lucky/UploadedFile","kind":"class","full_name":"Lucky::UploadedFile","name":"UploadedFile"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/uploadable.cr","line_number":9,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L9"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","doc":"This should test if the filename is a blank string.","summary":"

This should test if the filename is a blank string.

","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L7"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":""}},{"html_id":"filename:String-instance-method","name":"filename","doc":"Typically, this should return the filename as found in the `metadata`.","summary":"

Typically, this should return the filename as found in the #metadata.

","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L5"},"def":{"name":"filename","return_type":"String","visibility":"Public","body":""}},{"html_id":"metadata:HTTP::FormData::FileMetadata-instance-method","name":"metadata","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L3"},"def":{"name":"metadata","return_type":"HTTP::FormData::FileMetadata","visibility":"Public","body":""}},{"html_id":"tempfile:File-instance-method","name":"tempfile","abstract":true,"location":{"filename":"src/avram/uploadable.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L2"},"def":{"name":"tempfile","return_type":"File","visibility":"Public","body":""}}],"types":[{"html_id":"avram/Avram/Uploadable/Lucky","path":"Avram/Uploadable/Lucky.html","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/uploadable.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L13"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Avram/Uploadable/Lucky","kind":"module","full_name":"Avram::Uploadable::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Avram/Uploadable","kind":"module","full_name":"Avram::Uploadable","name":"Uploadable"},"instance_methods":[{"html_id":"parse(value:Avram::Uploadable)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Avram::Uploadable"}],"args_string":"(value : Avram::Uploadable)","args_html":"(value : Avram::Uploadable)","location":{"filename":"src/avram/uploadable.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L16"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Avram::Uploadable"}],"visibility":"Public","body":"SuccessfulCast(Avram::Uploadable).new(value)"}},{"html_id":"parse(values:Array(Avram::Uploadable))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Avram::Uploadable)"}],"args_string":"(values : Array(Avram::Uploadable))","args_html":"(values : Array(Avram::Uploadable))","location":{"filename":"src/avram/uploadable.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L20"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Avram::Uploadable)"}],"visibility":"Public","body":"SuccessfulCast.new(values)"}},{"html_id":"parse(value:String|Nil)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String | ::Nil"}],"args_string":"(value : String | Nil)","args_html":"(value : String | Nil)","location":{"filename":"src/avram/uploadable.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String | ::Nil"}],"visibility":"Public","body":"FailedCast.new"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/uploadable.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/uploadable.cr#L28"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"FailedCast.new"}}]}]},{"html_id":"avram/Avram/Upsert","path":"Avram/Upsert.html","kind":"module","full_name":"Avram::Upsert","name":"Upsert","abstract":false,"locations":[{"filename":"src/avram/upsert.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/upsert.cr#L4"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"Adds the ability to \"create or update\" (upsert) to `Avram::SaveOperation`\n\nThis is included in SaveOperations by default. See `upsert_lookup_columns` for usage details.","summary":"

Adds the ability to "create or update" (upsert) to Avram::SaveOperation

","macros":[{"html_id":"upsert_lookup_columns(*attribute_names)-macro","name":"upsert_lookup_columns","doc":"Defines the columns Avram should use when performing an `upsert`\n\nAn \"upsert\" is short for \"update or insert\", or in Avram terminology a\n\"create or update\". If the values in an operation conflict with an existing\nrecord in the database, Avram updates that record. If there is no\nconflicting record, then Avram will create new one.\n\nIn Avram, you must define which columns Avram should look at when\ndetermining if a conflicting record exists. This is done using the macro\n`Avram::Upsert.upsert_lookup_columns`\n\n**Note:** In almost _every_ case the `upsert_lookup_columns` should have a **unique index** defined\nin the database to ensure no conflicting records are created, even from outside Avram.\n\n## Full Example\n\n```\nclass User < BaseModel\n table do\n column name : String\n column email : String # This column has a unique index\n end\nend\n\nclass SaveUser < User::SaveOperation\n # Can be one or more columns. In this case we choose just :email\n upsert_lookup_columns :email\nend\n\n# Will create a new row in the database since no row with\n# `email: \"bob@example.com\"` exists yet\nSaveUser.upsert!(name: \"Bobby\", email: \"bob@example.com\")\n\n# Will update the name on the row we just created since the email is\n# the same as one in the database\nSaveUser.upsert!(name: \"Bob\", email: \"bob@example.com\")\n```\n\n## Difference between `upsert` and `upsert!`\n\nThere is an `upsert` and `upsert!` that work similarly to `create` and `create!`.\n`upsert!` will raise an error if the operation is invalid. Whereas `upsert`\nwill yield the operation and the new record if the operation is valid, or\nthe operation and `nil` if it is invalid.\n\n```\n# Will raise because the name is blank\nSaveUser.upsert!(name: \"\", email: \"bob@example.com\")\n\n# Operation is invalid because name is blank\nSaveUser.upsert(name: \"\", email: \"bob@example.com\") do |operation, user|\n # `user` is `nil` because the operation is invalid.\n # If the `name` was valid `user` would be the newly created user\nend\n````","summary":"

Defines the columns Avram should use when performing an upsert

","abstract":false,"args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"args_string":"(*attribute_names)","args_html":"(*attribute_names)","location":{"filename":"src/avram/upsert.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/upsert.cr#L60"},"def":{"name":"upsert_lookup_columns","args":[{"name":"attribute_names","external_name":"attribute_names","restriction":""}],"splat_index":0,"visibility":"Public","body":" def self.upsert!(*args, **named_args) : T\n operation = new(*args, **named_args)\n \nexisting_record = find_existing_unique_record(operation)\n\n if \nexisting_record\n operation = new(\nexisting_record, *args, **named_args)\n \nend\n\n operation.save!\n \nend\n\n def self.upsert(*args, **named_args)\n operation = new(*args, **named_args)\n \nexisting_record = find_existing_unique_record(operation)\n\n if \nexisting_record\n operation = new(\nexisting_record, *args, **named_args)\n \nend\n\n operation.save\n yield operation, operation.record\n \nend\n\n def self.find_existing_unique_record(operation) : T?\n T::BaseQuery.new\n \n{% for attribute in attribute_names %}\n .{{ attribute.id }}.nilable_eq(operation.{{ attribute.id }}.value)\n {% end %}\n\n .first?\n \nend\n \n"}}]},{"html_id":"avram/Avram/Validations","path":"Avram/Validations.html","kind":"module","full_name":"Avram::Validations","name":"Validations","abstract":false,"locations":[{"filename":"src/avram/validations.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"extended_modules":[{"html_id":"avram/Avram/Validations","kind":"module","full_name":"Avram::Validations","name":"Validations"}],"including_types":[{"html_id":"avram/Avram/DeleteOperation","kind":"class","full_name":"Avram::DeleteOperation(T)","name":"DeleteOperation"},{"html_id":"avram/Avram/Operation","kind":"class","full_name":"Avram::Operation","name":"Operation"},{"html_id":"avram/Avram/SaveOperation","kind":"class","full_name":"Avram::SaveOperation(T)","name":"SaveOperation"}],"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"doc":"A number of methods for validating Avram::Attributes\nAll validation methods return `Bool`. `false` if any error is added, otherwise `true`\n\nThis module is included in `Avram::Operation`, `Avram::SaveOperation`, and `Avram::DeleteOperation`","summary":"

A number of methods for validating Avram::Attributes All validation methods return Bool.

","instance_methods":[{"html_id":"validate_acceptance_of(attribute:Avram::Attribute(Bool),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_acceptance_of)):Bool-instance-method","name":"validate_acceptance_of","doc":"Validate whether an attribute was accepted (`true`)\n\nThis validation is only for Boolean Attributes. The attribute will be marked\nas invalid for any value other than `true`.","summary":"

Validate whether an attribute was accepted (true)

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Bool)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_acceptance_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(attribute : Avram::Attribute(Bool), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_acceptance_of)) : Bool","args_html":"(attribute : Avram::Attribute(Bool), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_acceptance_of)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":109,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L109"},"def":{"name":"validate_acceptance_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Bool)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_acceptance_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif attribute.value != true\n attribute.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_at_most_one_filled(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_at_most_one_filled)):Bool-instance-method","name":"validate_at_most_one_filled","doc":"Validates that at most one attribute is filled\n\nIf more than one attribute is filled it will mark all but the first filled\nfield invalid.","summary":"

Validates that at most one attribute is filled

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_at_most_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_at_most_one_filled)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_at_most_one_filled)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L39"},"def":{"name":"validate_at_most_one_filled","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_at_most_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = true\npresent_attributes = attributes.reject() do |__arg1|\n __arg1.value.blank?\nend\nif present_attributes.size > 1\n (present_attributes.skip(1)).each do |attr|\n attr.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_confirmation_of(attribute:Avram::Attribute(T),withconfirmation_attribute:Avram::Attribute(T),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_confirmation_of)):BoolforallT-instance-method","name":"validate_confirmation_of","doc":"Validates that the values of two attributes are the same\n\nTakes two attributes and if the values are different the second attribute\n(`with`/`confirmation_attribute`) will be marked as invalid\n\nExample:\n\n```\nvalidate_confirmation_of password, with: password_confirmation\n```\n\nIf `password_confirmation` does not match, it will be marked invalid.","summary":"

Validates that the values of two attributes are the same

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"confirmation_attribute","external_name":"with","restriction":"Avram::Attribute(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_confirmation_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(attribute : Avram::Attribute(T), with confirmation_attribute : Avram::Attribute(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_confirmation_of)) : Bool forall T","args_html":"(attribute : Avram::Attribute(T), with confirmation_attribute : Avram::Attribute(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_confirmation_of)) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":134,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L134"},"def":{"name":"validate_confirmation_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"confirmation_attribute","external_name":"with","restriction":"Avram::Attribute(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_confirmation_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif attribute.value != confirmation_attribute.value\n confirmation_attribute.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_exactly_one_filled(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_exactly_one_filled)):Bool-instance-method","name":"validate_exactly_one_filled","doc":"Validates that at exactly one attribute is filled\n\nThis validation is used by `Avram::Polymorphic.polymorphic` to ensure\nthat a required polymorphic association is set.\n\nIf more than one attribute is filled it will mark all but the first filled\nfield invalid.\n\nIf no field is filled, the first field will be marked as invalid.","summary":"

Validates that at exactly one attribute is filled

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exactly_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exactly_one_filled)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exactly_one_filled)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":65,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L65"},"def":{"name":"validate_exactly_one_filled","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exactly_one_filled)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = validate_at_most_one_filled(*attributes)\npresent_attributes = attributes.reject() do |__arg2|\n __arg2.value.blank?\nend\nif present_attributes.size.zero?\n attributes.first.add_error(message)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_format_of(attribute:Avram::Attribute(String),withregex:Regex,match:Bool=true,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_format_of),allow_nil:Bool=false):Bool-instance-method","name":"validate_format_of","doc":"Validates that the passed in attributes matches the given regex\n\n```\nvalidate_format_of email, with: /[^@]+@[^\\.]+\\..+/\n```\n\nAlternatively, the `match` argument can be set to `false` to not match the\ngiven regex.","summary":"

Validates that the passed in attributes matches the given regex

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String)"},{"name":"regex","external_name":"with","restriction":"Regex"},{"name":"match","default_value":"true","external_name":"match","restriction":"Bool"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_format_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String), with regex : Regex, match : Bool = true, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_format_of), allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(String), with regex : Regex, match : Bool = true, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_format_of), allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":315,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L315"},"def":{"name":"validate_format_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String)"},{"name":"regex","external_name":"with","restriction":"Regex"},{"name":"match","default_value":"true","external_name":"match","restriction":"Bool"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_format_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"if allow_nil && attribute.value.nil?\nelse\n matching = attribute.value.to_s.match(regex)\n if (match && (!matching)) || ((!match) && matching)\n attribute.add_error(message)\n return false\n end\nend\ntrue\n"}},{"html_id":"validate_inclusion_of(attribute:Avram::Attribute(T),inallowed_values:Enumerable(T),message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_inclusion_of),allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_inclusion_of","doc":"Validates that the attribute value is in a list of allowed values\n\n```\nvalidate_inclusion_of state, in: [\"NY\", \"MA\"]\n```\n\nThis will mark `state` as invalid unless the value is `\"NY\"`, or `\"MA\"`.","summary":"

Validates that the attribute value is in a list of allowed values

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"allowed_values","external_name":"in","restriction":"Enumerable(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_inclusion_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(T), in allowed_values : Enumerable(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_inclusion_of), allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(T), in allowed_values : Enumerable(T), message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_inclusion_of), allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":155,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L155"},"def":{"name":"validate_inclusion_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(T)"},{"name":"allowed_values","external_name":"in","restriction":"Enumerable(T)"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_inclusion_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif value = attribute.value\n if !(allowed_values.includes?(value))\n attribute.add_error(message)\n no_errors = false\n end\nelse\n if !allow_nil\n attribute.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_numeric(attribute:Avram::Attribute(Number),greater_than=nil,less_than=nil,message=nil,allow_nil:Bool=false):Bool-instance-method","name":"validate_numeric","summary":"

DEPRECATED Use validate_numeric with at_least/no_more_than instead of greater_than/less_than

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"greater_than","default_value":"nil","external_name":"greater_than","restriction":""},{"name":"less_than","default_value":"nil","external_name":"less_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(Number), greater_than = nil, less_than = nil, message = nil, allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(Number), greater_than = nil, less_than = nil, message = nil, allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":246,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L246"},"def":{"name":"validate_numeric","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"greater_than","default_value":"nil","external_name":"greater_than","restriction":""},{"name":"less_than","default_value":"nil","external_name":"less_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"validate_numeric(attribute, at_least: greater_than, no_more_than: less_than, message: message, allow_nil: allow_nil)"}},{"html_id":"validate_numeric(attribute:Avram::Attribute(Number),*,at_least=nil,no_more_than=nil,message=nil,allow_nil:Bool=false):Bool-instance-method","name":"validate_numeric","doc":"Validate a number is `at_least` and/or `no_more_than`\n\n```\nvalidate_numeric age, at_least: 18\nvalidate_numeric count, at_least: 0, no_more_than: 1200\n```\nameba:disable Metrics/CyclomaticComplexity","summary":"

Validate a number is at_least and/or no_more_than

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"","external_name":"","restriction":""},{"name":"at_least","default_value":"nil","external_name":"at_least","restriction":""},{"name":"no_more_than","default_value":"nil","external_name":"no_more_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(Number), *, at_least = nil, no_more_than = nil, message = nil, allow_nil : Bool = false) : Bool","args_html":"(attribute : Avram::Attribute(Number), *, at_least = nil, no_more_than = nil, message = nil, allow_nil : Bool = false) : Bool","location":{"filename":"src/avram/validations.cr","line_number":263,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L263"},"def":{"name":"validate_numeric","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(Number)"},{"name":"","external_name":"","restriction":""},{"name":"at_least","default_value":"nil","external_name":"at_least","restriction":""},{"name":"no_more_than","default_value":"nil","external_name":"no_more_than","restriction":""},{"name":"message","default_value":"nil","external_name":"message","restriction":""},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"splat_index":1,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif (at_least && no_more_than) && at_least > no_more_than\n raise(ImpossibleValidation.new(attribute: attribute.name, message: \"number at least #{at_least} but no more than #{no_more_than}\"))\nend\nnumber = attribute.value\nif number.nil?\n if allow_nil\n else\n attribute.add_error(Avram.settings.i18n_backend.get(:validate_numeric_nil))\n no_errors = false\n end\n return no_errors\nend\nif at_least && number < at_least\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_numeric_min))) % at_least)\n no_errors = false\nend\nif no_more_than && number > no_more_than\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_numeric_max))) % no_more_than)\n no_errors = false\nend\nno_errors\n"}},{"html_id":"validate_required(*attributes,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_required)):Bool-instance-method","name":"validate_required","doc":"Validates that the passed in attributes have values\n\nYou can pass in one or more attributes at a time. The attribute will be\nmarked as invalid if the value is `nil`, or \"blank\" (empty strings or strings with just whitespace)\n\n`false` is not considered invalid.\n\n```\nvalidate_required name, age, email\n```","summary":"

Validates that the passed in attributes have values

","abstract":false,"args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_required)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"args_string":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_required)) : Bool","args_html":"(*attributes, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_required)) : Bool","location":{"filename":"src/avram/validations.cr","line_number":90,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L90"},"def":{"name":"validate_required","args":[{"name":"attributes","external_name":"attributes","restriction":""},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_required)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"}],"splat_index":0,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nattributes.each do |attribute|\n if attribute.value.blank_for_validates_required? && (!attribute.allow_blank?)\n attribute.add_error(message)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_size_of(attribute:Avram::Attribute(String)|Avram::Attribute(Array(T)),min:Number|Nil=nil,max:Number|Nil=nil,message:Avram::Attribute::ErrorMessage|Nil=nil,allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_size_of","doc":"Validate the size of a `String` or `Array` is within a `min` and/or `max`\n\n```\nvalidate_size_of feedback, min: 18, max: 100\nvalidate_size_of password, min: 12\nvalidate_size_of options, max: 10\n```\nameba:disable Metrics/CyclomaticComplexity","summary":"

Validate the size of a String or Array is within a min and/or max

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"min","default_value":"nil","external_name":"min","restriction":"Number | ::Nil"},{"name":"max","default_value":"nil","external_name":"max","restriction":"Number | ::Nil"},{"name":"message","default_value":"nil","external_name":"message","restriction":"Avram::Attribute::ErrorMessage | ::Nil"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), min : Number | Nil = nil, max : Number | Nil = nil, message : Avram::Attribute::ErrorMessage | Nil = nil, allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), min : Number | Nil = nil, max : Number | Nil = nil, message : Avram::Attribute::ErrorMessage | Nil = nil, allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":210,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L210"},"def":{"name":"validate_size_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"min","default_value":"nil","external_name":"min","restriction":"Number | ::Nil"},{"name":"max","default_value":"nil","external_name":"max","restriction":"Number | ::Nil"},{"name":"message","default_value":"nil","external_name":"message","restriction":"Avram::Attribute::ErrorMessage | ::Nil"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"return_type":"Bool","visibility":"Public","body":"no_errors = true\nif ((!min.nil?) && (!max.nil?)) && min > max\n raise(ImpossibleValidation.new(attribute: attribute.name, message: \"size greater than #{min} but less than #{max}\"))\nend\nif allow_nil && attribute.value.nil?\nelse\n size = attribute.value.try(&.size) || 0\n if (!min.nil?) && size < min\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_min_size_of))) % min)\n no_errors = false\n end\n if (!max.nil?) && size > max\n attribute.add_error((message || (Avram.settings.i18n_backend.get(:validate_max_size_of))) % max)\n no_errors = false\n end\nend\nno_errors\n"}},{"html_id":"validate_size_of(attribute:Avram::Attribute(String)|Avram::Attribute(Array(T)),*,isexact_size:Number,message:Avram::Attribute::ErrorMessage=Avram.settings.i18n_backend.get(:validate_exact_size_of),allow_nil:Bool=false):BoolforallT-instance-method","name":"validate_size_of","doc":"Validate the size of a `String` or `Array` is exactly a certain size\n\n```\nvalidate_size_of api_key, is: 32\nvalidate_size_of theme_colors, is: 4\n```","summary":"

Validate the size of a String or Array is exactly a certain size

","abstract":false,"args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"","external_name":"","restriction":""},{"name":"exact_size","external_name":"is","restriction":"Number"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exact_size_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"args_string":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), *, is exact_size : Number, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exact_size_of), allow_nil : Bool = false) : Bool forall T","args_html":"(attribute : Avram::Attribute(String) | Avram::Attribute(Array(T)), *, is exact_size : Number, message : Avram::Attribute::ErrorMessage = Avram.settings.i18n_backend.get(:validate_exact_size_of), allow_nil : Bool = false) : Bool forall T","location":{"filename":"src/avram/validations.cr","line_number":183,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L183"},"def":{"name":"validate_size_of","args":[{"name":"attribute","external_name":"attribute","restriction":"Avram::Attribute(String) | Avram::Attribute(Array(T))"},{"name":"","external_name":"","restriction":""},{"name":"exact_size","external_name":"is","restriction":"Number"},{"name":"message","default_value":"Avram.settings.i18n_backend.get(:validate_exact_size_of)","external_name":"message","restriction":"Avram::Attribute::ErrorMessage"},{"name":"allow_nil","default_value":"false","external_name":"allow_nil","restriction":"Bool"}],"splat_index":1,"return_type":"Bool","visibility":"Public","body":"no_errors = true\nsize = attribute.value.try(&.size) || 0\nif size != exact_size\n if !(allow_nil && attribute.value.nil?)\n attribute.add_error(message % exact_size)\n no_errors = false\n end\nend\nno_errors\n"}}],"macros":[{"html_id":"default_validations-macro","name":"default_validations","doc":"Defines an instance method that gets called\nduring validation of an operation. Define your default\nvalidations inside of the block.\n```\ndefault_validations do\n validate_required some_attribute\nend\n```","summary":"

Defines an instance method that gets called during validation of an operation.

","abstract":false,"location":{"filename":"src/avram/validations.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/validations.cr#L22"},"def":{"name":"default_validations","visibility":"Public","body":" \n# :nodoc:\n\n def default_validations\n \n{% if @type.methods.map(&.name).includes?((:default_validations).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}}]},{"html_id":"avram/Avram/Where","path":"Avram/Where.html","kind":"module","full_name":"Avram::Where","name":"Where","abstract":false,"locations":[{"filename":"src/avram/where.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram","kind":"module","full_name":"Avram","name":"Avram"},"types":[{"html_id":"avram/Avram/Where/Condition","path":"Avram/Where/Condition.html","kind":"class","full_name":"Avram::Where::Condition","name":"Condition","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L19"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/PrecedenceEnd","kind":"class","full_name":"Avram::Where::PrecedenceEnd","name":"PrecedenceEnd"},{"html_id":"avram/Avram/Where/PrecedenceStart","kind":"class","full_name":"Avram::Where::PrecedenceStart","name":"PrecedenceStart"},{"html_id":"avram/Avram/Where/Raw","kind":"class","full_name":"Avram::Where::Raw","name":"Raw"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L24"},"def":{"name":"clone","visibility":"Public","body":"self"}},{"html_id":"conjunction:Conjunction-instance-method","name":"conjunction","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L20"},"def":{"name":"conjunction","return_type":"Conjunction","visibility":"Public","body":"@conjunction"}},{"html_id":"conjunction=(conjunction:Conjunction)-instance-method","name":"conjunction=","abstract":false,"args":[{"name":"conjunction","external_name":"conjunction","restriction":"Conjunction"}],"args_string":"(conjunction : Conjunction)","args_html":"(conjunction : Conjunction)","location":{"filename":"src/avram/where.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L20"},"def":{"name":"conjunction=","args":[{"name":"conjunction","external_name":"conjunction","restriction":"Conjunction"}],"visibility":"Public","body":"@conjunction = conjunction"}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":true,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L22"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":""}}]},{"html_id":"avram/Avram/Where/Conjunction","path":"Avram/Where/Conjunction.html","kind":"enum","full_name":"Avram::Where::Conjunction","name":"Conjunction","abstract":false,"ancestors":[{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L2"}],"repository_name":"avram","program":false,"enum":true,"alias":false,"const":false,"constants":[{"id":"And","name":"And","value":"0"},{"id":"Or","name":"Or","value":"1"},{"id":"None","name":"None","value":"2"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"and?-instance-method","name":"and?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L3"},"def":{"name":"and?","visibility":"Public","body":"self == And"}},{"html_id":"none?-instance-method","name":"none?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L5"},"def":{"name":"none?","visibility":"Public","body":"self == None"}},{"html_id":"or?-instance-method","name":"or?","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L4"},"def":{"name":"or?","visibility":"Public","body":"self == Or"}},{"html_id":"to_s-instance-method","name":"to_s","doc":"Returns a `String` representation of this enum member.\nIn the case of regular enums, this is just the name of the member.\nIn the case of flag enums, it's the names joined by vertical bars, or \"None\",\nif the value is zero.\n\nIf an enum's value doesn't match a member's value, the raw value\nis returned as a string.\n\n```\nColor::Red.to_s # => \"Red\"\nIOMode::None.to_s # => \"None\"\n(IOMode::Read | IOMode::Write).to_s # => \"Read | Write\"\n\nColor.new(10).to_s # => \"10\"\n```","summary":"

Returns a String representation of this enum member.

","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L7"},"def":{"name":"to_s","visibility":"Public","body":"case self\nwhen .and?\n \"AND\"\nwhen .or?\n \"OR\"\nelse\n \"\"\nend"}}]},{"html_id":"avram/Avram/Where/Equal","path":"Avram/Where/Equal.html","kind":"class","full_name":"Avram::Where::Equal","name":"Equal","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":92,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L92"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotEqual-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":97,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L97"},"def":{"name":"negated","return_type":"NotEqual","visibility":"Public","body":"NotEqual.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":93,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L93"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"=\""}}]},{"html_id":"avram/Avram/Where/Excludes","path":"Avram/Where/Excludes.html","kind":"class","full_name":"Avram::Where::Excludes","name":"Excludes","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":234,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L234"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Includes-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":239,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L239"},"def":{"name":"negated","return_type":"Includes","visibility":"Public","body":"Includes.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":235,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L235"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!= ALL\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":243,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L243"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{placeholder_supplier.call} #{operator} (#{column})\""}}]},{"html_id":"avram/Avram/Where/GreaterThan","path":"Avram/Where/GreaterThan.html","kind":"class","full_name":"Avram::Where::GreaterThan","name":"GreaterThan","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":112,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L112"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:LessThanOrEqualTo-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":117,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L117"},"def":{"name":"negated","return_type":"LessThanOrEqualTo","visibility":"Public","body":"LessThanOrEqualTo.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":113,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L113"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\">\""}}]},{"html_id":"avram/Avram/Where/GreaterThanOrEqualTo","path":"Avram/Where/GreaterThanOrEqualTo.html","kind":"class","full_name":"Avram::Where::GreaterThanOrEqualTo","name":"GreaterThanOrEqualTo","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":122,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L122"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:LessThan-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":127,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L127"},"def":{"name":"negated","return_type":"LessThan","visibility":"Public","body":"LessThan.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":123,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L123"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\">=\""}}]},{"html_id":"avram/Avram/Where/Ilike","path":"Avram/Where/Ilike.html","kind":"class","full_name":"Avram::Where::Ilike","name":"Ilike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":162,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L162"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotIlike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":167,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L167"},"def":{"name":"negated","return_type":"NotIlike","visibility":"Public","body":"NotIlike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":163,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L163"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"ILIKE\""}}]},{"html_id":"avram/Avram/Where/In","path":"Avram/Where/In.html","kind":"class","full_name":"Avram::Where::In","name":"In","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":192,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L192"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotIn-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":197,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L197"},"def":{"name":"negated","return_type":"NotIn","visibility":"Public","body":"NotIn.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":193,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L193"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"= ANY\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":201,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L201"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} (#{placeholder_supplier.call})\""}}]},{"html_id":"avram/Avram/Where/Includes","path":"Avram/Where/Includes.html","kind":"class","full_name":"Avram::Where::Includes","name":"Includes","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":220,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L220"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Excludes-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":225,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L225"},"def":{"name":"negated","return_type":"Excludes","visibility":"Public","body":"Excludes.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":221,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L221"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"= ANY\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":229,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L229"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{placeholder_supplier.call} #{operator} (#{column})\""}}]},{"html_id":"avram/Avram/Where/LessThan","path":"Avram/Where/LessThan.html","kind":"class","full_name":"Avram::Where::LessThan","name":"LessThan","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":132,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L132"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:GreaterThanOrEqualTo-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":137,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L137"},"def":{"name":"negated","return_type":"GreaterThanOrEqualTo","visibility":"Public","body":"GreaterThanOrEqualTo.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":133,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L133"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"<\""}}]},{"html_id":"avram/Avram/Where/LessThanOrEqualTo","path":"Avram/Where/LessThanOrEqualTo.html","kind":"class","full_name":"Avram::Where::LessThanOrEqualTo","name":"LessThanOrEqualTo","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":142,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L142"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:GreaterThan-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":147,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L147"},"def":{"name":"negated","return_type":"GreaterThan","visibility":"Public","body":"GreaterThan.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":143,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L143"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"<=\""}}]},{"html_id":"avram/Avram/Where/Like","path":"Avram/Where/Like.html","kind":"class","full_name":"Avram::Where::Like","name":"Like","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":152,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L152"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotLike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":157,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L157"},"def":{"name":"negated","return_type":"NotLike","visibility":"Public","body":"NotLike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":153,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L153"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"LIKE\""}}]},{"html_id":"avram/Avram/Where/NotEqual","path":"Avram/Where/NotEqual.html","kind":"class","full_name":"Avram::Where::NotEqual","name":"NotEqual","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":102,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L102"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Equal-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":107,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L107"},"def":{"name":"negated","return_type":"Equal","visibility":"Public","body":"Equal.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":103,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L103"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!=\""}}]},{"html_id":"avram/Avram/Where/NotIlike","path":"Avram/Where/NotIlike.html","kind":"class","full_name":"Avram::Where::NotIlike","name":"NotIlike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":182,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L182"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Ilike-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":187,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L187"},"def":{"name":"negated","return_type":"Ilike","visibility":"Public","body":"Ilike.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":183,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L183"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"NOT ILIKE\""}}]},{"html_id":"avram/Avram/Where/NotIn","path":"Avram/Where/NotIn.html","kind":"class","full_name":"Avram::Where::NotIn","name":"NotIn","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":206,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L206"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:In-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":211,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L211"},"def":{"name":"negated","return_type":"In","visibility":"Public","body":"In.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":207,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L207"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"!= ALL\""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":215,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L215"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} (#{placeholder_supplier.call})\""}}]},{"html_id":"avram/Avram/Where/NotLike","path":"Avram/Where/NotLike.html","kind":"class","full_name":"Avram::Where::NotLike","name":"NotLike","abstract":false,"superclass":{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":172,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L172"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Like-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":177,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L177"},"def":{"name":"negated","return_type":"Like","visibility":"Public","body":"Like.new(column, value)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":173,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L173"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"NOT LIKE\""}}]},{"html_id":"avram/Avram/Where/NotNull","path":"Avram/Where/NotNull.html","kind":"class","full_name":"Avram::Where::NotNull","name":"NotNull","abstract":false,"superclass":{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L82"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:Null-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":87,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L87"},"def":{"name":"negated","return_type":"Null","visibility":"Public","body":"Null.new(column)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":83,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L83"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"IS NOT\""}}]},{"html_id":"avram/Avram/Where/Null","path":"Avram/Where/Null.html","kind":"class","full_name":"Avram::Where::Null","name":"Null","abstract":false,"superclass":{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":72,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L72"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"negated:NotNull-instance-method","name":"negated","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":77,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L77"},"def":{"name":"negated","return_type":"NotNull","visibility":"Public","body":"NotNull.new(column)"}},{"html_id":"operator:String-instance-method","name":"operator","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":73,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L73"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":"\"IS\""}}]},{"html_id":"avram/Avram/Where/NullSqlClause","path":"Avram/Where/NullSqlClause.html","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L66"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/NotNull","kind":"class","full_name":"Avram::Where::NotNull","name":"NotNull"},{"html_id":"avram/Avram/Where/Null","kind":"class","full_name":"Avram::Where::Null","name":"Null"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"prepare(_placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"_placeholder_supplier","external_name":"_placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(_placeholder_supplier : Proc(String)) : String","args_html":"(_placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":67,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L67"},"def":{"name":"prepare","args":[{"name":"_placeholder_supplier","external_name":"_placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} NULL\""}}]},{"html_id":"avram/Avram/Where/PrecedenceEnd","path":"Avram/Where/PrecedenceEnd.html","kind":"class","full_name":"Avram::Where::PrecedenceEnd","name":"PrecedenceEnd","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L39"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L40"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\")\""}}]},{"html_id":"avram/Avram/Where/PrecedenceStart","path":"Avram/Where/PrecedenceStart.html","kind":"class","full_name":"Avram::Where::PrecedenceStart","name":"PrecedenceStart","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L29"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L30"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L34"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"(\""}}]},{"html_id":"avram/Avram/Where/Raw","path":"Avram/Where/Raw.html","kind":"class","full_name":"Avram::Where::Raw","name":"Raw","abstract":false,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":248,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L248"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(statement:String,*bind_vars)-class-method","name":"new","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"args_string":"(statement : String, *bind_vars)","args_html":"(statement : String, *bind_vars)","location":{"filename":"src/avram/where.cr","line_number":251,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L251"},"def":{"name":"new","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"bind_vars","external_name":"bind_vars","restriction":""}],"splat_index":1,"visibility":"Public","body":"new(statement, args: bind_vars.to_a)"}},{"html_id":"new(statement:String,*,argsbind_vars:Array)-class-method","name":"new","abstract":false,"args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"args_string":"(statement : String, *, args bind_vars : Array)","args_html":"(statement : String, *, args bind_vars : Array)","location":{"filename":"src/avram/where.cr","line_number":255,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L255"},"def":{"name":"new","args":[{"name":"statement","external_name":"statement","restriction":"String"},{"name":"","external_name":"","restriction":""},{"name":"bind_vars","external_name":"args","restriction":"Array"}],"splat_index":1,"visibility":"Public","body":"_ = allocate\n_.initialize(statement, args: bind_vars)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":260,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L260"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"@clause"}}]},{"html_id":"avram/Avram/Where/SqlClause","path":"Avram/Where/SqlClause.html","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},"ancestors":[{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L45"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/NullSqlClause","kind":"class","full_name":"Avram::Where::NullSqlClause","name":"NullSqlClause"},{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(column:String|Symbol)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":"::String | ::Symbol"}],"args_string":"(column : String | Symbol)","args_html":"(column : String | Symbol)","location":{"filename":"src/avram/where.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L48"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":"::String | ::Symbol"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"column:Symbol|String-instance-method","name":"column","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L46"},"def":{"name":"column","return_type":"Symbol | String","visibility":"Public","body":"@column"}},{"html_id":"negated:SqlClause-instance-method","name":"negated","abstract":true,"location":{"filename":"src/avram/where.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L52"},"def":{"name":"negated","return_type":"SqlClause","visibility":"Public","body":""}},{"html_id":"operator:String-instance-method","name":"operator","abstract":true,"location":{"filename":"src/avram/where.cr","line_number":51,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L51"},"def":{"name":"operator","return_type":"String","visibility":"Public","body":""}},{"html_id":"prepare(placeholder_supplier:Proc(String)):String-instance-method","name":"prepare","abstract":false,"args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"args_string":"(placeholder_supplier : Proc(String)) : String","args_html":"(placeholder_supplier : Proc(String)) : String","location":{"filename":"src/avram/where.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L54"},"def":{"name":"prepare","args":[{"name":"placeholder_supplier","external_name":"placeholder_supplier","restriction":"Proc(String)"}],"return_type":"String","visibility":"Public","body":"\"#{column} #{operator} #{placeholder_supplier.call}\""}}]},{"html_id":"avram/Avram/Where/ValueHoldingSqlClause","path":"Avram/Where/ValueHoldingSqlClause.html","kind":"class","full_name":"Avram::Where::ValueHoldingSqlClause","name":"ValueHoldingSqlClause","abstract":true,"superclass":{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},"ancestors":[{"html_id":"avram/Avram/Where/SqlClause","kind":"class","full_name":"Avram::Where::SqlClause","name":"SqlClause"},{"html_id":"avram/Avram/Where/Condition","kind":"class","full_name":"Avram::Where::Condition","name":"Condition"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/where.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L59"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"avram/Avram/Where/Equal","kind":"class","full_name":"Avram::Where::Equal","name":"Equal"},{"html_id":"avram/Avram/Where/Excludes","kind":"class","full_name":"Avram::Where::Excludes","name":"Excludes"},{"html_id":"avram/Avram/Where/GreaterThan","kind":"class","full_name":"Avram::Where::GreaterThan","name":"GreaterThan"},{"html_id":"avram/Avram/Where/GreaterThanOrEqualTo","kind":"class","full_name":"Avram::Where::GreaterThanOrEqualTo","name":"GreaterThanOrEqualTo"},{"html_id":"avram/Avram/Where/Ilike","kind":"class","full_name":"Avram::Where::Ilike","name":"Ilike"},{"html_id":"avram/Avram/Where/In","kind":"class","full_name":"Avram::Where::In","name":"In"},{"html_id":"avram/Avram/Where/Includes","kind":"class","full_name":"Avram::Where::Includes","name":"Includes"},{"html_id":"avram/Avram/Where/LessThan","kind":"class","full_name":"Avram::Where::LessThan","name":"LessThan"},{"html_id":"avram/Avram/Where/LessThanOrEqualTo","kind":"class","full_name":"Avram::Where::LessThanOrEqualTo","name":"LessThanOrEqualTo"},{"html_id":"avram/Avram/Where/Like","kind":"class","full_name":"Avram::Where::Like","name":"Like"},{"html_id":"avram/Avram/Where/NotEqual","kind":"class","full_name":"Avram::Where::NotEqual","name":"NotEqual"},{"html_id":"avram/Avram/Where/NotIlike","kind":"class","full_name":"Avram::Where::NotIlike","name":"NotIlike"},{"html_id":"avram/Avram/Where/NotIn","kind":"class","full_name":"Avram::Where::NotIn","name":"NotIn"},{"html_id":"avram/Avram/Where/NotLike","kind":"class","full_name":"Avram::Where::NotLike","name":"NotLike"}],"namespace":{"html_id":"avram/Avram/Where","kind":"module","full_name":"Avram::Where","name":"Where"},"constructors":[{"html_id":"new(column,value:Array(Int32)|Array(String)|String)-class-method","name":"new","abstract":false,"args":[{"name":"column","external_name":"column","restriction":""},{"name":"value","external_name":"value","restriction":"::Array(::Int32) | ::Array(::String) | ::String"}],"args_string":"(column, value : Array(Int32) | Array(String) | String)","args_html":"(column, value : Array(Int32) | Array(String) | String)","location":{"filename":"src/avram/where.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L62"},"def":{"name":"new","args":[{"name":"column","external_name":"column","restriction":""},{"name":"value","external_name":"value","restriction":"::Array(::Int32) | ::Array(::String) | ::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(column, value)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"value:String|Array(String)|Array(Int32)-instance-method","name":"value","abstract":false,"location":{"filename":"src/avram/where.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/where.cr#L60"},"def":{"name":"value","return_type":"String | Array(String) | Array(Int32)","visibility":"Public","body":"@value"}}]}]}]},{"html_id":"avram/BaseTask","path":"BaseTask.html","kind":"class","full_name":"BaseTask","name":"BaseTask","abstract":true,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"subclasses":[{"html_id":"avram/Db/Create","kind":"class","full_name":"Db::Create","name":"Create"},{"html_id":"avram/Db/Drop","kind":"class","full_name":"Db::Drop","name":"Drop"},{"html_id":"avram/Db/Migrate","kind":"class","full_name":"Db::Migrate","name":"Migrate"},{"html_id":"avram/Db/Migrate/One","kind":"class","full_name":"Db::Migrate::One","name":"One"},{"html_id":"avram/Db/Migrations/Status","kind":"class","full_name":"Db::Migrations::Status","name":"Status"},{"html_id":"avram/Db/Redo","kind":"class","full_name":"Db::Redo","name":"Redo"},{"html_id":"avram/Db/Reset","kind":"class","full_name":"Db::Reset","name":"Reset"},{"html_id":"avram/Db/Rollback","kind":"class","full_name":"Db::Rollback","name":"Rollback"},{"html_id":"avram/Db/RollbackAll","kind":"class","full_name":"Db::RollbackAll","name":"RollbackAll"},{"html_id":"avram/Db/RollbackTo","kind":"class","full_name":"Db::RollbackTo","name":"RollbackTo"},{"html_id":"avram/Db/Schema/Dump","kind":"class","full_name":"Db::Schema::Dump","name":"Dump"},{"html_id":"avram/Db/Schema/Restore","kind":"class","full_name":"Db::Schema::Restore","name":"Restore"},{"html_id":"avram/Db/Setup","kind":"class","full_name":"Db::Setup","name":"Setup"},{"html_id":"avram/Db/VerifyConnection","kind":"class","full_name":"Db::VerifyConnection","name":"VerifyConnection"}],"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"base_task\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L4"},"def":{"name":"call","visibility":"Public","body":"Avram::Migrator.run do\n run_task\nend"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":true,"location":{"filename":"src/avram/tasks/db/base_task.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/base_task.cr#L2"},"def":{"name":"run_task","visibility":"Public","body":""}}]},{"html_id":"avram/Bool","path":"Bool.html","kind":"struct","full_name":"Bool","name":"Bool","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/bool_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/bool_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L1"},{"filename":"src/avram/charms/bool_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L26"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"doc":"Bool has only two possible values: `true` and `false`. They are constructed using these literals:\n\n```\ntrue # A Bool that is true\nfalse # A Bool that is false\n```\n\nSee [`Bool` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/bool.html) in the language reference.","summary":"

Bool has only two possible values: true and false.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L2"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"false"}},{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":27,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L27"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"false"}}],"types":[{"html_id":"avram/Bool/Lucky","path":"Bool/Lucky.html","kind":"module","full_name":"Bool::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Bool","kind":"struct","full_name":"Bool","name":"Bool"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Bool).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"if ([\"true\", \"1\"] of ::String).includes?(value)\n SuccessfulCast(Bool).new(true)\nelse\n if ([\"false\", \"0\"] of ::String).includes?(value)\n SuccessfulCast(Bool).new(false)\n else\n FailedCast.new\n end\nend"}},{"html_id":"parse(value:Bool)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool)","args_html":"(value : Bool)","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"visibility":"Public","body":"SuccessfulCast(Bool).new(value)"}},{"html_id":"parse(values:Array(Bool))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"args_string":"(values : Array(Bool))","args_html":"(values : Array(Bool))","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L28"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"visibility":"Public","body":"SuccessfulCast(Array(Bool)).new(values)"}},{"html_id":"to_db(value:Bool):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bool"}],"args_string":"(value : Bool) : String","args_html":"(value : Bool) : String","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L32"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Bool"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Bool))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"args_string":"(values : Array(Bool))","args_html":"(values : Array(Bool))","location":{"filename":"src/avram/charms/bool_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Bool)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Bool/Lucky/ColumnType","path":"Bool/Lucky/ColumnType.html","kind":"alias","full_name":"Bool::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Bool","aliased_html":"Bool","const":false,"namespace":{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"}},{"html_id":"avram/Bool/Lucky/Criteria","path":"Bool/Lucky/Criteria.html","kind":"class","full_name":"Bool::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/bool_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/bool_extensions.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Bool/Lucky","kind":"module","full_name":"Bool::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]},{"html_id":"avram/Char","path":"Char.html","kind":"struct","full_name":"Char","name":"Char","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/object.cr#L18"},{"filename":"src/avram/object_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L32"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"}],"doc":"A `Char` represents a [Unicode](http://en.wikipedia.org/wiki/Unicode) [code point](http://en.wikipedia.org/wiki/Code_point).\nIt occupies 32 bits.\n\nIt is created by enclosing an UTF-8 character in single quotes.\n\n```\n'a'\n'z'\n'0'\n'_'\n'あ'\n```\n\nYou can use a backslash to denote some characters:\n\n```\n'\\'' # single quote\n'\\\\' # backslash\n'\\e' # escape\n'\\f' # form feed\n'\\n' # newline\n'\\r' # carriage return\n'\\t' # tab\n'\\v' # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n'\\u0041' # == 'A'\n```\n\nOr you can use curly braces and specify up to four hexadecimal numbers:\n\n```\n'\\u{41}' # == 'A'\n```\n\nSee [`Char` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/char.html) in the language reference.","summary":"

A Char represents a Unicode code point.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L45"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/DB","path":"DB.html","kind":"module","full_name":"DB","name":"DB","abstract":false,"locations":[{"filename":"lib/db/src/db.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db.cr#L78"},{"filename":"lib/db/src/db/begin_transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/begin_transaction.cr#L1"},{"filename":"lib/db/src/db/connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/connection.cr#L1"},{"filename":"lib/db/src/db/connection_builder.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/connection_builder.cr#L1"},{"filename":"lib/db/src/db/connection_context.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/connection_context.cr#L1"},{"filename":"lib/db/src/db/database.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/database.cr#L4"},{"filename":"lib/db/src/db/disposable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/disposable.cr#L1"},{"filename":"lib/db/src/db/driver.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/driver.cr#L1"},{"filename":"lib/db/src/db/enumerable_concat.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/enumerable_concat.cr#L1"},{"filename":"lib/db/src/db/error.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/error.cr#L1"},{"filename":"lib/db/src/db/mapping.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/mapping.cr#L1"},{"filename":"lib/db/src/db/pool.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/pool.cr#L5"},{"filename":"lib/db/src/db/pool_prepared_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/pool_prepared_statement.cr#L1"},{"filename":"lib/db/src/db/pool_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/pool_statement.cr#L1"},{"filename":"lib/db/src/db/pool_unprepared_statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/pool_unprepared_statement.cr#L1"},{"filename":"lib/db/src/db/query_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/query_methods.cr#L1"},{"filename":"lib/db/src/db/result_set.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/result_set.cr#L1"},{"filename":"lib/db/src/db/serializable.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/serializable.cr#L1"},{"filename":"lib/db/src/db/session_methods.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/session_methods.cr#L1"},{"filename":"lib/db/src/db/statement.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/statement.cr#L1"},{"filename":"lib/db/src/db/string_key_cache.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/string_key_cache.cr#L1"},{"filename":"lib/db/src/db/transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/transaction.cr#L1"},{"filename":"src/ext/db/connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/connection.cr#L1"},{"filename":"src/ext/db/transaction.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"The DB module is a unified interface for database access.\nIndividual database systems are supported by specific database driver shards.\n\nAvailable drivers include:\n* [crystal-lang/crystal-sqlite3](https://github.com/crystal-lang/crystal-sqlite3) for SQLite\n* [crystal-lang/crystal-mysql](https://github.com/crystal-lang/crystal-mysql) for MySQL and MariaDB\n* [will/crystal-pg](https://github.com/will/crystal-pg) for PostgreSQL\n* [kaukas/crystal-cassandra](https://github.com/kaukas/crystal-cassandra) for Cassandra\n\nFor basic instructions on implementing a new database driver, check `Driver` and the existing drivers.\n\nDB manages a connection pool. The connection pool can be configured by query parameters to the\nconnection `URI` as described in `Database`.\n\n### Usage\n\nAssuming `crystal-sqlite3` is included a SQLite3 database can be opened with `#open`.\n\n```\ndb = DB.open \"sqlite3:./path/to/db/file.db\"\ndb.close\n```\n\nIf a block is given to `#open` the database is closed automatically\n\n```\nDB.open \"sqlite3:./file.db\" do |db|\n # work with db\nend # db is closed\n```\n\nIn the code above `db` is a `Database`. Methods available for querying it are described in `QueryMethods`.\n\nThree kind of statements can be performed:\n1. `Database#exec` waits no response from the database.\n2. `Database#scalar` reads a single value of the response.\n3. `Database#query` returns a ResultSet that allows iteration over the rows in the response and column information.\n\nAll of the above methods allows parametrised query. Either positional or named arguments.\n\nCheck a full working version:\n\nThe following example uses SQLite where `?` indicates the arguments. If PostgreSQL is used `$1`, `$2`, etc. should be used. `crystal-db` does not interpret the statements.\n\n```\nrequire \"db\"\nrequire \"sqlite3\"\n\nDB.open \"sqlite3:./file.db\" do |db|\n # When using the pg driver, use $1, $2, etc. instead of ?\n db.exec \"create table contacts (name text, age integer)\"\n db.exec \"insert into contacts values (?, ?)\", \"John Doe\", 30\n\n args = [] of DB::Any\n args << \"Sarah\"\n args << 33\n db.exec \"insert into contacts values (?, ?)\", args: args\n\n puts \"max age:\"\n puts db.scalar \"select max(age) from contacts\" # => 33\n\n puts \"contacts:\"\n db.query \"select name, age from contacts order by age desc\" do |rs|\n puts \"#{rs.column_name(0)} (#{rs.column_name(1)})\"\n # => name (age)\n rs.each do\n puts \"#{rs.read(String)} (#{rs.read(Int32)})\"\n # => Sarah (33)\n # => John Doe (30)\n end\n end\nend\n```\n","summary":"

The DB module is a unified interface for database access.

","types":[{"html_id":"avram/DB/Connection","path":"DB/Connection.html","kind":"class","full_name":"DB::Connection","name":"Connection","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/SessionMethods","kind":"module","full_name":"DB::SessionMethods","name":"SessionMethods"},{"html_id":"avram/DB/QueryMethods","kind":"module","full_name":"DB::QueryMethods","name":"QueryMethods"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/connection.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/connection.cr#L21"},{"filename":"lib/db/src/db/error.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/error.cr#L2"},{"filename":"src/ext/db/connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/connection.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/DB/SessionMethods","kind":"module","full_name":"DB::SessionMethods","name":"SessionMethods"}],"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"doc":"Database driver implementors must subclass `Connection`.\n\nRepresents one active connection to a database.\n\nUsers should never instantiate a `Connection` manually. Use `DB#open` or `Database#connection`.\n\nRefer to `QueryMethods` for documentation about querying the database through this connection.\n\n### Note to implementors\n\nThe connection must be initialized in `#initialize` and closed in `#do_close`.\n\nOverride `#build_prepared_statement` method in order to return a prepared `Statement` to allow querying.\nOverride `#build_unprepared_statement` method in order to return a unprepared `Statement` to allow querying.\nSee also `Statement` to define how the statements are executed.\n\nIf at any give moment the connection is lost a DB::ConnectionLost should be raised. This will\nallow the connection pool to try to reconnect or use another connection if available.\n","summary":"

Database driver implementors must subclass Connection.

"},{"html_id":"avram/DB/SavePointTransaction","path":"DB/SavePointTransaction.html","kind":"class","full_name":"DB::SavePointTransaction","name":"SavePointTransaction","abstract":false,"superclass":{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},"ancestors":[{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":94,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/transaction.cr#L94"},{"filename":"src/ext/db/transaction.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L20"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"constructors":[{"html_id":"new(parent:Transaction,savepoint_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"parent","external_name":"parent","restriction":"Transaction"},{"name":"savepoint_name","external_name":"savepoint_name","restriction":"String"}],"args_string":"(parent : Transaction, savepoint_name : String)","args_html":"(parent : Transaction, savepoint_name : String)","location":{"filename":"src/ext/db/transaction.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L21"},"def":{"name":"new","args":[{"name":"parent","external_name":"parent","restriction":"Transaction"},{"name":"savepoint_name","external_name":"savepoint_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(parent, savepoint_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/DB/TopLevelTransaction","path":"DB/TopLevelTransaction.html","kind":"class","full_name":"DB::TopLevelTransaction","name":"TopLevelTransaction","abstract":false,"superclass":{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},"ancestors":[{"html_id":"avram/DB/Transaction","kind":"class","full_name":"DB::Transaction","name":"Transaction"},{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/transaction.cr#L38"},{"filename":"src/ext/db/transaction.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"constructors":[{"html_id":"new(connection:Connection)-class-method","name":"new","abstract":false,"args":[{"name":"connection","external_name":"connection","restriction":"Connection"}],"args_string":"(connection : Connection)","args_html":"(connection : Connection)","location":{"filename":"src/ext/db/transaction.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L8"},"def":{"name":"new","args":[{"name":"connection","external_name":"connection","restriction":"Connection"}],"visibility":"Public","body":"_ = allocate\n_.initialize(connection)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"avram/DB/Transaction","path":"DB/Transaction.html","kind":"class","full_name":"DB::Transaction","name":"Transaction","abstract":true,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/transaction.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/transaction.cr#L14"},{"filename":"src/ext/db/transaction.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/ext/db/transaction.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/DB/BeginTransaction","kind":"module","full_name":"DB::BeginTransaction","name":"BeginTransaction"},{"html_id":"avram/DB/Disposable","kind":"module","full_name":"DB::Disposable","name":"Disposable"}],"subclasses":[{"html_id":"avram/DB/SavePointTransaction","kind":"class","full_name":"DB::SavePointTransaction","name":"SavePointTransaction"},{"html_id":"avram/DB/TopLevelTransaction","kind":"class","full_name":"DB::TopLevelTransaction","name":"TopLevelTransaction"}],"namespace":{"html_id":"avram/DB","kind":"module","full_name":"DB","name":"DB"},"doc":"Transactions should be started from `DB#transaction`, `Connection#transaction`\nor `Connection#begin_transaction`.\n\nUse `Transaction#connection` to submit statements to the database.\n\nUse `Transaction#commit` or `Transaction#rollback` to close the ongoing transaction\nexplicitly. Or refer to `BeginTransaction#transaction` for documentation on how to\nuse `#transaction(&block)` methods in `DB` and `Connection`.\n\nNested transactions are supported by using sql `SAVEPOINT`. To start a nested\ntransaction use `Transaction#transaction` or `Transaction#begin_transaction`.\n","summary":"

Transactions should be started from DB#transaction, Connection#transaction or Connection#begin_transaction.

"}]},{"html_id":"avram/Db","path":"Db.html","kind":"module","full_name":"Db","name":"Db","abstract":false,"locations":[{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Db/Console","path":"Db/Console.html","kind":"class","full_name":"Db::Console","name":"Console","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nEnters the postgres REPL. Check config/database.cr\\nfor database configuration.\\n\\nExamples:\\n\\n lucky db.console\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.console\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Access PostgreSQL console\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/avram/tasks/db/console.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L16"},"def":{"name":"call","visibility":"Public","body":"puts(banner_message)\nsystem(\"psql #{Avram::Migrator::Runner.credentials.url_without_query_params}\")\n"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/console.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/console.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}]},{"html_id":"avram/Db/Create","path":"Db/Create.html","kind":"class","full_name":"Db::Create","name":"Create","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe database name is usually found in config/database.cr\\n\\nExamples:\\n\\n lucky db.create\\n LUCKY_ENV=test lucky db.create # Create the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.create\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L3"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Create the database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/create.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L16"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/create.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/create.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L19"},"def":{"name":"run_task","visibility":"Public","body":"Migrator::Runner.create_db(@quiet)"}}],"types":[{"html_id":"avram/Db/Create/Migrator","path":"Db/Create/Migrator.html","kind":"alias","full_name":"Db::Create::Migrator","name":"Migrator","abstract":false,"locations":[{"filename":"src/avram/tasks/db/create.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/create.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Avram::Migrator","aliased_html":"Avram::Migrator","const":false,"namespace":{"html_id":"avram/Db/Create","kind":"class","full_name":"Db::Create","name":"Create"}}]},{"html_id":"avram/Db/Drop","path":"Db/Drop.html","kind":"class","full_name":"Db::Drop","name":"Drop","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe database name is usually found in config/database.cr\\n\\nExamples:\\n\\n lucky db.drop\\n LUCKY_ENV=test lucky db.drop # Drop the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.drop\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Drop the database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/drop.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L15"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/drop.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/drop.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/drop.cr#L18"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.drop_db(@quiet)"}}]},{"html_id":"avram/Db/Migrate","path":"Db/Migrate.html","kind":"class","full_name":"Db::Migrate","name":"Migrate","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExamples:\\n\\n lucky db.migrate\\n LUCKY_ENV=test lucky db.migrate # Runs migrations on the test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrate\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Run any pending migrations\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L13"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate.cr#L16"},"def":{"name":"run_task","visibility":"Public","body":"(Avram::Migrator::Runner.new(@quiet)).run_pending_migrations"}}],"types":[{"html_id":"avram/Db/Migrate/One","path":"Db/Migrate/One.html","kind":"class","full_name":"Db::Migrate::One","name":"One","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Migrate","kind":"class","full_name":"Db::Migrate","name":"Migrate"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.migrate.one\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrate.one\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Run just the next pending migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrate_one.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrate_one.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.run_next_migration"}}]}]},{"html_id":"avram/Db/Migrations","path":"Db/Migrations.html","kind":"module","full_name":"Db::Migrations","name":"Migrations","abstract":false,"locations":[{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"types":[{"html_id":"avram/Db/Migrations/Status","path":"Db/Migrations/Status.html","kind":"class","full_name":"Db::Migrations::Status","name":"Status","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Migrations","kind":"module","full_name":"Db::Migrations","name":"Migrations"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L5"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Shows which migrations are pending and which have been run.\\n\\nExamples:\\n\\n lucky db.migrations.status\\n LUCKY_ENV=test lucky db.migrations.status # Show migration status for test db\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L3"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.migrations.status\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L4"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Print the current status of migrations\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L3"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/migrations_status.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/migrations_status.cr#L15"},"def":{"name":"run_task","visibility":"Public","body":"if migrations.none?\n puts(\"There are no migrations.\".colorize(:green))\nelse\n ensure_migration_tracking_tables_exist\n print_migration_statuses\nend"}}]}]},{"html_id":"avram/Db/Redo","path":"Db/Redo.html","kind":"class","full_name":"Db::Redo","name":"Redo","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.redo\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.redo\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback and run just the last migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/redo.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/redo.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/redo.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Db::Rollback.new.run_task\nDb::Migrate.new.run_task\n"}}]},{"html_id":"avram/Db/Reset","path":"Db/Reset.html","kind":"class","full_name":"Db::Reset","name":"Reset","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.reset\\n\\nTo drop the test database:\\n\\n LUCKY_ENV=test lucky db.reset\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.reset\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Drop, recreate, and run migrations.\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/reset.cr","line_number":16,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L16"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/reset.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/reset.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/reset.cr#L19"},"def":{"name":"run_task","visibility":"Public","body":"(Db::Drop.new(@quiet)).run_task\n(Db::Create.new(@quiet)).run_task\n(Db::Migrate.new(@quiet)).run_task\n"}}]},{"html_id":"avram/Db/Rollback","path":"Db/Rollback.html","kind":"class","full_name":"Db::Rollback","name":"Rollback","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nExample:\\n\\n lucky db.rollback\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback the last migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback.cr#L12"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.rollback_one"}}]},{"html_id":"avram/Db/RollbackAll","path":"Db/RollbackAll.html","kind":"class","full_name":"Db::RollbackAll","name":"RollbackAll","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L4"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou may also want to look at 'lucky db.drop'.\\n\\nExample:\\n\\n lucky db.rollback_all\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback_all\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback all migrations\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_all.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_all.cr#L15"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.new.rollback_all\nputs(\"Done rolling back all migrations\".colorize(:green))\n"}}]},{"html_id":"avram/Db/RollbackTo","path":"Db/RollbackTo.html","kind":"class","full_name":"Db::RollbackTo","name":"RollbackTo","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou can get the migration version from the filename or by running 'lucky db.migrations.status'\\n\\nExample:\\n\\n lucky db.rollback_to 20180802180356\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.rollback_to\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Rollback to a specific migration\""}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/rollback_to.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/rollback_to.cr#L14"},"def":{"name":"run_task","visibility":"Public","body":"version = ARGV.first?\nif version && version.to_i64?\n Avram::Migrator::Runner.new.rollback_to(version.to_i64)\nelse\n raise((\"Migration version is required. Example: lucky db.rollback_to 20180802180356\".colorize(:red)).to_s)\nend\n"}}]},{"html_id":"avram/Db/Schema","path":"Db/Schema.html","kind":"module","full_name":"Db::Schema","name":"Schema","abstract":false,"locations":[{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"types":[{"html_id":"avram/Db/Schema/Dump","path":"Db/Schema/Dump.html","kind":"class","full_name":"Db::Schema::Dump","name":"Dump","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[:dump_to] of Symbol"}],"namespace":{"html_id":"avram/Db/Schema","kind":"module","full_name":"Db::Schema","name":"Schema"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou must specify the path that you want Avram to dump the sql to. Note\\nthat this dumps the schema but does not dump any data.\\n\\nExample:\\n\\n lucky db.schema.dump structure.sql\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.schema.dump\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Export database schema to a sql file\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L17"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"dump_to:String-instance-method","name":"dump_to","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L15"},"def":{"name":"dump_to","return_type":"String","visibility":"Public","body":"if @dump_to.nil?\n raise(\"dump_to is required, but no value was passed.\")\nend\n@dump_to.as(String)\n"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L20"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.dump_db(dump_to, @quiet)"}},{"html_id":"set_opt_for_dump_to(args:Array(String))-instance-method","name":"set_opt_for_dump_to","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_dump.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_dump.cr#L15"},"def":{"name":"set_opt_for_dump_to","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"value = args[@positional_arg_count]?\n@dump_to = value\n@positional_arg_count = @positional_arg_count + 1\n"}}]},{"html_id":"avram/Db/Schema/Restore","path":"Db/Schema/Restore.html","kind":"class","full_name":"Db::Schema::Restore","name":"Restore","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db/Schema","kind":"module","full_name":"Db::Schema","name":"Schema"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nYou must specify the path to the sql that you want Avram to restore from.\\n\\nExample:\\n\\n lucky db.schema.restore structure.sql\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.schema.restore\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Restore database from a sql dump file\""}}],"constructors":[{"html_id":"new(import_file_path:String|Nil=nil,quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"import_file_path","default_value":"nil","external_name":"import_file_path","restriction":"String | ::Nil"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(import_file_path : String | Nil = nil, quiet : Bool = false)","args_html":"(import_file_path : String | Nil = nil, quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L14"},"def":{"name":"new","args":[{"name":"import_file_path","default_value":"nil","external_name":"import_file_path","restriction":"String | ::Nil"},{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(import_file_path, quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/schema_restore.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/schema_restore.cr#L17"},"def":{"name":"run_task","visibility":"Public","body":"import_file_path = (@import_file_path || ARGV.first?) || (raise(\"A path to the import SQL file must be provided\"))\nAvram::Migrator::Runner.restore_db(import_file_path.as(String), @quiet)\n"}}]}]},{"html_id":"avram/Db/Setup","path":"Db/Setup.html","kind":"class","full_name":"Db::Setup","name":"Setup","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThis task will run the following:\\n * db.create - Create the database from config/database.cr\\n * db.migrate - Migrate all pending migrations from db/migrations/\\n\\n\\nExamples:\\n\\n lucky db.setup\\n LUCKY_ENV=test lucky db.setup # Setup test database\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.setup\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Runs a few tasks for setting up your database\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/setup.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L18"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/setup.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/setup.cr","line_number":21,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/setup.cr#L21"},"def":{"name":"run_task","visibility":"Public","body":"Avram::Migrator::Runner.create_db(@quiet)\n(Avram::Migrator::Runner.new(@quiet)).run_pending_migrations\n"}}]},{"html_id":"avram/Db/VerifyConnection","path":"Db/VerifyConnection.html","kind":"class","full_name":"Db::VerifyConnection","name":"VerifyConnection","abstract":false,"superclass":{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},"ancestors":[{"html_id":"avram/BaseTask","kind":"class","full_name":"BaseTask","name":"BaseTask"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"namespace":{"html_id":"avram/Db","kind":"module","full_name":"Db","name":"Db"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L3"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nThe connection settings are typically defined in config/database.cr\\n\\nExamples:\\n\\n lucky db.verify_connection\\n LUCKY_ENV=test lucky db.verify_connection # Verify test db connection\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L1"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"db.verify_connection\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L2"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Verify connection to postgres\""}}],"constructors":[{"html_id":"new(quiet:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"args_string":"(quiet : Bool = false)","args_html":"(quiet : Bool = false)","location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":17,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L17"},"def":{"name":"new","args":[{"name":"quiet","default_value":"false","external_name":"quiet","restriction":"Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(quiet)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L1"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"quiet?:Bool-instance-method","name":"quiet?","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L15"},"def":{"name":"quiet?","visibility":"Public","body":"@quiet"}},{"html_id":"run_task-instance-method","name":"run_task","abstract":false,"location":{"filename":"src/avram/tasks/db/verify_connection.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/db/verify_connection.cr#L20"},"def":{"name":"run_task","visibility":"Public","body":"begin\n Avram.settings.database_to_migrate.verify_connection\n if quiet?\n else\n puts(\"✔ Connection verified\")\n end\nrescue Avram::ConnectionError\n raise(\"Unable to connect to Postgres for database '#{Avram.settings.database_to_migrate}'.\\n\\nThis is what we tried to connect to:\\n\\n * host: #{Avram::Migrator::Runner.db_host}\\n * port: #{Avram::Migrator::Runner.db_port}\\n * database: #{Avram::Migrator::Runner.db_name}\\n * username: #{Avram::Migrator::Runner.db_user}\\n * password: check config/database.cr\\n\\nTo fix, try this...\\n\\n ▸ Make sure Postgres is running.\\n ▸ Check connection settings in config/database.cr.\\n ▸ If the database has not been created yet, run 'lucky db.create'\\n ▸ Then run 'lucky db.verify_connection' to make sure it can connect.\\n\")\nend"}}]}]},{"html_id":"avram/Enum","path":"Enum.html","kind":"struct","full_name":"Enum","name":"Enum","abstract":true,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/db/src/db/result_set.cr","line_number":156,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/db/src/db/result_set.cr#L156"},{"filename":"src/avram/charms/enum_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"Enum is the base type of all enums.\n\nAn enum is a set of integer values, where each value has an associated name. For example:\n\n```\nenum Color\n Red # 0\n Green # 1\n Blue # 2\nend\n```\n\nValues start with the value `0` and are incremented by one, but can be overwritten.\n\nTo get the underlying value you invoke value on it:\n\n```\nColor::Green.value # => 1\n```\n\nEach constant (member) in the enum has the type of the enum:\n\n```\ntypeof(Color::Red) # => Color\n```\n\n### Flags enum\n\nAn enum can be marked with the `@[Flags]` annotation. This changes the default values:\n\n```\n@[Flags]\nenum IOMode\n Read # 1\n Write # 2\n Async # 4\nend\n```\n\nAdditionally, some methods change their behaviour.\n\n### Enums from integers\n\nAn enum can be created from an integer:\n\n```\nColor.new(1).to_s # => \"Green\"\n```\n\nValues that don't correspond to enum's constants are allowed: the value\nwill still be of type Color, but when printed you will get the underlying value:\n\n```\nColor.new(10).to_s # => \"10\"\n```\n\nThis method is mainly intended to convert integers from C to enums in Crystal.\n\n### Question methods\n\nAn enum automatically defines question methods for each member, using\n`String#underscore` for the method name.\n* In the case of regular enums, this compares by equality (`==`).\n* In the case of flags enums, this invokes `includes?`.\n\nFor example:\n\n```\ncolor = Color::Blue\ncolor.red? # => false\ncolor.blue? # => true\n\nmode = IOMode::Read | IOMode::Async\nmode.read? # => true\nmode.write? # => false\nmode.async? # => true\n```\n\nThis is very convenient in `case` expressions:\n\n```\ncase color\nwhen .red?\n puts \"Got red\"\nwhen .blue?\n puts \"Got blue\"\nend\n```\n\n### Changing the Base Type\n\nThe type of the underlying enum value is `Int32` by default, but it can be changed to any type in `Int::Primitive`.\n\n```\nenum Color : UInt8\n Red\n Green\n Blue\nend\n\nColor::Red.value # : UInt8\n```","summary":"

Enum is the base type of all enums.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L4"},"def":{"name":"adapter","visibility":"Public","body":"Lucky(self)"}}],"types":[{"html_id":"avram/Enum/Lucky","path":"Enum/Lucky.html","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Enum","kind":"struct","full_name":"Enum","name":"Enum"},"instance_methods":[{"html_id":"criteria(query:V,column)forallV-instance-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"V"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : V, column) forall V","args_html":"(query : V, column) forall V","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":39,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L39"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"V"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(V, T).new(query, column)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L12"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"is_int = value.to_i?\nif is_int\n return parse(is_int)\nend\nif result = T.parse?(value)\n SuccessfulCast.new(result)\nelse\n FailedCast.new\nend\n"}},{"html_id":"parse(value:Int)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int"}],"args_string":"(value : Int)","args_html":"(value : Int)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":23,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L23"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int"}],"visibility":"Public","body":"if result = T.from_value?(value)\n SuccessfulCast.new(result)\nelse\n FailedCast.new\nend"}},{"html_id":"parse(value:T)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T)","args_html":"(value : T)","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L31"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"T"}],"visibility":"Public","body":"SuccessfulCast.new(value)"}},{"html_id":"to_db(value:T):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"T"}],"args_string":"(value : T) : String","args_html":"(value : T) : String","location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":35,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L35"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"T"}],"return_type":"String","visibility":"Public","body":"value.value.to_s"}}],"types":[{"html_id":"avram/Enum/Lucky/ColumnType","path":"Enum/Lucky/ColumnType.html","kind":"alias","full_name":"Enum::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L10"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Int32 | Int64)","aliased_html":"Int32 | Int64","const":false,"namespace":{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"}},{"html_id":"avram/Enum/Lucky/Criteria","path":"Enum/Lucky/Criteria.html","kind":"class","full_name":"Enum::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Int32/Lucky/Criteria","kind":"class","full_name":"Int32::Lucky::Criteria","name":"Criteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/enum_extensions.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L43"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Enum/Lucky","kind":"module","full_name":"Enum::Lucky(T)","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"select_max:V|Nil-instance-method","name":"select_max","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L50"},"def":{"name":"select_max","return_type":"V | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_max(column)).as(Int32 | ::Nil)).try do |max|\n V.adapter.parse!(max)\nend"}},{"html_id":"select_min:V|Nil-instance-method","name":"select_min","abstract":false,"location":{"filename":"src/avram/charms/enum_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/enum_extensions.cr#L44"},"def":{"name":"select_min","return_type":"V | ::Nil","visibility":"Public","body":"(rows.exec_scalar(&.select_min(column)).as(Int32 | ::Nil)).try do |min|\n V.adapter.parse!(min)\nend"}}]}]}]},{"html_id":"avram/Fiber","path":"Fiber.html","kind":"class","full_name":"Fiber","name":"Fiber","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/fiber.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/fiber.cr#L2"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"https://crystal-lang.org/api/latest/Fiber.html","summary":"

https://crystal-lang.org/api/latest/Fiber.html

","instance_methods":[{"html_id":"query_cache:LuckyCache::BaseStore-instance-method","name":"query_cache","doc":"This is stored on Fiber so it's released after each\nHTTP Request.","summary":"

This is stored on Fiber so it's released after each HTTP Request.

","abstract":false,"location":{"filename":"src/avram/charms/fiber.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/fiber.cr#L5"},"def":{"name":"query_cache","return_type":"LuckyCache::BaseStore","visibility":"Public","body":"if (value = @query_cache).nil?\n @query_cache = (if Avram.settings.query_cache_enabled\n LuckyCache::MemoryStore.new\n else\n LuckyCache::NullStore.new\n end)\nelse\n value\nend"}},{"html_id":"query_cache=(query_cache:LuckyCache::BaseStore)-instance-method","name":"query_cache=","doc":"This is stored on Fiber so it's released after each\nHTTP Request.","summary":"

This is stored on Fiber so it's released after each HTTP Request.

","abstract":false,"args":[{"name":"query_cache","external_name":"query_cache","restriction":"LuckyCache::BaseStore"}],"args_string":"(query_cache : LuckyCache::BaseStore)","args_html":"(query_cache : LuckyCache::BaseStore)","location":{"filename":"src/avram/charms/fiber.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/fiber.cr#L5"},"def":{"name":"query_cache=","args":[{"name":"query_cache","external_name":"query_cache","restriction":"LuckyCache::BaseStore"}],"visibility":"Public","body":"@query_cache = query_cache"}}]},{"html_id":"avram/Float64","path":"Float64.html","kind":"struct","full_name":"Float64","name":"Float64","abstract":false,"superclass":{"html_id":"avram/Float","kind":"struct","full_name":"Float","name":"Float"},"ancestors":[{"html_id":"avram/Float","kind":"struct","full_name":"Float","name":"Float"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L31"},{"filename":"src/avram/charms/float64_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L32"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Float64/Lucky","path":"Float64/Lucky.html","kind":"module","full_name":"Float64::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Float64","kind":"struct","full_name":"Float64","name":"Float64"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Float64).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Float64)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64)","args_html":"(value : Float64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"visibility":"Public","body":"value"}},{"html_id":"from_db!(value:PG::Numeric)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"args_string":"(value : PG::Numeric)","args_html":"(value : PG::Numeric)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L18"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"visibility":"Public","body":"value.to_f"}},{"html_id":"parse(value:Float64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64)","args_html":"(value : Float64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value)"}},{"html_id":"parse(values:Array(Float64))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"args_string":"(values : Array(Float64))","args_html":"(values : Array(Float64))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"visibility":"Public","body":"SuccessfulCast(Array(Float64)).new(values)"}},{"html_id":"parse(value:PG::Numeric)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"args_string":"(value : PG::Numeric)","args_html":"(value : PG::Numeric)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L30"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"PG::Numeric"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f)"}},{"html_id":"parse(values:Array(PG::Numeric))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(PG::Numeric)"}],"args_string":"(values : Array(PG::Numeric))","args_html":"(values : Array(PG::Numeric))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L34"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(PG::Numeric)"}],"visibility":"Public","body":"SuccessfulCast(Array(Float64)).new(values.map(&.to_f))"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L38"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Float64).new(value.to_f64)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L44"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f64)"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L48"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"SuccessfulCast(Float64).new(value.to_f64)"}},{"html_id":"to_db(value:Float64):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Float64"}],"args_string":"(value : Float64) : String","args_html":"(value : Float64) : String","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":52,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L52"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Float64"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Float64))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"args_string":"(values : Array(Float64))","args_html":"(values : Array(Float64))","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":56,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L56"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Float64)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Float64/Lucky/ColumnType","path":"Float64/Lucky/ColumnType.html","kind":"alias","full_name":"Float64::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"(Float64 | PG::Numeric)","aliased_html":"Float64 | PG::Numeric","const":false,"namespace":{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"}},{"html_id":"avram/Float64/Lucky/Criteria","path":"Float64/Lucky/Criteria.html","kind":"class","full_name":"Float64::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/float64_extensions.cr","line_number":60,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L60"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"}],"namespace":{"html_id":"avram/Float64/Lucky","kind":"module","full_name":"Float64::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L61"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"select_sum:Float64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":63,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L63"},"def":{"name":"select_sum","return_type":"Float64 | ::Nil","visibility":"Public","body":"if sum = super()\n (sum.as(PG::Numeric)).to_f\nend"}},{"html_id":"select_sum!:Float64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/float64_extensions.cr","line_number":69,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/float64_extensions.cr#L69"},"def":{"name":"select_sum!","return_type":"Float64","visibility":"Public","body":"select_sum || 0_f64"}}]}]}]},{"html_id":"avram/Gen","path":"Gen.html","kind":"module","full_name":"Gen","name":"Gen","abstract":false,"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"avram/Gen/Migration","path":"Gen/Migration.html","kind":"class","full_name":"Gen::Migration","name":"Migration","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L3"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"HABITAT_SETTINGS","name":"HABITAT_SETTINGS","value":"[{decl: io : IO = STDOUT, example: nil, validation: nil}] of Nil"},{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Habitat/SettingsHelpers","kind":"module","full_name":"Habitat::SettingsHelpers","name":"SettingsHelpers"},{"html_id":"avram/Habitat/TempConfig","kind":"module","full_name":"Habitat::TempConfig","name":"TempConfig"}],"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"configure(&)-class-method","name":"configure","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"configure","yields":1,"block_arity":1,"visibility":"Public","body":"yield settings"}},{"html_id":"settings-class-method","name":"settings","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}},{"html_id":"silence_output(&)-class-method","name":"silence_output","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L22"},"def":{"name":"silence_output","yields":0,"block_arity":0,"visibility":"Public","body":"temp_config(io: IO::Memory.new) do\n yield\nend"}},{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":5,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L5"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Generate a new migration using the passed in migration name.\\n\\nThe migration name must be CamelCase. No other options are available.\\n\\nExamples:\\n\\n lucky gen.migration CreateUsers\\n lucky gen.migration AddAgeToUsers\\n lucky gen.migration MakeUserNameOptional\\n\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L3"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.migration\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L4"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a new migration\""}}],"instance_methods":[{"html_id":"call(name:String|Nil=nil)-instance-method","name":"call","abstract":false,"args":[{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil"}],"args_string":"(name : String | Nil = nil)","args_html":"(name : String | Nil = nil)","location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L28"},"def":{"name":"call","args":[{"name":"name","default_value":"nil","external_name":"name","restriction":"String | ::Nil"}],"visibility":"Public","body":"Avram::Migrator.run do\n name = name || ARGV.first?\n if name\n Avram::Migrator::MigrationGenerator.new(name: name).generate\n else\n raise((\"Migration name is required. Example: lucky gen.migration CreateUsers\".colorize(:red)).to_s)\n end\nend"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L3"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"settings-instance-method","name":"settings","abstract":false,"location":{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L18"},"def":{"name":"settings","visibility":"Public","body":"HabitatSettings"}}],"types":[{"html_id":"avram/Gen/Migration/HabitatSettings","path":"Gen/Migration/HabitatSettings.html","kind":"class","full_name":"Gen::Migration::HabitatSettings","name":"HabitatSettings","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/tasks/gen/migration.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/tasks/gen/migration.cr#L18"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen/Migration","kind":"class","full_name":"Gen::Migration","name":"Migration"},"class_methods":[{"html_id":"io:IO-class-method","name":"io","abstract":false,"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@@io.not_nil!"}},{"html_id":"io=(value:IO)-class-method","name":"io=","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"IO"}],"args_string":"(value : IO)","args_html":"(value : IO)","def":{"name":"io=","args":[{"name":"value","external_name":"value","restriction":"IO"}],"visibility":"Public","body":"@@io = value"}},{"html_id":"io?-class-method","name":"io?","doc":"Used for checking missing settings on non-nilable types\nIt's advised to use io in your apps to ensure\nthe propper type is checked.","summary":"

Used for checking missing settings on non-nilable types It's advised to use io in your apps to ensure the propper type is checked.

","abstract":false,"def":{"name":"io?","visibility":"Public","body":"@@io"}},{"html_id":"to_h-class-method","name":"to_h","doc":"Generates a hash using the provided values","summary":"

Generates a hash using the provided values

","abstract":false,"def":{"name":"to_h","visibility":"Public","body":"{\"io\" => io}"}}]}]},{"html_id":"avram/Gen/Mixins","path":"Gen/Mixins.html","kind":"module","full_name":"Gen::Mixins","name":"Mixins","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"types":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","path":"Gen/Mixins/MigrationWithColumns.html","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"SUPPORTED_TYPES","name":"SUPPORTED_TYPES","value":"{\"Bool\", \"Float64\", \"Int16\", \"Int32\", \"Int64\", \"String\", \"Time\", \"UUID\", \"JSON::Any\"}"}],"including_types":[{"html_id":"avram/Gen/Model","kind":"class","full_name":"Gen::Model","name":"Model"},{"html_id":"avram/Gen/Resource/Browser","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser"}],"namespace":{"html_id":"avram/Gen/Mixins","kind":"module","full_name":"Gen::Mixins","name":"Mixins"},"instance_methods":[{"html_id":"create_migration-instance-method","name":"create_migration","abstract":false,"location":{"filename":"src/lucky/tasks/gen/mixins/migration_with_columns.cr","line_number":4,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/mixins/migration_with_columns.cr#L4"},"def":{"name":"create_migration","visibility":"Public","body":"(Avram::Migrator::MigrationGenerator.new(\"Create#{pluralized_name}\", migrate_contents: migrate_contents, rollback_contents: rollback_contents)).generate"}}]}]},{"html_id":"avram/Gen/Model","path":"Gen/Model.html","kind":"class","full_name":"Gen::Model","name":"Model","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"}],"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.model\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L11"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a model, query, and operations (save and delete)\""}}],"instance_methods":[{"html_id":"call(io:IO=STDOUT)-instance-method","name":"call","abstract":false,"args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"args_string":"(io : IO = STDOUT)","args_html":"(io : IO = STDOUT)","location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L14"},"def":{"name":"call","args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"@io = io\nif valid?\n template.render(\"./src/\")\n create_migration\n display_success_messages\nelse\n io.puts(@error.colorize(:red))\nend\n"}},{"html_id":"help_message-instance-method","name":"help_message","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L24"},"def":{"name":"help_message","visibility":"Public","body":"\"#{summary}\\n\\nExample:\\n\\n lucky gen.model Project title:String description:String? completed:Bool priority:Int32\""}},{"html_id":"io:IO-instance-method","name":"io","abstract":false,"location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L12"},"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@io"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/lucky/tasks/gen/model.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/model.cr#L8"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}]},{"html_id":"avram/Gen/Resource","path":"Gen/Resource.html","kind":"module","full_name":"Gen::Resource","name":"Resource","abstract":false,"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen","kind":"module","full_name":"Gen","name":"Gen"},"types":[{"html_id":"avram/Gen/Resource/Browser","path":"Gen/Resource/Browser.html","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser","abstract":false,"superclass":{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"},{"html_id":"avram/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[] of Symbol"}],"included_modules":[{"html_id":"avram/Gen/Mixins/MigrationWithColumns","kind":"module","full_name":"Gen::Mixins::MigrationWithColumns","name":"MigrationWithColumns"}],"namespace":{"html_id":"avram/Gen/Resource","kind":"module","full_name":"Gen::Resource","name":"Resource"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

The help text to be displayed when a help flag is passed in (e.g.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"#{task_summary}\\n\\nRun this task with 'lucky #{task_name}'\".strip"}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

The name of your task as derived by the class name Use the .task_name macro to define a custom task name

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.resource.browser\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

By default, task summaries are optional.

","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":11,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L11"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a resource (model, operation, query, actions, and pages)\""}}],"instance_methods":[{"html_id":"call(io:IO=STDOUT)-instance-method","name":"call","abstract":false,"args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"args_string":"(io : IO = STDOUT)","args_html":"(io : IO = STDOUT)","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L34"},"def":{"name":"call","args":[{"name":"io","default_value":"STDOUT","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"begin\n @io = io\n validate!\n generate_resource\n io.puts(\"\\nYou will need to run the #{\"lucky db.migrate\".colorize.green} task next\")\n display_path_to_resource\nrescue e : InvalidOption\n io.puts(e.message.colorize.red)\nend"}},{"html_id":"help_message-instance-method","name":"help_message","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L20"},"def":{"name":"help_message","visibility":"Public","body":"\"#{summary}\\n\\nRequires the name of the resource and list of database columns. Columns\\nare passed as column_name:ColumnType. Where ColumnType are one of the\\nsupported Avram datatypes.\\n\\nExample:\\n\\n lucky gen.resource.browser Project title:String description:String? completed:Bool priority:Int32\""}},{"html_id":"io:IO-instance-method","name":"io","abstract":false,"location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":12,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L12"},"def":{"name":"io","return_type":"IO","visibility":"Public","body":"@io"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L8"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}}],"types":[{"html_id":"avram/Gen/Resource/Browser/InvalidOption","path":"Gen/Resource/Browser/InvalidOption.html","kind":"class","full_name":"Gen::Resource::Browser::InvalidOption","name":"InvalidOption","abstract":false,"superclass":{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"avram/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L14"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Gen/Resource/Browser","kind":"class","full_name":"Gen::Resource::Browser","name":"Browser"},"constructors":[{"html_id":"new(message:String)-class-method","name":"new","abstract":false,"args":[{"name":"message","external_name":"message","restriction":"String"}],"args_string":"(message : String)","args_html":"(message : String)","location":{"filename":"src/lucky/tasks/gen/resource/browser.cr","line_number":15,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/lucky/tasks/gen/resource/browser.cr#L15"},"def":{"name":"new","args":[{"name":"message","external_name":"message","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(message)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]}]},{"html_id":"avram/Int16","path":"Int16.html","kind":"struct","full_name":"Int16","name":"Int16","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int16_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/int16_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":13,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L13"},{"filename":"src/avram/charms/int16_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L14"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int16/Lucky","path":"Int16/Lucky.html","kind":"module","full_name":"Int16::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int16","kind":"struct","full_name":"Int16","name":"Int16"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int16).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int16)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16)","args_html":"(value : Int16)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:Int16)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16)","args_html":"(value : Int16)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"visibility":"Public","body":"SuccessfulCast(Int16).new(value)"}},{"html_id":"parse(values:Array(Int16))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"args_string":"(values : Array(Int16))","args_html":"(values : Array(Int16))","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int16)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int16).new(value.to_i16)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L32"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int16).new(value.to_i16)\nrescue OverflowError\n FailedCast.new\nend"}},{"html_id":"to_db(value:Int16):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int16"}],"args_string":"(value : Int16) : String","args_html":"(value : Int16) : String","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L38"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int16"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int16))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"args_string":"(values : Array(Int16))","args_html":"(values : Array(Int16))","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L42"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int16)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int16/Lucky/ColumnType","path":"Int16/Lucky/ColumnType.html","kind":"alias","full_name":"Int16::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int16","aliased_html":"Int16","const":false,"namespace":{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"}},{"html_id":"avram/Int16/Lucky/Criteria","path":"Int16/Lucky/Criteria.html","kind":"class","full_name":"Int16::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int16_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L46"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"}],"namespace":{"html_id":"avram/Int16/Lucky","kind":"module","full_name":"Int16::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L47"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L49"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int16_extensions.cr","line_number":58,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int16_extensions.cr#L58"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Int32","path":"Int32.html","kind":"struct","full_name":"Int32","name":"Int32","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int32_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/int32_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":19,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L19"},{"filename":"src/avram/charms/int32_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":20,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L20"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int32/Lucky","path":"Int32/Lucky.html","kind":"module","full_name":"Int32::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int32","kind":"struct","full_name":"Int32","name":"Int32"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int32).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int32)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int32).new(value.to_i)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":24,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L24"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Int32).new(value)"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L28"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int32).new(value.to_i32)\nrescue OverflowError\n FailedCast.new\nend"}},{"html_id":"parse(values:Array(Int32))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"args_string":"(values : Array(Int32))","args_html":"(values : Array(Int32))","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":34,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L34"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int32)).new(values)"}},{"html_id":"to_db(value:Int32):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32) : String","args_html":"(value : Int32) : String","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":38,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L38"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int32))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"args_string":"(values : Array(Int32))","args_html":"(values : Array(Int32))","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L42"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int32)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int32/Lucky/ColumnType","path":"Int32/Lucky/ColumnType.html","kind":"alias","full_name":"Int32::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int32","aliased_html":"Int32","const":false,"namespace":{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"}},{"html_id":"avram/Int32/Lucky/Criteria","path":"Int32/Lucky/Criteria.html","kind":"class","full_name":"Int32::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int32_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L46"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"subclasses":[{"html_id":"avram/Enum/Lucky/Criteria","kind":"class","full_name":"Enum::Lucky::Criteria(T, V)","name":"Criteria"}],"namespace":{"html_id":"avram/Int32/Lucky","kind":"module","full_name":"Int32::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":47,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L47"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L48"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L50"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int32_extensions.cr","line_number":59,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int32_extensions.cr#L59"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Int64","path":"Int64.html","kind":"struct","full_name":"Int64","name":"Int64","abstract":false,"superclass":{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Int","kind":"struct","full_name":"Int","name":"Int"},{"html_id":"avram/Number","kind":"struct","full_name":"Number","name":"Number"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/int64_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/int64_extensions.cr#L3"},{"filename":"src/avram/blank_extensions.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L25"},{"filename":"src/avram/charms/int64_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L26"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Int64/Lucky","path":"Int64/Lucky.html","kind":"module","full_name":"Int64::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Int64","kind":"struct","full_name":"Int64","name":"Int64"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Int64).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Int64)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:Int64)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64)","args_html":"(value : Int64)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"visibility":"Public","body":"SuccessfulCast(Int64).new(value)"}},{"html_id":"parse(values:Array(Int64))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"args_string":"(values : Array(Int64))","args_html":"(values : Array(Int64))","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"visibility":"Public","body":"SuccessfulCast(Array(Int64)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L26"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(Int64).new(value.to_i64)\nrescue ArgumentError\n FailedCast.new\nend"}},{"html_id":"parse(value:Int32)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int32"}],"args_string":"(value : Int32)","args_html":"(value : Int32)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L32"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Int32"}],"visibility":"Public","body":"SuccessfulCast(Int64).new(value.to_i64)"}},{"html_id":"to_db(value:Int64):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Int64"}],"args_string":"(value : Int64) : String","args_html":"(value : Int64) : String","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Int64"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(Int64))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"args_string":"(values : Array(Int64))","args_html":"(values : Array(Int64))","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L40"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(Int64)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/Int64/Lucky/ColumnType","path":"Int64/Lucky/ColumnType.html","kind":"alias","full_name":"Int64::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Int64","aliased_html":"Int64","const":false,"namespace":{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"}},{"html_id":"avram/Int64/Lucky/Criteria","path":"Int64/Lucky/Criteria.html","kind":"class","full_name":"Int64::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/int64_extensions.cr","line_number":44,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L44"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/Int64/Lucky","kind":"module","full_name":"Int64::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":45,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L45"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":46,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L46"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"select_sum:Int64|Nil-instance-method","name":"select_sum","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":48,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L48"},"def":{"name":"select_sum","return_type":"Int64 | ::Nil","visibility":"Public","body":"case sum = super()\nwhen PG::Numeric\n sum.to_f.to_i64\nwhen Int\n sum.to_i64\nend"}},{"html_id":"select_sum!:Int64-instance-method","name":"select_sum!","abstract":false,"location":{"filename":"src/avram/charms/int64_extensions.cr","line_number":57,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/int64_extensions.cr#L57"},"def":{"name":"select_sum!","return_type":"Int64","visibility":"Public","body":"select_sum || 0_i64"}}]}]}]},{"html_id":"avram/Nil","path":"Nil.html","kind":"struct","full_name":"Nil","name":"Nil","abstract":false,"superclass":{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},"ancestors":[{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/object.cr#L32"},{"filename":"src/avram/blank_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L37"},{"filename":"src/avram/object_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L50"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"doc":"The `Nil` type has only one possible value: `nil`.\n\n`nil` is commonly used to represent the absence of a value.\nFor example, `String#index` returns the position of the character or `nil` if it's not\nin the string:\n\n```\nstr = \"Hello world\"\nstr.index 'e' # => 1\nstr.index 'a' # => nil\n```\n\nIn the above example, trying to invoke a method on the returned value will\ngive a compile time error unless both `Int32` and `Nil` define that method:\n\n```\nstr = \"Hello world\"\nidx = str.index 'e'\nidx + 1 # Error: undefined method '+' for Nil\n```\n\nThe language and the standard library provide short, readable, easy ways to deal with `nil`,\nsuch as `Object#try` and `Object#not_nil!`:\n\n```\nstr = \"Hello world\"\n\n# The index of 'e' in str or 0 if not found\nidx1 = str.index('e') || 0\n\nidx2 = str.index('a')\nif idx2\n # Compiles: idx2 can't be nil here\n idx2 + 1\nend\n\n# Tell the compiler that we are sure the returned\n# value is not nil: raises a runtime exception\n# if our assumption doesn't hold.\nidx3 = str.index('o').not_nil!\n```\n\nSee [`Nil` literal](https://crystal-lang.org/reference/syntax_and_semantics/literals/nil.html) in the language reference.","summary":"

The Nil type has only one possible value: nil.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":55,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L55"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/Object","path":"Object.html","kind":"class","full_name":"Object","name":"Object","abstract":true,"ancestors":[{"html_id":"avram/Lucky/Memoizable","kind":"module","full_name":"Lucky::Memoizable","name":"Memoizable"},{"html_id":"avram/Lucky/QuickDef","kind":"module","full_name":"Lucky::QuickDef","name":"QuickDef"},{"html_id":"avram/Colorize/ObjectExtensions","kind":"module","full_name":"Colorize::ObjectExtensions","name":"ObjectExtensions"}],"locations":[{"filename":"lib/lucky/src/charms/object.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/object.cr#L1"},{"filename":"src/avram/object_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Colorize/ObjectExtensions","kind":"module","full_name":"Colorize::ObjectExtensions","name":"ObjectExtensions"},{"html_id":"avram/Lucky/Memoizable","kind":"module","full_name":"Lucky::Memoizable","name":"Memoizable"},{"html_id":"avram/Lucky/QuickDef","kind":"module","full_name":"Lucky::QuickDef","name":"QuickDef"}],"doc":"`Object` is the base type of all Crystal objects.","summary":"

Object is the base type of all Crystal objects.

","instance_methods":[{"html_id":"blank_for_validates_required?:Bool-instance-method","name":"blank_for_validates_required?","abstract":false,"location":{"filename":"src/avram/object_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/object_extensions.cr#L14"},"def":{"name":"blank_for_validates_required?","return_type":"Bool","visibility":"Public","body":"blank?"}}]},{"html_id":"avram/Slice","path":"Slice.html","kind":"struct","full_name":"Slice(T)","name":"Slice","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"},{"html_id":"avram/Indexable","kind":"module","full_name":"Indexable","name":"Indexable"},{"html_id":"avram/Enumerable","kind":"module","full_name":"Enumerable","name":"Enumerable"},{"html_id":"avram/Iterable","kind":"module","full_name":"Iterable","name":"Iterable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":61,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L61"},{"filename":"src/avram/charms/slice_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Indexable/Mutable","kind":"module","full_name":"Indexable::Mutable","name":"Mutable"}],"doc":"A `Slice` is a `Pointer` with an associated size.\n\nWhile a pointer is unsafe because no bound checks are performed when reading from and writing to it,\nreading from and writing to a slice involve bound checks.\nIn this way, a slice is a safe alternative to `Pointer`.\n\nA Slice can be created as read-only: trying to write to it\nwill raise. For example the slice of bytes returned by\n`String#to_slice` is read-only.","summary":"

A Slice is a Pointer with an associated size.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":62,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L62"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"empty?"}}],"types":[{"html_id":"avram/Slice/Lucky","path":"Slice/Lucky.html","kind":"module","full_name":"Slice::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Slice","kind":"struct","full_name":"Slice(T)","name":"Slice"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Bytes).new(query, column)"}}],"instance_methods":[{"html_id":"from_db!(value:Bytes)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L14"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"parse(value.to_slice)"}},{"html_id":"parse(value:Bytes)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"SuccessfulCast(Bytes).new(value)"}},{"html_id":"to_db(value:Bytes)-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"args_string":"(value : Bytes)","args_html":"(value : Bytes)","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L26"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Bytes"}],"visibility":"Public","body":"ssize = (value.size * 2) + 2\nString.new(ssize) do |buffer|\n buffer[0] = '\\\\'.ord.to_u8\n buffer[1] = 'x'.ord.to_u8\n value.hexstring(buffer + 2)\n {ssize, ssize}\nend\n"}},{"html_id":"to_db(value:String):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/charms/slice_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L36"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"value"}}],"types":[{"html_id":"avram/Slice/Lucky/ColumnType","path":"Slice/Lucky/ColumnType.html","kind":"alias","full_name":"Slice::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Slice(UInt8)","aliased_html":"Slice(UInt8)","const":false,"namespace":{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"}},{"html_id":"avram/Slice/Lucky/Criteria","path":"Slice/Lucky/Criteria.html","kind":"class","full_name":"Slice::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/slice_extensions.cr","line_number":40,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/slice_extensions.cr#L40"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"avram/Slice/Lucky","kind":"module","full_name":"Slice::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]},{"html_id":"avram/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/string_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/string_extensions.cr#L1"},{"filename":"src/avram/charms/string_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nA string might end up being composed of bytes which form an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but every\nbyte that doesn't start a valid UTF-8 byte sequence is interpreted as though\nit encodes the Unicode replacement character (U+FFFD) by itself. For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.\n\nNote that this interpretation only applies to methods inside Crystal; calling\n`#to_slice` or `#to_unsafe`, e.g. when passing a string to a C library, will\nexpose the invalid UTF-8 byte sequences. In particular, `Regex`'s underlying\nengine may reject strings that are not valid UTF-8, or it may invoke undefined\nbehavior on invalid strings. If this is undesired, `#scrub` could be used to\nremove the offending byte sequences first.","summary":"

A String represents an immutable sequence of UTF-8 characters.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"types":[{"html_id":"avram/String/Lucky","path":"String/Lucky.html","kind":"module","full_name":"String::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/String","kind":"class","full_name":"String","name":"String"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, String).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"SuccessfulCast(String).new(value)"}},{"html_id":"parse(values:Array(String))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"SuccessfulCast(Array(String)).new(values)"}},{"html_id":"to_db(value:String):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : String","args_html":"(value : String) : String","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L22"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"String","visibility":"Public","body":"value"}},{"html_id":"to_db(values:Array(String))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"args_string":"(values : Array(String))","args_html":"(values : Array(String))","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":26,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L26"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(String)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/String/Lucky/ColumnType","path":"String/Lucky/ColumnType.html","kind":"alias","full_name":"String::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"String","aliased_html":"String","const":false,"namespace":{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"}},{"html_id":"avram/String/Lucky/Criteria","path":"String/Lucky/Criteria.html","kind":"class","full_name":"String::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/string_extensions.cr","line_number":30,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L30"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/String/Lucky","kind":"module","full_name":"String::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"ilike(value:String):T-instance-method","name":"ilike","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : T","args_html":"(value : String) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L37"},"def":{"name":"ilike","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Ilike.new(column, value))"}},{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":31,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L31"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}},{"html_id":"like(value:String):T-instance-method","name":"like","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : T","args_html":"(value : String) : T","location":{"filename":"src/avram/charms/string_extensions.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L33"},"def":{"name":"like","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"T","visibility":"Public","body":"add_clause(Avram::Where::Like.new(column, value))"}},{"html_id":"lower-instance-method","name":"lower","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L42"},"def":{"name":"lower","visibility":"Public","body":"Criteria(T, V).new(rows, \"LOWER(#{column})\")"}},{"html_id":"trim-instance-method","name":"trim","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":43,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L43"},"def":{"name":"trim","visibility":"Public","body":"Criteria(T, String).new(rows, \"TRIM(#{column})\")"}},{"html_id":"upper-instance-method","name":"upper","abstract":false,"location":{"filename":"src/avram/charms/string_extensions.cr","line_number":41,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/string_extensions.cr#L41"},"def":{"name":"upper","visibility":"Public","body":"Criteria(T, V).new(rows, \"UPPER(#{column})\")"}}]}]}]},{"html_id":"avram/Time","path":"Time.html","kind":"struct","full_name":"Time","name":"Time","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/blank_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L7"},{"filename":"src/avram/charms/time_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Steppable","kind":"module","full_name":"Steppable","name":"Steppable"}],"doc":"`Time` represents a date-time instant in\n[incremental time](https://www.w3.org/International/articles/definitions-time/#incremental_time)\nobserved in a specific time zone.\n\nThe calendaric calculations are based on the rules of the proleptic Gregorian\ncalendar as specified in [ISO 8601](http://xml.coverpages.org/ISO-FDIS-8601.pdf).\nLeap seconds are ignored.\n\nInternally, the time is stored as an `Int64` representing seconds from epoch\n(`0001-01-01 00:00:00.0 UTC`) and an `Int32` representing\nnanosecond-of-second with value range `0..999_999_999`.\n\nThe supported date range is `0001-01-01 00:00:00.0` to\n`9999-12-31 23:59:59.999_999_999` in any local time zone.\n\n### Telling the Time\n\nThere are several methods to retrieve a `Time` instance representing the\ncurrent time:\n\n```\nTime.utc # returns the current time in UTC\nTime.local Time::Location.load(\"Europe/Berlin\") # returns the current time in time zone Europe/Berlin\nTime.local # returns the current time in current time zone\n```\n\nIt is generally recommended to keep instances in UTC and only apply a\nlocal time zone when formatting for user display, unless the domain logic\nrequires having a specific time zone (for example for calendaric operations).\n\n### Creating a Specific Instant\n\n`Time` instances representing a specific instant can be created by\n`.utc` or `.new` with the date-time specified as individual arguments:\n\n```\ntime = Time.utc(2016, 2, 15, 10, 20, 30)\ntime.to_s # => \"2016-02-15 10:20:30 UTC\"\ntime = Time.local(2016, 2, 15, 10, 20, 30, location: Time::Location.load(\"Europe/Berlin\"))\ntime.to_s # => \"2016-02-15 10:20:30 +01:00\"\n# The time-of-day can be omitted and defaults to midnight (start of day):\ntime = Time.utc(2016, 2, 15)\ntime.to_s # => \"2016-02-15 00:00:00 UTC\"\n```\n\n### Retrieving Time Information\n\nEach `Time` instance allows querying calendar data:\n\n```\ntime = Time.utc(2016, 2, 15, 10, 20, 30)\ntime.year # => 2016\ntime.month # => 2\ntime.day # => 15\ntime.hour # => 10\ntime.minute # => 20\ntime.second # => 30\ntime.millisecond # => 0\ntime.nanosecond # => 0\ntime.day_of_week # => Time::DayOfWeek::Monday\ntime.day_of_year # => 46\ntime.monday? # => true\ntime.time_of_day # => 10:20:30\n```\n\nFor querying if a time is at a specific day of week, `Time` offers named\npredicate methods, delegating to `#day_of_week`:\n\n```\ntime.monday? # => true\n# ...\ntime.sunday? # => false\n```\n\n### Time Zones\n\nEach time is attached to a specific time zone, represented by a `Location`\n(see `#location`).\n`#zone` returns the time zone observed in this location at the current time\n(i.e. the instant represented by this `Time`).\n`#offset` returns the offset of the current zone in seconds.\n\n```\ntime = Time.local(2018, 3, 8, 22, 5, 13, location: Time::Location.load(\"Europe/Berlin\"))\ntime # => 2018-03-08 22:05:13 +01:00 Europe/Berlin\ntime.location # => #\ntime.zone # => #\ntime.offset # => 3600\n```\n\nUsing `.utc`, the location is `Time::Location::UTC`:\n\n```\ntime = Time.utc(2018, 3, 8, 22, 5, 13)\ntime # => 2018-03-08 22:05:13.0 UTC\ntime.location # => #\ntime.zone # => #\ntime.offset # => 0\n```\n\nA `Time` instance can be transformed to a different time zone while retaining\nthe same instant using `#in`:\n\n```\ntime_de = Time.local(2018, 3, 8, 22, 5, 13, location: Time::Location.load(\"Europe/Berlin\"))\ntime_ar = time_de.in Time::Location.load(\"America/Buenos_Aires\")\ntime_de # => 2018-03-08 22:05:13 +01:00 Europe/Berlin\ntime_ar # => 2018-03-08 18:05:13 -03:00 America/Buenos_Aires\n```\n\nBoth `Time` instances show a different local date-time, but they represent\nthe same date-time in the instant time-line, therefore they are considered\nequal:\n\n```\ntime_de.to_utc # => 2018-03-08 21:05:13 UTC\ntime_ar.to_utc # => 2018-03-08 21:05:13 UTC\ntime_de == time_ar # => true\n```\n\nThere are also two special methods for converting to UTC and local time zone:\n\n```\ntime.to_utc # equals time.in(Location::UTC)\ntime.to_local # equals time.in(Location.local)\n```\n\n`#to_local_in` allows changing the time zone while keeping\nthe same local date-time (wall clock) which results in a different instant\non the time line.\n\n### Formatting and Parsing Time\n\nTo make date-time instances exchangeable between different computer systems\nor readable to humans, they are usually converted to and from a string\nrepresentation.\n\nThe method `#to_s` formats the date-time according to a specified pattern.\n\n```\ntime = Time.utc(2015, 10, 12, 10, 30, 0)\ntime.to_s(\"%Y-%m-%d %H:%M:%S %:z\") # => \"2015-10-12 10:30:00 +00:00\"\n```\n\nSimilarly, `Time.parse` and `Time.parse!` are used to construct a `Time` instance from date-time\ninformation in a string, according to a specified pattern:\n\n```\nTime.parse(\"2015-10-12 10:30:00 +00:00\", \"%Y-%m-%d %H:%M:%S %z\", Time::Location::UTC)\nTime.parse!(\"2015-10-12 10:30:00 +00:00\", \"%Y-%m-%d %H:%M:%S %z\")\n```\n\nSee `Time::Format` for all directives.\n\n### Calculations\n\n```\nTime.utc(2015, 10, 10) - 5.days # => 2015-10-05 00:00:00 +00:00\n\nspan = Time.utc(2015, 10, 10) - Time.utc(2015, 9, 10)\nspan.days # => 30\nspan.total_hours # => 720\nspan.total_minutes # => 43200\n```\n\n## Measuring Time\n\nThe typical time representation provided by the operating system is based on\na \"wall clock\" which is subject to changes for clock synchronization.\nThis can result in discontinuous jumps in the time-line making it not\nsuitable for accurately measuring elapsed time.\n\nInstances of `Time` are focused on telling time – using a \"wall clock\".\nWhen `Time.local` is called multiple times, the difference between the\nreturned instances is not guaranteed to equal to the time elapsed between\nmaking the calls; even the order of the returned `Time` instances might\nnot reflect invocation order.\n\n```\nt1 = Time.utc\n# operation that takes 1 minute\nt2 = Time.utc\nt2 - t1 # => ?\n```\n\nThe resulting `Time::Span` could be anything, even negative, if the\ncomputer's wall clock has changed between both calls.\n\nAs an alternative, the operating system also provides a monotonic clock.\nIts time-line has no specified starting point but is strictly linearly\nincreasing.\n\nThis monotonic clock should always be used for measuring elapsed time.\n\nA reading from this clock can be taken using `.monotonic`:\n\n```\nt1 = Time.monotonic\n# operation that takes 1 minute\nt2 = Time.monotonic\nt2 - t1 # => 1.minute (approximately)\n```\n\nThe execution time of a block can be measured using `.measure`:\n\n```\nelapsed_time = Time.measure do\n # operation that takes 20 milliseconds\nend\nelapsed_time # => 20.milliseconds (approximately)\n```","summary":"

Time represents a date-time instant in incremental time observed in a specific time zone.

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":8,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L8"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"self.nil?"}}],"types":[{"html_id":"avram/Time/Lucky","path":"Time/Lucky.html","kind":"module","full_name":"Time::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"TIME_FORMATS","name":"TIME_FORMATS","value":"[Time::Format::ISO_8601_DATE_TIME, Time::Format::RFC_2822, Time::Format::RFC_3339, Time::Format.new(\"%Y-%m-%dT%H:%M:%S\", Time::Location::UTC), Time::Format.new(\"%Y-%m-%dT%H:%M\", Time::Location::UTC), Time::Format::HTTP_DATE, Time::Format::ISO_8601_DATE, Time::Format::ISO_8601_TIME]"}],"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/Time","kind":"struct","full_name":"Time","name":"Time"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":25,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L25"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, Time).new(query, column)"}},{"html_id":"try_parsing_with_default_formatters(value:String)-class-method","name":"try_parsing_with_default_formatters","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":42,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L42"},"def":{"name":"try_parsing_with_default_formatters","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"TIME_FORMATS.find do |format|\n begin\n format.parse(value)\n rescue e : Time::Format::Error\n nil\n end\nend.try do |format|\n SuccessfulCast.new((format.parse(value)).to_utc)\nend"}},{"html_id":"try_parsing_with_string_formats(value)-class-method","name":"try_parsing_with_string_formats","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":54,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L54"},"def":{"name":"try_parsing_with_string_formats","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":"Avram.settings.time_formats.find do |format|\n begin\n Time.parse(value, format, Time::Location.load(\"UTC\"))\n rescue e : Time::Format::Error\n nil\n end\nend.try do |format|\n SuccessfulCast.new((Time.parse(value, format, Time::Location.load(\"UTC\"))).to_utc)\nend"}}],"instance_methods":[{"html_id":"from_db!(value:Time)-instance-method","name":"from_db!","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time)","args_html":"(value : Time)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":29,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L29"},"def":{"name":"from_db!","args":[{"name":"value","external_name":"value","restriction":"Time"}],"visibility":"Public","body":"value"}},{"html_id":"parse(value:String):SuccessfulCast(Time)|FailedCast-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String) : SuccessfulCast(Time) | FailedCast","args_html":"(value : String) : SuccessfulCast(Time) | FailedCast","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":33,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L33"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"return_type":"SuccessfulCast(Time) | FailedCast","visibility":"Public","body":"((try_parsing_with_string_formats(value)) || (try_parsing_with_default_formatters(value))) || FailedCast.new"}},{"html_id":"parse(value:Time)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time)","args_html":"(value : Time)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":66,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L66"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"Time"}],"visibility":"Public","body":"SuccessfulCast(Time).new(value)"}},{"html_id":"parse(values:Array(Time))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(Time)"}],"args_string":"(values : Array(Time))","args_html":"(values : Array(Time))","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":70,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L70"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(Time)"}],"visibility":"Public","body":"SuccessfulCast(Array(Time)).new(values)"}},{"html_id":"to_db(value:Time):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"Time"}],"args_string":"(value : Time) : String","args_html":"(value : Time) : String","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":74,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L74"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"Time"}],"return_type":"String","visibility":"Public","body":"value.to_s(\"%F %X.%6N %z\")"}}],"types":[{"html_id":"avram/Time/Lucky/ColumnType","path":"Time/Lucky/ColumnType.html","kind":"alias","full_name":"Time::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"Time","aliased_html":"Time","const":false,"namespace":{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"}},{"html_id":"avram/Time/Lucky/Criteria","path":"Time/Lucky/Criteria.html","kind":"class","full_name":"Time::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/ExtractCriteria","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria"},{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/time_extensions.cr","line_number":78,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L78"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/BetweenCriteria","kind":"module","full_name":"Avram::BetweenCriteria","name":"BetweenCriteria"},{"html_id":"avram/Avram/ExtractCriteria","kind":"module","full_name":"Avram::ExtractCriteria","name":"ExtractCriteria"}],"namespace":{"html_id":"avram/Time/Lucky","kind":"module","full_name":"Time::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"as_date-instance-method","name":"as_date","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":82,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L82"},"def":{"name":"as_date","visibility":"Public","body":"Criteria(T, String).new(rows, \"DATE(#{column})\")"}},{"html_id":"between(low_value:V,high_value:V)-instance-method","name":"between","doc":"WHERE @column >= `low_value` AND @column <= `high_value`","summary":"

WHERE @column >= low_value AND @column <= high_value

","abstract":false,"args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"args_string":"(low_value : V, high_value : V)","args_html":"(low_value : V, high_value : V)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":79,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L79"},"def":{"name":"between","args":[{"name":"low_value","external_name":"low_value","restriction":"V"},{"name":"high_value","external_name":"high_value","restriction":"V"}],"visibility":"Public","body":"add_clauses([Avram::Where::GreaterThanOrEqualTo.new(@column, V.adapter.to_db!(low_value)), Avram::Where::LessThanOrEqualTo.new(@column, V.adapter.to_db!(high_value))])"}},{"html_id":"extract(chrono_unit:Avram::ChronoUnits)-instance-method","name":"extract","abstract":false,"args":[{"name":"chrono_unit","external_name":"chrono_unit","restriction":"Avram::ChronoUnits"}],"args_string":"(chrono_unit : Avram::ChronoUnits)","args_html":"(chrono_unit : Avram::ChronoUnits)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract","args":[{"name":"chrono_unit","external_name":"chrono_unit","restriction":"Avram::ChronoUnits"}],"visibility":"Public","body":"chrono_unit_in_sql_format = chrono_unit.to_s.underscore\napplied_operation = \"extract(#{chrono_unit_in_sql_format} from #{@column})\"\ncase chrono_unit\nwhen .julian?, .second?, .milliseconds?, .epoch?\n Criteria(T, Float64).new(rows, applied_operation)\nelse\n Criteria(T, Int32).new(rows, applied_operation)\nend\n"}},{"html_id":"extract(symbol:Symbol)-instance-method","name":"extract","abstract":false,"args":[{"name":"symbol","external_name":"symbol","restriction":"Symbol"}],"args_string":"(symbol : Symbol)","args_html":"(symbol : Symbol)","location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract","args":[{"name":"symbol","external_name":"symbol","restriction":"Symbol"}],"visibility":"Public","body":"if \"[century, day, decade, dow, doy, epoch, hour, isodow, isoyear, julian, microseconds, millennium, milliseconds, minute, month, quarter, second, timezone, timezone_hour, timezone_minute, week, year]\".includes?(symbol.to_s)\nelse\n raise(ArgumentError.new(\"Illegal value #{symbol} as a chrono unit. Allowed values are [century, day, decade, dow, doy, epoch, hour, isodow, isoyear, julian, microseconds, millennium, milliseconds, minute, month, quarter, second, timezone, timezone_hour, timezone_minute, week, year]\"))\nend\nchrono_unit_enum_member = symbol.to_s.camelcase\nextract(Avram::ChronoUnits.parse(chrono_unit_enum_member))\n"}},{"html_id":"extract_century-instance-method","name":"extract_century","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_century","visibility":"Public","body":"extract(:century)"}},{"html_id":"extract_day-instance-method","name":"extract_day","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_day","visibility":"Public","body":"extract(:day)"}},{"html_id":"extract_decade-instance-method","name":"extract_decade","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_decade","visibility":"Public","body":"extract(:decade)"}},{"html_id":"extract_dow-instance-method","name":"extract_dow","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_dow","visibility":"Public","body":"extract(:dow)"}},{"html_id":"extract_doy-instance-method","name":"extract_doy","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_doy","visibility":"Public","body":"extract(:doy)"}},{"html_id":"extract_epoch-instance-method","name":"extract_epoch","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_epoch","visibility":"Public","body":"extract(:epoch)"}},{"html_id":"extract_hour-instance-method","name":"extract_hour","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_hour","visibility":"Public","body":"extract(:hour)"}},{"html_id":"extract_isodow-instance-method","name":"extract_isodow","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_isodow","visibility":"Public","body":"extract(:isodow)"}},{"html_id":"extract_isoyear-instance-method","name":"extract_isoyear","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_isoyear","visibility":"Public","body":"extract(:isoyear)"}},{"html_id":"extract_julian-instance-method","name":"extract_julian","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_julian","visibility":"Public","body":"extract(:julian)"}},{"html_id":"extract_microseconds-instance-method","name":"extract_microseconds","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_microseconds","visibility":"Public","body":"extract(:microseconds)"}},{"html_id":"extract_millennium-instance-method","name":"extract_millennium","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_millennium","visibility":"Public","body":"extract(:millennium)"}},{"html_id":"extract_milliseconds-instance-method","name":"extract_milliseconds","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_milliseconds","visibility":"Public","body":"extract(:milliseconds)"}},{"html_id":"extract_minute-instance-method","name":"extract_minute","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_minute","visibility":"Public","body":"extract(:minute)"}},{"html_id":"extract_month-instance-method","name":"extract_month","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_month","visibility":"Public","body":"extract(:month)"}},{"html_id":"extract_quarter-instance-method","name":"extract_quarter","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_quarter","visibility":"Public","body":"extract(:quarter)"}},{"html_id":"extract_second-instance-method","name":"extract_second","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_second","visibility":"Public","body":"extract(:second)"}},{"html_id":"extract_timezone-instance-method","name":"extract_timezone","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone","visibility":"Public","body":"extract(:timezone)"}},{"html_id":"extract_timezone_hour-instance-method","name":"extract_timezone_hour","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone_hour","visibility":"Public","body":"extract(:timezone_hour)"}},{"html_id":"extract_timezone_minute-instance-method","name":"extract_timezone_minute","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_timezone_minute","visibility":"Public","body":"extract(:timezone_minute)"}},{"html_id":"extract_week-instance-method","name":"extract_week","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_week","visibility":"Public","body":"extract(:week)"}},{"html_id":"extract_year-instance-method","name":"extract_year","abstract":false,"location":{"filename":"src/avram/charms/time_extensions.cr","line_number":80,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/time_extensions.cr#L80"},"def":{"name":"extract_year","visibility":"Public","body":"extract(:year)"}}]}]}]},{"html_id":"avram/UUID","path":"UUID.html","kind":"struct","full_name":"UUID","name":"UUID","abstract":false,"superclass":{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"},{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"avram/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"lib/lucky/src/charms/uuid_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/lib/lucky/src/charms/uuid_extensions.cr#L1"},{"filename":"src/avram/blank_extensions.cr","line_number":49,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L49"},{"filename":"src/avram/charms/uuid_extensions.cr","line_number":1,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L1"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"avram/Lucky/AllowedInTags","kind":"module","full_name":"Lucky::AllowedInTags","name":"AllowedInTags"}],"doc":"Represents a UUID (Universally Unique IDentifier).\n\nNOTE: To use `UUID`, you must explicitly import it with `require \"uuid\"`","summary":"

Represents a UUID (Universally Unique IDentifier).

","class_methods":[{"html_id":"adapter-class-method","name":"adapter","abstract":false,"location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":2,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L2"},"def":{"name":"adapter","visibility":"Public","body":"Lucky"}}],"instance_methods":[{"html_id":"blank?:Bool-instance-method","name":"blank?","abstract":false,"location":{"filename":"src/avram/blank_extensions.cr","line_number":50,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/blank_extensions.cr#L50"},"def":{"name":"blank?","return_type":"Bool","visibility":"Public","body":"false"}}],"types":[{"html_id":"avram/UUID/Lucky","path":"UUID/Lucky.html","kind":"module","full_name":"UUID::Lucky","name":"Lucky","abstract":false,"ancestors":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L6"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/Type","kind":"module","full_name":"Avram::Type","name":"Type"}],"extended_modules":[{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}],"namespace":{"html_id":"avram/UUID","kind":"struct","full_name":"UUID","name":"UUID"},"class_methods":[{"html_id":"criteria(query:T,column)forallT-class-method","name":"criteria","abstract":false,"args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"args_string":"(query : T, column) forall T","args_html":"(query : T, column) forall T","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":10,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L10"},"def":{"name":"criteria","args":[{"name":"query","external_name":"query","restriction":"T"},{"name":"column","external_name":"column","restriction":""}],"visibility":"Public","body":"Criteria(T, UUID).new(query, column)"}}],"instance_methods":[{"html_id":"parse(value:UUID)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"UUID"}],"args_string":"(value : UUID)","args_html":"(value : UUID)","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":14,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L14"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"UUID"}],"visibility":"Public","body":"SuccessfulCast(UUID).new(value)"}},{"html_id":"parse(values:Array(UUID))-instance-method","name":"parse","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"args_string":"(values : Array(UUID))","args_html":"(values : Array(UUID))","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":18,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L18"},"def":{"name":"parse","args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"visibility":"Public","body":"SuccessfulCast(Array(UUID)).new(values)"}},{"html_id":"parse(value:String)-instance-method","name":"parse","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"String"}],"args_string":"(value : String)","args_html":"(value : String)","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":22,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L22"},"def":{"name":"parse","args":[{"name":"value","external_name":"value","restriction":"String"}],"visibility":"Public","body":"begin\n SuccessfulCast(UUID).new(UUID.new(value))\nrescue\n FailedCast.new\nend"}},{"html_id":"to_db(value:UUID):String-instance-method","name":"to_db","abstract":false,"args":[{"name":"value","external_name":"value","restriction":"UUID"}],"args_string":"(value : UUID) : String","args_html":"(value : UUID) : String","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":28,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L28"},"def":{"name":"to_db","args":[{"name":"value","external_name":"value","restriction":"UUID"}],"return_type":"String","visibility":"Public","body":"value.to_s"}},{"html_id":"to_db(values:Array(UUID))-instance-method","name":"to_db","abstract":false,"args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"args_string":"(values : Array(UUID))","args_html":"(values : Array(UUID))","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":32,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L32"},"def":{"name":"to_db","args":[{"name":"values","external_name":"values","restriction":"Array(UUID)"}],"visibility":"Public","body":"PQ::Param.encode_array(values)"}}],"types":[{"html_id":"avram/UUID/Lucky/ColumnType","path":"UUID/Lucky/ColumnType.html","kind":"alias","full_name":"UUID::Lucky::ColumnType","name":"ColumnType","abstract":false,"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":7,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L7"}],"repository_name":"avram","program":false,"enum":false,"alias":true,"aliased":"UUID","aliased_html":"UUID","const":false,"namespace":{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"}},{"html_id":"avram/UUID/Lucky/Criteria","path":"UUID/Lucky/Criteria.html","kind":"class","full_name":"UUID::Lucky::Criteria(T, V)","name":"Criteria","abstract":false,"superclass":{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},"ancestors":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"},{"html_id":"avram/Avram/Criteria","kind":"class","full_name":"Avram::Criteria","name":"Criteria"},{"html_id":"avram/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"avram/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/avram/charms/uuid_extensions.cr","line_number":36,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L36"}],"repository_name":"avram","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"avram/Avram/IncludesCriteria","kind":"module","full_name":"Avram::IncludesCriteria","name":"IncludesCriteria"}],"namespace":{"html_id":"avram/UUID/Lucky","kind":"module","full_name":"UUID::Lucky","name":"Lucky"},"constructors":[{"html_id":"new(rows:T,column:Symbol|String)-class-method","name":"new","abstract":false,"args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"args_string":"(rows : T, column : Symbol | String)","args_html":"(rows : T, column : Symbol | String)","location":{"filename":"src/avram/criteria.cr","line_number":6,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/criteria.cr#L6"},"def":{"name":"new","args":[{"name":"rows","external_name":"rows","restriction":"T"},{"name":"column","external_name":"column","restriction":"Symbol | String"}],"visibility":"Public","body":"_ = Criteria(T, V).allocate\n_.initialize(rows, column)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"includes(value):T-instance-method","name":"includes","doc":"WHERE `value` = ANY(column)","summary":"

WHERE value = ANY(column)

","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value) : T","args_html":"(value) : T","location":{"filename":"src/avram/charms/uuid_extensions.cr","line_number":37,"url":"https://github.com/luckyframework/avram/blob/9ad64b90928458e07e35b6a02a404aa6fb90de33/src/avram/charms/uuid_extensions.cr#L37"},"def":{"name":"includes","args":[{"name":"value","external_name":"value","restriction":""}],"return_type":"T","visibility":"Public","body":"value = V.adapter.to_db!(value)\nadd_clause(Avram::Where::Includes.new(column, value))\n"}}]}]}]}]}}) \ No newline at end of file