Skip to content

Conversation

@stephencelis
Copy link
Owner

This is a work in progress with much to do. It's an ambitious update that adds support for Swift 2 features along with some project file restructuring needed to support Carthage, and API restructuring needed to decouple database connections from the query builder and support database names.

It will address #133, #30, #77.

Old code has momentarily been deleted and functionality with it. This PR will not work with your existing code at the moment. See Tests and read the Source for new behavior.

Must-haves:

  • Use Swift 2 error model
  • Use protocol extensions
  • Feature parity
    • Re-hook up asc, desc, alias
  • Re-hook up SQLCipher
  • Re-hook up CocoaPods
  • Finish tests (and provide as complete coverage as possible)
  • Update documentation
    • Update general text and example code
    • Address FIXMEs
    • Update installation instructions and image
    • Add more specific examples around expression protocol extensions
  • Update playground
  • Update README (partially done)
    • Update general text and example code
    • Update installation instructions and image

Nice-to-haves:

  • Decouple database connections from query builder
  • Hook up Carthage
  • Database name support
  • Attach/detach helpers
  • Pragma helpers
  • Extract SQLCipher into its own SQLiteCipher.swift repository
  • Section playground into chapters with more examples
  • Clean up raw interface
    • Consider less subscripting and more flexibility for retrieving values
    • Use func forEach(Element -> Void) throws for lazy iteration
  • Split into sub-frameworks (don't require typed builder use)
  • Multi-reader/single-writer locking

@schickling
Copy link

Good job! 👍

@schickling
Copy link

Any news about when .order by .asc/.desc can be expected?

@Silve2611
Copy link

I have tried to include this WIP into a simple Project that onle wirtes a console line on a click. I cannot compile the project as it shows errors imidiately.

Should this work be know or should I keep my hands of the WIP and wait for a master version. I wanted to prepare myself for swift 2.0

@stephencelis
Copy link
Owner Author

@Silve2611 It should work, for the most part, but errors aren't surfaced in the most helpful way yet. Can you paste the code/errors failing in question?

@Silve2611
Copy link

bildschirmfoto 2015-08-22 um 22 52 04

I added a screenshot. But I have to admit the behaviour is Strange. Now when I build it. It fails but shows no errors. Removen SQLite from the project solves this... I have the XCode 7 Beta 3 version. I am now updating to Beta 5 and retesting it.

@Silve2611
Copy link

Since i have made the update everything is working fine. Thank you for the great work!

@lukescott
Copy link
Contributor

May be a good idea to tag a release for the current Swift 1.2 version. That way when the Swift 2.0 version comes out you can do a major version bump and those who haven't made the transition can select the Swift 1.2 version until they've updated their code.

@stephencelis stephencelis force-pushed the swift-2 branch 2 times, most recently from b311414 to 9868767 Compare August 29, 2015 17:56
@stephencelis stephencelis force-pushed the swift-2 branch 5 times, most recently from 2a8c985 to fb7128e Compare September 14, 2015 12:59
stephencelis and others added 6 commits September 18, 2015 18:07
Swift 2 is an opportunity to revamp the SQLite.swift API alongside the
changes the latest version brings to the table. This mostly includes
error handling and protocol extensions (most helpful for the expression
layer), but also lets us rethink the general project structure.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
…6 language changes

Converted to Swift 2.0 for XCode 7.0 Beta 6. Compiles but does not pass tests.
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
We should use guard-let wherever we have an early exit and can manage.
Let the compiler enforce our requirements.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Let's update the deploy targets and ensure that newer symbols aren't
referenced.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
@cwack-letsdev
Copy link

Hi I migrated to your swift 2.0 branch. How I have to migrate following coe to your optimised API?

magazines.filter(contains(favoritMagazines, DbMagazine.COLUMN_ID)) ?

thx

@stephencelis
Copy link
Owner Author

@cwack-letsdev Protocol extensions have made the following possible (and preferable):

magazines.filter(favoriteMagazines.contains(DbMagazine.COLUMN_ID))

@stephencelis stephencelis changed the title WIP: Swift 2 Swift 2 Oct 12, 2015
We need a new screen shot, and with it we can bring a simpler set of
instructions to the table.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
stephencelis added a commit that referenced this pull request Oct 13, 2015
@stephencelis stephencelis merged commit e240552 into master Oct 13, 2015
@stephencelis
Copy link
Owner Author

Merging! A few things to do but things should be relatively stable.

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.

7 participants