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

SQLite3 Support #7

Closed
GochoMugo opened this issue Dec 23, 2014 · 3 comments
Closed

SQLite3 Support #7

GochoMugo opened this issue Dec 23, 2014 · 3 comments

Comments

@GochoMugo
Copy link
Contributor

Is it possible to support SQLite3? I would propose to implement different wrappers for different SQL versions.

For example, have a connection object instantiated separately for either SQLite3 or MySQL. Then bind it to a more general wrapper for operations on the database and tables.

What do you think?

@WebCoursify
Copy link

Good question! I think that's absolutely possible. Actually if you've used Django, you'll see Django provides a uniform interface with different databases. That's also what I have in mind when I first start to implement this module, but at that time I figured it's probably better to make the module function properly on one database, then extend to some other databases.

If you're interested in implementing it, that would be great, since this module seems to work quite well in MySQL now and I'm been using it all the time. I would say extract the common part between different wrappers to form an abstract super class, then extend this super class to implement different sub-classes for different types of database. It would probably be more complicated than what I said, because the driver for MySQL and SQLite may not have the same interface, but I figure that would be one possible way to go.

Finally I do have some suggestions here if you're going to implement this part (you're probably a more experienced developer than I am and you're already well aware of them, but still I should say it)

  1. Keep the interface unchanged as much as possible
  2. Write unit tests

@firstprayer
Copy link
Owner

Sorry, that's me. I have different github accounts...

@GochoMugo
Copy link
Contributor Author

I agree. I was thinking of implementing an abstract class that the different SQL versions may then
subclass it... Just like you said. If a SQL database requires specific features then it remains its responsibility to ensure it works as expected.

The interface should remain the same thus no or minimal interface change. I will discuss with you on any interface change proposals.

I hope to get time to work on this feature.

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

No branches or pull requests

3 participants