Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SQLlite #69

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
REDIS = 'redis'
S3 = 's3'
SERVER_TIME = 'server_time'
SQLITE = 'sqlite3'
HTTP_CONNECTION = 'http'

ALL_CHECKS = {
Expand All @@ -41,7 +40,6 @@
REDIS: 'Redis',
S3: 'S3 Bucket',
SERVER_TIME: 'Server Time',
SQLITE: 'SQLite3',
HTTP_CONNECTION: 'HTTP Checks',
}

Expand All @@ -58,7 +56,7 @@ def index(request):
"headers": dict(request.headers),
})

status_check_results = [server_time_check(), git_information(), sqlite_check()]
status_check_results = [server_time_check(), git_information()]

optional_checks: Dict[str, Callable] = {
POSTGRES_RDS: postgres_rds_check,
Expand Down Expand Up @@ -117,20 +115,6 @@ def postgres_aurora_check():
return render_connection_info(addon_type, False, str(e))


def sqlite_check():
addon_type = ALL_CHECKS[SQLITE]
try:
db_name = "default"
if RDS_POSTGRES_CREDENTIALS:
db_name = "sqlite"

with connections[db_name].cursor() as c:
c.execute('SELECT SQLITE_VERSION()')
return render_connection_info(addon_type, True, c.fetchone()[0])
except Exception as e:
return render_connection_info(addon_type, False, str(e))


def redis_check():
addon_type = ALL_CHECKS[REDIS]
try:
Expand Down
6 changes: 1 addition & 5 deletions demodjango/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,7 @@
DATABASES = {
"default": dj_database_url.config(
default=database_url_from_env("RDS_POSTGRES_CREDENTIALS")
),
"sqlite": {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': sqlite_db_root / "demodjango.sqlite3",
}
)
}
else:
DATABASES = {
Expand Down
5 changes: 0 additions & 5 deletions tests/smoke/test_landing_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
REDIS,
S3,
SERVER_TIME,
SQLITE,
HTTP_CONNECTION,
)

Expand All @@ -32,10 +31,6 @@ def test_page_loads_with_title_and_has_success_ticks(page: Page):
page.get_by_test_id(slugify(ALL_CHECKS[GIT_INFORMATION]))
).to_have_text(re.compile(STATUS_SUCCESS))

expect(
page.get_by_test_id(slugify(ALL_CHECKS[SQLITE]))
).to_have_text(re.compile(STATUS_SUCCESS))

expect(
page.get_by_test_id(slugify(ALL_CHECKS[POSTGRES_RDS]))
).to_have_text(re.compile(STATUS_SUCCESS))
Expand Down