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

Fix/independent decoding #149

Merged
merged 6 commits into from
Apr 15, 2024
Merged

Conversation

pxp9
Copy link
Collaborator

@pxp9 pxp9 commented Apr 14, 2024

this will try to fix different decodings for different backends

@pxp9
Copy link
Collaborator Author

pxp9 commented Apr 14, 2024

@pxp9
Copy link
Collaborator Author

pxp9 commented Apr 14, 2024

It is funny because if you delete MySQL trait override functions it compiles but does not pass the tests because is not doing what it is supposed to do.

Maybe i will try to delete trait and see what happens.

@pxp9 pxp9 requested a review from ayrat555 April 15, 2024 07:15
@pxp9
Copy link
Collaborator Author

pxp9 commented Apr 15, 2024

We should put an issue to the rust compiler or see wtf is happening with that.

if you write it as

Self::find_task_by_id(...)

This fails because it says the trait bounds are not satisfied which is not true as commented here

Got this error

image

but the trait bound is indeed satisfied.

https://docs.rs/sqlx/0.6.3/sqlx/prelude/trait.IntoArguments.html#impl-IntoArguments%3C'q,+%3CMySqlArguments+as+Arguments%3C'q%3E%3E::Database%3E-for-MySqlArguments

Any ideas ?

A workaround is using the trait syntax.

<BackendSqlXMySQL as FangQueryable<MySql>>::find_task_by_id(...)

@pxp9 pxp9 merged commit 7ec0e79 into support-sqlite-mysql-asynk Apr 15, 2024
8 checks passed
@pxp9 pxp9 deleted the fix/independent_decoding branch April 15, 2024 07:34
pxp9 added a commit that referenced this pull request Apr 19, 2024
* possible impl with sqlx, we need to refactor dependencies and features and also probably need to make queries folder for `sqlite` and `mysql`

* fix clippy xd

* finally sqlite almost work, need help to debug something

* deleting some expects

* sqlite may work in workflow

* stupid workflow work

* plz work

* plz work , think i have fixed

* fix workflow , now will work :D

* this should work

* this will definitely work

* clean up so it works incorrectly faster

* okay that didn't work so idk what i'm doing here

* if this works i'm dropping out of university

* store uuid as text , so this way `PostgreSQL` schema will not change

* fix comment

* fix clippy

* implement backend sqlx trait that allows better code

* better implementation with enum variants

* `Makefile` now creates `tests_sqlite` directory

* make `asynk` tests use `.env` variables

* drop unnecessary `drop`

* query types as enum

* fix clippy

* fix fmt, my bad i had a  missconf in my home computer xd

* stupid mysql does not work anything , i hate it so much :/

* rework to make it work with MySQL

* debugging issue : the issue is related to how a uniq task is inserted in MySQL backend

* MySQL own mutex , why Mysql is so gae ?

* fix clippy

* split test jobs

* fix build

* fix github actions

* do not run github actions twice

* fix formatting build

* another approach

* tokio console debug

* fixing workflow

* fixing workflow again

* i think i finally fixed

* fixed \!

* fixed \?

* i am stupid now should be fixed :)

* test blocking and fang derive error

* add postgres service to blocking workflow

* running async worker tests and blocking worker tests

* cargo term color sqlite

* change sqlx version to 0.6.3 and using Pool instead of Transactions

* fix workflow for mysql

* fix workflow

* fix clippy, warns and mysql workflow

* adress comments and fix workflow

* fix mysql healthcheck

* fix mysql healthcheck, yeap again

* remove healthcheck

* healthcheck is needed , plz work

* plz just work :(

* try to fix workflow

* update workflow to use a non deprecated version

* return an error instead of panicking with fock

* deleting prints and updating comments

* deleting unwraps or justifying them

* README and moving each backend to separate files

* final README

* bump fang version and bump rust version

* nit: added missing newline for consistency

* update readme

* bump fang version following semver

* address ayrat issues

* Fix/independent decoding (#149)

* independent decoding

* Postgres and Sqlite passing

* fix unreachable pattern warn

* delete vscode stuff

* I think this may be a Rust compiler issue, but I fixed it so I will take it

* fix clippy

* relocate comment

* remove `backend` field from `AsyncQueue`

* fix clippy

* worst clippy fix of all time

* fmt fix

* use variant NoBackend instead Option

* fix clippy

* delete dummy variant

* changing sqlite and mysql migrations

* sqlx uuid encoding and decoding for sqlite and postgres

* delete uuid previous impl comment

* fix retry_task impl

* fix mysql timestamp precision

* rework encoding Datime<Utc> for postgresql and sqlite

* rework encoding Uuid for mysql

* fix clippy

* fix serde_json::Value decoding and encoding

* README stuff

* improving API

* improving worker API

---------

Co-authored-by: Dopplerian <dopplerian+git@proton.me>
Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants