-
- 12 Posts
I was wondering about the lack of a "replace" function in the DBAPI.
is it intentional ?
Do u think we should add it ?
-
- 1,732 Posts
Quote from: BenO at Jan 06, 2006, 05:22 PM
I was wondering about the lack of a "replace" function in the DBAPI.
is it intentional ?
Do u think we should add it ?
You sure can
-
- 1,495 Posts
Will you add it to the feature section, so that it will be added for future release? Sorry core programmer, hope I’m not giving too much trouble to you all.
My only concern with this wendy is, that the DBAPI’s purpose is to help abstract the DB layer, and REPLACE statements are extensions to the SQL standard and not always supported. And the goal of abstraction is to hide the discrepencies between different target DB platforms.
Now, using these REPLACE statements is fine if you are married to a particular platform and are designing a system for pure optimized speed, though that can easily be done by authoring the REPLACE SQL and using the existing query() function to execute it. But adding this does not provide any real benefit for future portability or features IMO, as I would expect to see less and less contact with SQL at all in the system moving forward.
However, if others feel strongly about having this function, I certainly won’t oppose the addition for now.
-
- 1,495 Posts
Ehmm...
Not in my case though. I second your opinion about the DB abstraction.
I try to look into the DB API, and they have no INSERT function. Do you think it’s important to be added?
* Escape
* Query
* Select
* Delete
* Update
We need select, delete, update, and insert for database processing. I do believe insert is being supported on major sql syntax, even though I’m not to for sure the standard sql formating for insert. It’s not something necessary, because we can achieve that using query function, but it would be nice to be added later.
I believe, when we come to upgrading MODx to support DB abstraction, this API will be improved.
Another thing though, what do guys think about DB abstraction? Sometimes it makes thing a lot slower, because it’s adding another layer into the system? There has been a lot of debate about this, and I’m kind of confuse on which side should I be on. Any suggestion to my question will be great.
-
- 1,495 Posts
Thanks for the reply Jason.
I didn’t look into the code, and the documentation stated only this API
* Escape
* Query
* Select
* Delete
* Update
Next time I will double check everything, before posting.
As for the advice, it’s really a great deal of information to me. As I understand, MODx will move to DB Abastraction phase, right, instead of isolating SQL for each db platform? I;m just thinking of a performance wise while using db abstraction. Right now MODx depends widely on querying database back and forth, even though there has been an implementation of db caching mechanism, but it’s still depend widely on database.
So do you think running a stress test to MODx core code will be a better idea for the future milestone? Right now I can see the growth of MODx to be extended into a specific website application that are running not only as CMS system, but it’s more into a simple web application framework. So with that regards, having a stress test to test the core code will be awesome. I never try this, but I will try to do more research on this, and hopefully I can get this done soon.
Thanks