Esempio n. 1
0
    def log_reopen(cls, immediate=True):
        """Reopen a log

        :param immediate: execute query immediately if True
        :returns: result of 'log_reopen' query if ``immediate`` argument is
            True, otherwise :class:`pyroonga.odm.query.SimpleQuery` object for
            lazy execution
        """
        query = SimpleQuery(cls).log_reopen()
        return query.execute() if immediate else query
Esempio n. 2
0
    def truncate(cls, immediate=True):
        """Truncate the all records in table

        :param immediate: Truncate records immediately if True
        :returns: If ``immediate`` argument is True, True if successful,
            otherwise False. If ``immediate`` argument is False, It returns
            :class:`pyroonga.odm.query.SimpleQuery` object for lazy execution
        """
        query = SimpleQuery(cls).truncate()
        return query.execute() if immediate else query
Esempio n. 3
0
    def log_put(cls, level, message, immediate=True):
        """Output the log

        :param level: Log level of log output. Values are defined in
            :class:`pyroonga.odm.attributes.LogLevel`
        :param immediate: execute query immediately if True
        :returns: result of 'log_put' query if ``immediate`` argument is
            True, otherwise :class:`pyroonga.odm.query.SimpleQuery` object for
            lazy execution
        """
        query = SimpleQuery(cls).log_put(level, message)
        return query.execute() if immediate else query
Esempio n. 4
0
    def cache_limit(cls, max_limit=None, immediate=True):
        """Get or set the limit of cache

        :param max_limit: max number of cache limit to set.
            If ``None``, this method will get the current value of cache limit
        :param immediate: execute query immediately if True
        :returns: result of 'cache_limit' query if ``immediate`` argument is
            True, otherwise :class:`pyroonga.odm.query.SimpleQuery` object for
            lazy execution
        """
        query = SimpleQuery(cls).cache_limit(max_limit=max_limit)
        return query.execute() if immediate else query
Esempio n. 5
0
    def delete(cls, immediate=True, *args, **kwargs):
        """Delete the record

        :param immediate: Delete the record immediately if True
        :param args: It will be a passed to
            :meth:`pyroonga.odm.query.SimpleQuery.delete`
        :param kwargs: It will be a passed to
            :meth:`pyroonga.odm.query.SimpleQuery.delete`
        :returns: If ``immediate`` argument is True, True if successful,
            otherwise False. If ``immediate`` argument is False, It returns
            :class:`pyroonga.odm.query.SimpleQuery` object for lazy execution
        """
        query = SimpleQuery(cls).delete(*args, **kwargs)
        return query.execute() if immediate else query