Top Level Namespace

Defined Under Namespace

Modules: BlackStack

Instance Method Summary collapse

Instance Method Details

#guidObject

return a postgresql uuid



53
54
55
56
57
58
59
60
61
# File 'lib/blackstack-db.rb', line 53

def guid()
    if BlackStack.db_type == BlackStack::TYPE_POSTGRESQL
        return BlackStack::PostgreSQL.guid
    elsif BlackStack.db_type == BlackStack::TYPE_CRDB
        return BlackStack::CRDB.guid
    else
        raise "Unknown database type"
    end
end

#nowObject

return current datetime with format ‘YYYY-MM-DD HH:MM:SS`



64
65
66
67
68
69
70
71
72
# File 'lib/blackstack-db.rb', line 64

def now()
    if BlackStack.db_type == BlackStack::TYPE_POSTGRESQL
        return BlackStack::PostgreSQL.now
    elsif BlackStack.db_type == BlackStack::TYPE_CRDB
        return BlackStack::CRDB.now
    else
        raise "Unknown database type"
    end
end