Commit Graph

21 Commits (c636826ecf75c83f50d49b8eeb0540184d411618)

Author SHA1 Message Date
Aravinth Manivannan c636826ecf
fix: cargo fmt 2022-02-14 22:42:02 +05:30
Aravinth Manivannan 79704087f6
fix: change function parameters into references 2022-02-14 22:41:07 +05:30
Aravinth Manivannan 303a430113
fix: rename GistPrivacy to GistVisibility and *privacy to *visibility 2022-02-14 20:38:19 +05:30
Aravinth Manivannan 6b60e2a064
feat: add gists_gists, gists_comments and gists_comments & related methods
The following changes are implemented for both db-sqlx-postgres and
db-sqlx-sqlite:

TABLE gists_gists
    Stores gist metadata with unique index on gists_gists.public_id for fast
    lookups

TABLE gists_comments
    Stores comment metadata

TABLE gists_privacy
    Stores gist privacy: sqlx currently doesn't have support Postgres
    enums(ref: https://github.com/launchbadge/sqlx/issues/1171), so storing
    possible privacy values as references from this table.

    This table shouldn't be mutated during runtime. Possible values are
    already recorded in database during migrations. All runtime operations
    on this table must only take references.

    Each implementation of GistDatabase also includes a method called
    privacy_exists, which is called during tests to ensure that
    migrations are successful.

VIEW gists_gists_view
    Gist lookups combines data from gists_users, gists_gists and
    gists_privacy. This SQL view boots performance(I think?). At any rate,
    it is much nicer to work with.

QUIRKS
    Database indexes are i64 in SQLite while i32 in Postgres
2022-02-14 20:11:26 +05:30
Aravinth Manivannan e96550b6c0
feat: db-sqlx-postgres: reaname admin_users -> gists_users 2022-02-13 16:50:51 +05:30
Aravinth Manivannan 9bf3dad060
feat: db-sqlx-sqlite: reaname admin_users -> gists_users 2022-02-13 16:49:38 +05:30
Aravinth Manivannan 9c35c6f99b
feat: add tests for health meta route 2022-02-13 16:27:42 +05:30
Aravinth Manivannan 6fc667ffc9 feat: run migrations on start up 2022-02-13 00:18:49 +05:30
Aravinth Manivannan 915fb46445 fix: lints and run migrations before generating coverage in CI 2022-02-13 00:07:28 +05:30
Aravinth Manivannan 34a67a5535 feat: bootstarp gists
AUTHENTICATION

- Sign Up
- Sign IN

ACCOUNT
- Username Exists
- Email Exists
- Account delete
- Password update
- Email update
- Username update
- Get account secret
- Update secret

All routes are implemented with proper error handling and testing

CONFIGURATION
See ./config/default.toml for full list
2022-02-12 23:48:35 +05:30
Aravinth Manivannan 3447a3a45c feat: add git SSH and HTTP clone feature target in README 2022-02-12 23:48:21 +05:30
Aravinth Manivannan f67a0038cf feat : GistDatabase is Clone and add ping to GistDatabase 2022-02-12 23:47:08 +05:30
Aravinth Manivannan 28bbdaebad feat: setup tests 2022-02-12 18:25:45 +05:30
Aravinth Manivannan aa4d205742 fix: apply lints suggested by clippy 2022-02-12 18:25:03 +05:30
Aravinth Manivannan b28a7d0cfb feat: bootstrap database ops
- db-core: defines base database traits that are required for gists
- db-sqlx-postgres: implements db-core for postgres flavor of the sqlx
  library
- db-sqlx-sqlite: implements db-core for sqlite flavor of the sqlx
  library
2022-02-12 16:35:55 +05:30
Aravinth Manivannan 4858f050e7 feat: CI: run tests against DB 2022-02-12 16:31:55 +05:30
Aravinth Manivannan e10451f01f feat: ecosystem overview 2022-02-12 16:31:00 +05:30
Aravinth Manivannan a3c82bf282 setup CI 2022-02-11 17:42:44 +05:30
Aravinth Manivannan 85ab813816 init 2022-02-11 17:42:35 +05:30
Aravinth Manivannan 5d451ec375 add license 2022-02-11 17:42:13 +05:30
Aravinth Manivannan d7fbc2f1d8 add readme 2022-02-11 17:41:54 +05:30