Converting constantly updated SQLite3 db into Drupal site

好久不见. 提交于 2019-12-25 04:44:08

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/4575440/converting-constantly-updated-sqlite3-db-into-drupal-site

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!