forked from llimllib/chrome-control
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Database.py
52 lines (36 loc) · 1.24 KB
/
Database.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from enum import Enum
from typing import Any, List
from base import ChromeCommand
# Unique identifier of Database object.
DatabaseId = str
class Database:
"""Database object."""
def __init__(self, id: "DatabaseId", domain: str, name: str, version: str):
# Database ID.
self.id = id
# Database domain.
self.domain = domain
# Database name.
self.name = name
# Database version.
self.version = version
class Error:
"""Database error."""
def __init__(self, message: str, code: int):
# Error message.
self.message = message
# Error code.
self.code = code
class enable(ChromeCommand):
"""Enables database tracking, database events will now be delivered to the client."""
def __init__(self): pass
class disable(ChromeCommand):
"""Disables database tracking, prevents database events from being sent to the client."""
def __init__(self): pass
class getDatabaseTableNames(ChromeCommand):
def __init__(self, databaseId: "DatabaseId"):
self.databaseId = databaseId
class executeSQL(ChromeCommand):
def __init__(self, databaseId: "DatabaseId", query: str):
self.databaseId = databaseId
self.query = query