79
79
{% endmacro %}
80
80
81
81
{% 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 - %}
83
87
temporary
84
- {%- endif %} table {{ relation }}
85
- as
88
+ {%- endif %} table {{ relation }}
89
+ as
86
90
{{ sql }}
87
91
{% endmacro %}
88
92
89
93
{% 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 %}
90
98
create view {{ relation }} as
91
99
{{ sql }};
92
100
{%- endmacro %}
96
104
{# see SQLiteAdapter.rename_relation() #}
97
105
{% endmacro %}
98
106
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
-
108
107
{#
109
108
the only allowable schema for temporary tables in SQLite is ' temp' , so set
110
109
that 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
116
115
117
116
{% do return(tmp_relation) %}
118
117
{% endmacro %}
119
-
120
- {% macro sqlite__current_timestamp() - %}
121
- datetime()
122
- {%- endmacro %}
0 commit comments