Problems with playhouse.db_url.connect objects when initialising database connection
You might try removing one of the slashes on the sqlite filename.

It seems a bit wonky to use `connect` to instantiate a db object, only to throw it away and call `init` on a different instance. I get that you want to use the logic in `connect()` -- but it seems like if you can do it in one place you should be able to do it in the other (e.g. in `models.py`). See also:

* http://docs.peewee-orm.com/en/latest/peewee/database.html#run-time-database-configuration
* http://docs.peewee-orm.com/en/latest/peewee/database.html#dynamically-defining-a-database Thanks for the response. How do I do this with a connection string? I'm working in an environment with different database backends on different machines - just Sqlite and PostgreSQL at the moment but I'd like to be able to use others in the future. How can I do this so that I don't have to parse the database config to work out which type of database object to create? 

Using database URLs is perfect, as long as I can do lazy instantiation at run time. > OperationalError: FATAL: database "/Users/andy47/my_db.sqlite" does not exist

Wait a sec...is that error occurring because in your models you have `db = PostgresqlDatabase(None)`? Could have been, after your advice a couple of comments earlier I've changed this to a `Proxy()` object. I'm not sure why you have closed this, I still can't do a lazy instantiation of a database connection based on a connection string. ```python

db = Proxy()

class BaseModel(Model):
    class Meta:
        database = db

# ... some time later ...
real_db = connect(connection_string)
db.initialize(real_db)
```
I'm trying to dynamically initialise my database connection (at run time) using connection strings. This works fine with PostgreSQL

```
>>> from playhouse.db_url import connect
>>> db = connect('postgres://user:password@localhost/database')
>>> import models
>>> models.db.init(db.database, **db.connect_kwargs)
```

Then any subsequent operations on the classes in the models module work fine.

But if I try the same thing with a Sqlite connection string, e.g.

```
...
>>> db = connect('sqlite:////Users/andy47/my_db.sqlite')
...
```

Operations on the db object are fine (e.g. `execute_sql`) but when I use this in the `db.init` and then subsequently try and query a model class I get an error message;

`OperationalError: FATAL:  database "/Users/andy47/my_db.sqlite" does not exist`

I note that the documentation (http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#db-url) only mentions databases in the current directory when discussing `sqlite` connection strings. But the connect works and provides a viable database connection. It's just when I use this to initialise my model database connection at run time that I get the error.

I've got a question at StackOverflow talking about this as well - https://stackoverflow.com/questions/47273956/run-time-initialisation-of-peewee-database-for-different-database-backends 