def openFromUrl()

in tbapi/__init__.py [0:0]


    def openFromUrl(url: str, readonly: bool, user: str = None, password: str = None):
        '''Creates a new database instance with the specified root folder, or URL, and opens it.

        Args:
            url (str): Connection URL.
            readonly (bool): Open data store in read-only mode.
            user (str): User.
            password (str): Password.

        Returns:
            TickDb: An opened TickDB instance.
        '''
        db = TickDb.createFromUrl(url, user, password)
        try:
            db.open(readonly)
            yield db
        finally:
            if db.isOpen():
                db.close()