开发者

Converting constantly updated SQLite3 db into Drupal site

开发者 https://www.devze.com 2023-02-02 04:38 出处:网络
I have a 开发者_如何转开发constantly updated SQLite3 db that records game data. One table for game information, another for events in a game, and the

I have a 开发者_如何转开发constantly updated SQLite3 db that records game data. One table for game information, another for events in a game, and the third for player information, including who won/lost:

http://schema.ccgames.db.94y.info/ (schema)

http://ccgames.db.94y.info/ (arbitrary readonly queries)

I want to create a Drupal site with three content-types (one for each table) and a node for each record in each table.

I know about "Import Node", but that's a one-time thing. How can I keep my Drupal nodes constantly in sync w/ my SQLite3 db?

Some of the functionality I'm trying to import to Drupal:

Games I've played: http://798d4dab518a91787e0e0be5c94f8bb1.ccgames.db.94y.info/

Wins/losses: http://57442d9ce4c5063869883519f2a9cd0f.ccgames.db.94y.info/

Point history: http://9160fe29e3da336652ec98fbf7f2aeef.ccgames.db.94y.info/

Team games: http://a782c6b9be09f375e5f1b1d69f1e7c62.ccgames.db.94y.info/

I have a lot of this working on ccgames.db.94y.info, but it's ugly and doesn't allow wildcarding.


The database API of Drupal 6 can access different databases. However, they must all use the same DBMS type (i.e. you cannot mix MySQL and SQLite). This means you will have to roll your own solution, because modules use Drupal's database API.

I do not know whether this restriction still exists in the upcoming Drupal 7. But in Drupal 7 you will probably have to roll your own solution because contributed modules are not yet ported.

If you know PHP, developing a suitable module is not hard, though.


If I remember correctly you can use The Migrate module to contiously import data into Drupal. Just set it up and it will import on cron.

Other possible alternatives for import might be the Feeds module - you can create custom data sources for it and thus can create something that connects to a SQLite database.

Lastly - you don't always need to import stuff into Drupal to use it. Views 3 supports pluggable query handlers - so it would be possible to create a query handler for your SQLite database and create Views using that. Doing that would require the most coding though so I would try Migrate first.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号