# Is it possible to generate the model at tun time?

**URL:** <https://discourse.diesel.rs/t/is-it-possible-to-generate-the-model-at-tun-time/129>\
**Category:** Diesel 2.0\
**Created:** [November 25, 2019, 12:10am UTC](https://discourse.diesel.rs/t/is-it-possible-to-generate-the-model-at-tun-time/129 "2019-11-25T00:10:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorfsmay](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.diesel.rs/dorfsmay/32/62_2.png) [@dorfsmay](https://discourse.diesel.rs/u/dorfsmay)\
**Post date:** [November 25, 2019, 12:10am UTC](https://discourse.diesel.rs/t/is-it-possible-to-generate-the-model-at-tun-time/129/1 "2019-11-25T00:10:18Z")

</div>

I have an applications that need to generate or modify the model at run time.

Is this possible to do with Diesel?

From a cursory looks, it looks like the apps will have to be re-compiled every time the model is changed. Is that correct?

---

<div class="post-metadata">

**Author:** ![weiznich](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.diesel.rs/weiznich/32/64_2.png) [@weiznich](https://discourse.diesel.rs/u/weiznich)\
**Post date:** [November 25, 2019, 10:37pm UTC](https://discourse.diesel.rs/t/is-it-possible-to-generate-the-model-at-tun-time/129/2 "2019-11-25T22:37:25Z")

</div>

Yes diesel itself assumes that the schema is known at compile time. That does not mean that you cannot create those tables at run time, it means only that you need to know the structure of all table.  
Beside of diesel, there is the [`diesel-dynamic-schema`](https://github.com/diesel-rs/diesel-dynamic-schema) crate, that allows you to work with a truly dynamic schema.
