get raw sql without parameters
At present Peewee's schema manager does not have support for views.

Just write out the SQL. In the time you took to type up your issue, and for me to respond, surely you could have typed out the SQL?

If you insist, you can implement a custom query component.

Here's a complete example:

```python

from peewee import *
from peewee import ColumnBase

class AsIsValue(ColumnBase):
    def __init__(self, value):
        self._value = value
        super(AsIsValue, self).__init__()

    def __sql__(self, ctx):
        if isinstance(self._value, str):
            # Ensure strings are quoted.
            value = "'%s'" % self._value
        elif self._value in (True, False):
            # Convert boolean to integers.
            value = 1 if self._value else 0
        elif self._value is None:
            value = 'NULL'
        return ctx.literal(str(value))

db = SqliteDatabase(':memory:')

class User(Model):
    username = TextField()
    is_admin = BooleanField(default=False)
    class Meta:
        database = db

db.create_tables([User])

for username, admin in [('huey', True), ('mickey', False), ('zaizee', True)]:
    User.create(username=username, is_admin=admin)

admin = (User
         .select()
         .where(User.is_admin == AsIsValue(True))
         .order_by(User.username))

view_sql = 'CREATE VIEW "user_admin" AS %s' % admin.sql()[0]
db.execute_sql(view_sql)

Admin = Table('user_admin', ('id', 'username', 'is_admin'))
for obj in Admin.select().execute(db):
    print(obj['username'])
```

Now...which is easier? Up to you. I did something like this and it works like a charm. I am Not sure it is elegant 


```python
class Variant(Model):
	class Meta:
		database = db 

	@classmethod
	def create_view(cls,name, where_clause):
		sql = Variant.select().where(where_clause).sql()

		# replace parameters in raw sql  
		raw    = sql[0]
		params = sql[1] 

		for param in params:
                        # quote params 
			param = f"'{param}'"
			raw = raw.replace("?", param, 1) 

		Variant._meta.database.obj.execute_sql(f"CREATE VIEW {name} AS {raw}")
		# Create a class dynamically
		class VariantView(cls):
			class Meta:
				db_table = name

		return VariantView

Variant.select().count() // return 590

MyView = Variant.create_view("my_view", Variant.pos > 432234 ) 
MyView.select().count() // return 121 


``` The use of formatting strings is just vomit, in my opinion...yuck. Whatever works man. I'm glad I'm not maintaining that mess, though.
I would like to create a view from a select statement.
Actually, I m trying this : 

    rawsql = Variant.select().where(Variant.pos > 3000).sql()[0]
    db.execute_sql(f"CREATE VIEW test AS {rawsql}" ) 

Unfortunally, with SQLITE it returns 

    OperationalError: parameters are not allowed in views


How can I get the raw sql without parameters ?

      WHERE value = 3 instead of  WHERE value = ?  , 3 