How Smalltalk deals with DataBases?
I'm using Squeak4.1. How does it handle Database connections? Does it provides something similar to ODBC/ADO in .NET or the J2EE stuff?
Which packages deal with database operations?
Can an开发者_JAVA百科ybody give me some hints?
Few links that might be of use to you:
- Squeak Smalltalk and Databases
- SqueakDBX
- Persistence in Seaside (Also see Chapter 8 in the Seaside tutorial)
- Magma
- Databases and Persistence
- Squeak PostreSQL
If you want something that's truly an analog to ODBC/JDBC or ADO.NET, then the closest analog would be SqueakDBX, a generic, FFI-based connector to a wide variety of databases. While it uses FFI, the developers have gone to great lengths to ensure that long operations do not block the VM. While I can't honestly say I've used it in production, reviews have been positive, it supports a very wide variety of databases (MySQL, Microsoft SQL Server, PostgreSQL, SQLite3, and more), and it's being actively developed, so it's probably a good bet.
Historically, the downside of SqueakDBX is that you didn't get GLORP, the major ORM used in the Smalltalk world these days. The good news is that's no longer true: SqueakDBX now has GlorpDBX, which brings GLORP to SqueakDBX. Drivers are currently available for PostgreSQL, MS SQL, and MySQL, among others. If you need to connect to a traditional database, this is probably your best bet.
Benjamin: We have already started to modify Glorp, we call it GlorpDBX and now Glorp works with a generic database driver, included a GlorpSqueakDBX driver. Right now we have GlorpDBX working with SqueakDBX for Postgres, MSSQL and Oracle.
Cheers
You might not need to. If your smalltalk code runs in Gemstone, there is no need to worry about database connections and queries before you have a lot of data/a lot of transactions. And if the number of objects is very small, SandstoneDB is much easier to use. On the Persistence in Seaside page you can find the links.
精彩评论