Recent Posts by Tuukka Norri

Subscribe to Recent Posts by Tuukka Norri 23 post(s) found

Oct 24, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / One-To-Many Relationships

Does the relationship appear, if you call BXEntityDescription’s method -relationshipsByName? If not, try these queries in psql:

SELECT * FROM baseten.nameconflict;
SELECT * FROM baseten.manytomany;

The first one lists conflicting relationship names on rows that have value of true in column “conflicts.” The second lists all many-to-many relationships by entity and name.

 
Oct 24, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / One-To-Many Relationships

No problem, nice to hear that it works. Were there any other problems than the one with BaseTen Assistant?

 
Oct 24, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / One-To-Many Relationships

Strange, it looks like the entity changes from “kasse” to “karten” at some point between receiving it from the context and calling -valueForKey:. I have no idea why this would happen but I’ll skim through our code.

 
Oct 24, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / One-To-Many Relationships

Could you post the errors you’re getting? Yesterday I copied a development branch to trunk, which might explain the problems appearing suddenly.

 
Oct 24, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / One-To-Many Relationships

This should work by
  • Having two BXSynchronizedArrayControllers, one for the master view and one for the detail view (since it is a to-many relationship)
  • Binding the detail array controller’s contentSet to a master array controller’s key path like selection.relationshipName (not the field that contains the referenced value)

Modifying the relationship should work by getting the set of related objects from the master object and modifying it. The detail array controller should notice changes in the master’s relationship.

Currently inserting objects using the detail array controller’s -add: method doesn’t add created object to the relationship. This will probably be fixed in a future release.

 
Oct 20, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / NSTreeController equivalent

Hi and sorry again for the delay.
This could be very useful. Also it’s more likely to be possible now that we handle NSPredicates more accurately.

 
Oct 7, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Adding related record with the Add: method

Sorry about taking time with this. You’re correct, the array controller could check if its key path is for a relationship and add the object to the set. I can’t say for certain, how soon we’ll address this issue, but I’ll open a case for it anyway.

 
Oct 7, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Importing data core data model problem

Hi!
Unfortunately momc’s location has changed between developer tools releases. This has been fixed in SVN trunk, though. We do plan to make a new release as soon as possible, but here are some instructions for building the development version, in case you’re interested: http://basetenframework.org/wiki/BuildingFromRepository
If you’d like, I can also send you a built copy. In that case, send e-mail to tuukka.norri@karppinen.fi.

 
Oct 7, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / NSPersistentDocument integration?

Hi and sorry about not replying earlier.

We haven’t designed BXDatabaseContext to be a drop-in replacement for NSManagedObjectContext. As a result, NSPersistentDocument most likely won’t work with BXDatabaseContext as it would with NSManagedObjectContext.

It seems that there is also some conceptual mismatch between a PostgreSQL-based client/server application and a Core Data document based application. In the latter, the document incorporates a whole database instance, stored in a file specified by the user, whereas with PostgreSQL you are likely to talk to the same (often remote) PostgreSQL server without control over where the data is physically stored. This difference makes most of the NSDocument architecture much less useful on a BaseTen project. One alternative is to make use of customized NSWindowController subclasses that would present some part of the database contents. The user could then open such windows the same way Finder allows the user to have many browser-style windows.

We are planning a new release as soon as possible. If you’d like, you can follow our progress here: http://basetenframework.org/timeline

 
Sep 17, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Database credentials

Hi again,
The connection panels should now work as you’d like, at least if you call –[BXDatabaseContext setUsesKeychain:] with value NO before connecting. There’s also the possibility to make the connection with -connectAsync instead of -connect:.

If you have a translation, that’s great! Please send it to tuukka.norri@karppinen.fi.

Best regards

 
Sep 10, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Database credentials

Right, I found a bug there. We’ve mostly been using the Keychain to store passwords, so this didn’t come up earlier. I’ll fix it as soon as I recover from cold.

Best regards

 
Sep 7, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Database credentials

Hi Michele,
Passing the components in the database URI should do what you want, e.g. pgsql://username:password@host/database

 
Apr 7, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Plans for locking and undo in autocommit mode

Hi!
Locking shouldn’t be a problem in autocommit mode, since rows may be locked only for the duration of a transaction. We could probably do something when editing starts and ends but we haven’t thought about that much yet. Do you have a specific case in mind?
Undo support is also somewhat difficult to work out with autocommit, because queries might have side effects that are difficult to predict on framework level. It would probably be possible to create transactions based on undo grouping also in autocommit mode but we haven’t thought of that much yet.

Regards,
Tuukka

 
Feb 26, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Other versions of PostgreSQL

Hi!
Unfortunately we rely on the RETURNING clause in INSERT, UPDATE and DELETE queries, which appeared in version 8.2. Adapting our code to work with 7.4 would probably require a copious amount of work.

The aforementioned queries are needed when updating fetched objects’ caches. If you just want to fetch rows from the database, you could use these BXDatabaseContext’s methods:
- (NSArray ) executeQuery: (NSString *) queryString error: (NSError *) error;
- (unsigned long long) executeCommand: (NSString ) commandString error: (NSError *) error;
However, they do sort of throw away most of BaseTen’s functionality (notifying other clients for changes in fetched objects etc.).

There are other means to fetch rows from the database, though. You could use PostgreSQL’s libpq, although it retrieves everything as a C-string. Libpqxx is also an option, but I haven’t used it. Finally, there are also other Objective-C frameworks for using PostgreSQL. I can’t remember any by name right now but I’d guess that it’s easy to find them.

 
Feb 23, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Modification Observing Not Working

I guess it depends on what one is used to :) I like Postgres better. MySQL is easier to upgrade, though, since they don’t change the database file format with every new version like some others do…

If the problem was indeed with the database, then I’d suppose that your tables would be in two different installations but would be BaseTen enabled in only one of them. This doesn’t make much sense but I guess there might be some other problem that I can’t come up with right now.

Anyway, I’d check that the table names match exactly – you can get the table list with the command \d in psql and of course with BaseTen Assistant.

 
Feb 21, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Modification Observing Not Working

Hi!
I can’t say for certain what could have caused this. My first thought was that the problem would be with BaseTen Assistant. We had already had thought about making its source part of the GPL’d distribution thus speeding up its bug resolution process.

Another cause could be that if you created the data model using Xcode, it prefers capitalized the entity names. Table names, on the other hand, are case-sensitive in Postgres. Try using the name Product for the entity in IB.

Having two Postgres installations could cause this but I doubt that it would be the case.

If you want, you could try creating the BaseTen tables without the assistant, if you are using BaseTen version from SVN trunk. First remove the BaseTen schema, in case the assistant has installed an out-of-date version, using this command in psql: DROP SCHEMA baseten CASCADE;. Then follow the instructions in http://www.karppinen.fi/baseten/wiki/PreparingDatabasesWithoutAssistant

If it doesn’t work out, I’ll come up with something else.

 
Feb 17, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Garbage Collection

Hi!
The Xcode project has a target called BaseTen Framework + GC, which builds a GC-enabled framework. The default aggregate target still creates non-GC frameworks, but we should probably change that. BaseTenAppKit project already has a similarly named target for building with GC. HTH.

 
Feb 12, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Exception running 'BaseTen-1.0RC2.dmg'

Hi and sorry about taking so long to answer.

It looks like you’ve linked an application to BaseTen and BaseTenAppKit frameworks but they haven’t been copied inside the application’s bundle. When built with the Release build style, BaseTen’s install name is set so that applications linked to it will look for it inside their bundles. This way, applications could be distributed as .app bundles without any additional files, such as frameworks, libraries etc., needed.

For testing purposes, another option is to build BaseTen with Debug style. This way the framework’s install name will be left empty and applications will have a reference to its location at build time.

 
Feb 12, 2008
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Tutorial suggestion

Hi!
We’ve been thinking of publishing some examples or tutorials, so getting started would be easier. There has just been quite a few things to do, so tutorials have had to wait.

 
Aug 2, 2007
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / New relationship classes

Things should be working much better by now. You just need to do a SELECT baseten.refreshcaches () after creating new foreign keys or views when using the schema in SVN trunk. We’ll have BaseTen Assistant do this automatically soon.

 
Jul 27, 2007
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Tell us about your project!

Creating and deleting rows should be undoable in manual commit mode. I don’t remember right now, if we have a test written for that, but it’s supposed to work. We’ll consider making at least creation undoable in the future. For deletion, it would probably be harder, if there are foreign keys or other things that have been created with ON DELETE CASCADE.

 
Jul 19, 2007
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / Tell us about your project!

Hi everyone,

I’d like to hear more about you and the projects you use BaseTen for. Please reply to this post and write a short description and whatnot. This way we can add functionality that might be needed in application development.

 
Jul 19, 2007
Avatar Tuukka Norri 23 post(s)

Topic: BaseTen / New relationship classes

Hi,

We are currently revising the relationship classes. They will have methods similar to their Core Data counterparts and the code will hopefully be cleaner as well. Please bear with us since it will probably take a couple of days before everything works again.