7979{% endmacro %}
8080
8181{% macro sqlite__create_table_as(temporary, relation, sql) - %}
82- create {% if temporary - %}
82+ {% set contract_config = config .get (' contract' ) %}
83+ {% if contract_config .enforced %}
84+ {{exceptions .warn (" Model contracts cannot be enforced by sqlite!" )}}
85+ {% endif %}
86+ create {% if temporary - %}
8387 temporary
84- {%- endif %} table {{ relation }}
85- as
88+ {%- endif %} table {{ relation }}
89+ as
8690 {{ sql }}
8791{% endmacro %}
8892
8993{% macro sqlite__create_view_as(relation, sql, auto_begin= False) - %}
94+ {% set contract_config = config .get (' contract' ) %}
95+ {% if contract_config .enforced %}
96+ {{exceptions .warn (" Model contracts cannot be enforced by sqlite!" )}}
97+ {% endif %}
9098 create view {{ relation }} as
9199 {{ sql }};
92100{%- endmacro %}
96104 {# see SQLiteAdapter.rename_relation() #}
97105{% endmacro %}
98106
99- {% macro sqlite__snapshot_get_time() - %}
100- datetime()
101- {%- endmacro %}
102-
103- {% macro sqlite__snapshot_string_as_time(timestamp ) - %}
104- {# just return the string; SQLite doesn't have a timestamp data type per se #}
105- {{ return(" '" + timestamp |string + " '" ) }}
106- {%- endmacro %}
107-
108107{#
109108the only allowable schema for temporary tables in SQLite is ' temp' , so set
110109that here when making the relation and everything else should Just Work
@@ -116,7 +115,3 @@ that here when making the relation and everything else should Just Work
116115
117116 {% do return(tmp_relation) %}
118117{% endmacro %}
119-
120- {% macro sqlite__current_timestamp() - %}
121- datetime()
122- {%- endmacro %}
0 commit comments