praeclarum / sqlite-net

Simple, powerful, cross-platform SQLite client and ORM for .NET
MIT License
4.08k stars 1.42k forks source link

Would sqlite-net be interested in a pull request which introduced interfaces and split the main code into 2 files? #135

Open slodge opened 11 years ago

slodge commented 11 years ago

Hi Frank

I <3 sqlite-net and I've been using it in PCL code using the plugin at https://github.com/slodge/MvvmCross/tree/vnext/Cirrious/Plugins/Sqlite

To do this I've had to introduce a few interfaces and I've had to split the sqlite-net code across 2 files:

I've also not yet done anything with the async code - I'm not really sure what I'm doing there yet (it depends on what MT and MD look like for asyncawait)

Obviously to get this working I've had to manually change sqlite-net. I would love to do this work again but to then push the changes back to you so that in future I can just take the latest files and use them.

However, I realise while this will be easier for me, it might not help other sqlite-net users at all... Is this of interest to 'core sqlite-net'? If it is, then I'm happy to do it. If not, then please just close this and I'll go away :)

Thanks

Stuart

fmarquezs commented 11 years ago

I would also love to see an adaptation of sqlite-net to integrate it easily wtth PCLs, so we can have a good foundation to make apps that target W8 and WP8 with SQLite

slodge commented 11 years ago

@fmarquezs feel free to use the two file split from the mvx tree - quite a few people seem to be using it and sending pulls against it now

fmarquezs commented 11 years ago

Good to know. A more simple and specific example to implement only this components would be great. Also, what about async? I don't see how only with this 2 files I can get my PCL to encapsulate the DB operations asynchronously in a straightforward way. I guess we need also to wrap SQLiteAsync, right?

praeclarum commented 11 years ago

Slodge,

I'm open to it only if it helps the PCL support and deals well with Async. I would also be happy if we had a build script that merges the two halves so were not bothering people who don't care about xplat.

So I guess I need to look at your code. Will let you know...

Thanks for all your hard work!

-Frank

slodge commented 11 years ago

Thanks Frank

If it helps:

If this does work out....

Stuart

dbeattie71 commented 11 years ago

I was able to get WP8 working by following: https://github.com/peterhuene/sqlite-net-wp8

It looks like the changes have been pulled in as well.

I also take the latest versions of sqliet-net and break them apart. The latest version I used was from the fork that supports wp8. I also abstract out the async portion.

zleao commented 11 years ago

@praeclarum, is there any advances in this issue. @slodge said that you posted something about having a PCL implementation using SQLITE.Net... I'm currently using MvvmCross and I would love to use the sqlite plugin (with SQLite.Async) across WP8, Droid and Touch platforms. Is there anything that I can help to make this work? Thanks

slodge commented 11 years ago

Hi @praeclarum

I know you said you wanted to do this in a single file way and that you had an idea to do this using preprocessor blocks.

Would you be open to someone doing this in a pull request?

I'm getting some really good PRs on the Mvx fork for SQLite and I'd ideally like to try to get them integrated back here rather than branching this core code....

What do you think? I'm happy to try to organise this so that someone else (not you or me) tries to build this working from the tip - but want to try to make sure that the approach is one you are happy with

Hope you're having fun out there :)

Stuart

dtodaro-ascendle commented 11 years ago

I'm also interested in this, to support https://github.com/slodge/MvvmCross/issues/213.

intralexus commented 9 years ago

good evening, trying samles n12 by Stuart Lodge https://www.youtube.com/watch?v=6QCIoIw_O4I and somehow wondering how can i use updated community sqllite net plugin, at the moment just getting Warning 1 The 'packages' element is not declared. Error 2 The type or namespace name 'Community' does not exist in the namespace 'Cirrious.MvvmCross' (are you missing an assembly reference?) Error 2 The type or namespace name 'Community' does not exist in the namespace 'Cirrious.MvvmCross' (are you missing an assembly reference?) ..\CollectABull.Core\swp8\Bootstrap\CommunitySqlitePluginBootstrap.cs 7 55 CollectABull.Core thank you for any suggestion or links with some samples, i'm green in programing so going to do my research all night again :))