elixir-sqlite / sqlite_ecto2

Sqlite3 adapter for Ecto 2.2.x
https://hex.pm/packages/sqlite_ecto2
MIT License
120 stars 33 forks source link

Instructions on how to contibute #238

Open rupurt opened 5 years ago

rupurt commented 5 years ago

Howdy 👋

I'm trying to contribute to the ecto 3 upgrade that @DiodonHystrix has started here. Are there any instructions on how to get the environment setup for development?

I've cloned the repo and when I run mix test it asks me to create the database. However there are no repositories defined in config/config.exs. Do I need to define one?

I also had a look at how the tests are running in CI and it looks like it uses mix coveralls.circle to run the tests, but again I don't see where the database is created?

Any help would be appreciated 🍻

adamzapasnik commented 5 years ago

Hey @rupurt Thanks for help 👍 I haven't had time to continue working on it :/ Unfortunately, I don't remember how I set it up and now I don't have an access to an environment I was working with. I will try to look into it if no one else answers.

adamzapasnik commented 5 years ago

OK, I had some time to look into it. Problem was related to missing sqlitex dependency. Long story short, I forgot to upload changes to github and switch path to git in mix.exs

I think I have fixed it, but you have to fetch a new changes from my repository. Then run mix test and experience a couple of tests failing 🎉

rupurt commented 5 years ago

Thanks @DiodonHystrix. I can confirm the tests are now running.

I don't know how the internals of Ecto work but I will try learn it and chip away at the upgrade. I have a need for Ecto 3 + SQLite in my app.

dimitarvp commented 5 years ago

@rupurt Me too, and I'd like to start an effort to make an Ecto 3.1.x Sqlite adapter. Where are you on that effort at the moment?

rupurt commented 5 years ago

@dimitarvp nowhere 😄

I've been moving house so won't be able to start investigating until at least next weekend. I'm assuming it's going to take months tbh.

dimitarvp commented 5 years ago

@rupurt Thanks for being honest! 👍

I started a library locally from scratch. I'll try gradually copy-pasting code from sqlite_ecto2 to it and see where it goes. Will announce on ElixirForum when something is ready.

As yourself, I have quite a lot of logistics to handle in my life so might be a while. But I've started.

rupurt commented 5 years ago

Thanks for the info. Starting is half the battle 😛 Good luck!

dimitarvp commented 5 years ago

After banging my head for several hours, I came to the conclusion that I am not just going to make an Ecto3 adapter for Sqlitex, no.

I think I am just going to roll my own Sqlitex (with another name of course) and build an adapter on top of that.

Lots of adventures and cursing ahead.

mfrasca commented 5 years ago

hi @dimitarvp , don't forget to commit early and often. you're working here, aren't you!

dimitarvp commented 5 years ago

@mfrasca Yeah I started a separate skeleton project which I'll maintain for a bit. I'd like to see if I can do better from scratch or I'll just start pouring PRs both to Sqlitex and Sqlite.Ecto2. That is yet to be determined -- and also depends on how responsive and receptive would their maintainers be.

Reasoning:

mfrasca commented 5 years ago

three points worth mentioning in the readme of your project, I suggest. but where's the current status of your code? with a nice whole bunch of failing tests? even though, well, maybe I'll open an issue there, that's the proper place to ask the question!

dimitarvp commented 5 years ago

Hey, I just started, and I have a lot of work and personal tasks to accomplish in the meantime, all the time. The project is online in GitHub only out of paranoia -- don't want to lose any coding progress if my laptop's SSD dies.

Don't expect anything workable for at least a month. Sadly, all of us who want to work on open-source software for real, have to juggle a lot of responsibilities.

mfrasca commented 5 years ago

yep, that's true. I'm pointing out because I see lots of loose threads on the same subject, and your boilerplate project is the only concrete published attempt I could see. I don't expect anything working any soon, I have hardly any experience with this environment, I come from two decades Python, several years with SQLAlchemy and some time with Django. I would be happy to see a shared attempt, that's all. where we publish early. very early.

dimitarvp commented 5 years ago

I am that kind of guy that can sacrifice some proper leisure time because he's sick of not having something he really wants to use. Hence I rolled my sleeves. For now the plan is for my project to be something like Sqlitex and Sqlite.Ecto2 together.

I am taking this pretty seriously and don't want to make many initial mistakes and do a lot of breaking changes after I start. I already drafted a very solid configuration module based on process dictionaries which I'll publish after I am satisfied with its quality.

I quite love Sqlite3 even though I strongly dislike its lack of strict typing, the fact that CHECK constraints are not being enforced retro-actively, the lack of proper boolean and date/time types, and a bunch of other idiosyncrasies. But it still remains the one and only truly free, mega-performant single-file database with a very stable file format.

I'll see the project done. I'll publish code regularly. But no promises on any deadlines.

mfrasca commented 5 years ago

I'll publish after I am satisfied with its quality

oeps. would you reconsider this? like pushing at every commit (provided you have a stable internet access --- not my case unfortunately), and using tags for defining the concept of "published"? this would enable others to provide feedback early. otherwise it's like all other attempts, which sound like "I'm working at it, and have limited time". we all have limited time, but combined it's a lot.

dimitarvp commented 5 years ago

I can immediately reconsider this, no problem at all. It's just that it assumes that people actually care and will contribute -- which is a very generous assumption. I'm thinking that people want a finished well-working library without being interested in the evolutionary process.

If you're telling me you'll give feedback and maybe PRs then sure, I'll be publishing more raw, from the kitchen so to speak, coding material.

mfrasca commented 5 years ago

yes, that's the idea, thank you! I'll be travelling for the next few days. I'll reappear after the 5th of July, maybe after next week Monday.