Hello, in django, there's `manage.py createsuperus...
# ktor
r
Hello, in django, there's
manage.py createsuperuser
for creating a user with elevated privileges. For ktor, I have resorted to creating a user programmatically when the app starts, (first checking if the user already exist) or going into the database and adding the user manually, but this doesn't scale when you constantly need to clear the db in development Is there a more elegant or standard way of doing this? I assume it would be a similar process in other frameworks, express, flask etc since they don't also have that
a
There are no users in Ktor by default - so not really. But why doesn’t your solution scale if you’re checking that the user already exists?
r
Doing it manually in the database is what doesn't scale when the db is cleared occasionally, ie in tests
i would like to know what methods are usually employed for this use case
a
There’s no such thing for Ktor specifically. I just reset and initialize the database between each test in a listener, works for me.
r
thanks a lot
👍 1