D
D
Daniel Newman2012-09-21 02:13:02
PHP
Daniel Newman, 2012-09-21 02:13:02

What are the MySQL adapters for the database called?

There is a certain database with its columns and data, there is a canonical table schema of a certain CMS. I thought of something: without changing either the CMS or the database, get access to read-only mode through some intermediate adapter layer, which sets the correspondence to the tables and columns of this very database. A certain set of prescribed aliases. Additional level of abstraction.

for example

wp_posts = PostTable
wp_posts.post = PostTable.DataSample

Naturally, this is not what Google gives for a MySQL adapter request.
Something probably exists, but what is it called or an example of such a solution - I will be very grateful for a hint.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sergey Beresnev, 2012-09-21
@danielnewman

You can make a mysql view and thus make views that will repeat the structure of the CMS database.

D
DWSVad, 2012-09-21
@DWSVad

I’m not sure that I understood you correctly, but if it’s still correct, then probably we are talking about Scaffolding ?

S
strib, 2012-09-21
@strib

Why an adapter?
Normal rights management will not help?
CREATE USER 'readonly'@'localhost' IDENTIFIED BY 'superpass';
GRANT SELECT ON db.* TO 'readonly'@'localhost';

G
gleb_kudr, 2012-09-21
@gleb_kudr

This class of solutions is called ORM en.wikipedia.org/wiki/ORM

L
lemon_spb, 2012-09-21
@limon_spb

As far as I understood you, such “adapters” are built always and everywhere when using the database:
There is the database itself, there is a server part of working with the database, which is the only one that has direct access to the database, and just implements some level of abstraction over the database. Well, all other parts, whether on the client, on the server, etc., all communicate with the database only through this very server part of working with the database. But who knows in advance what kind of database you have and what abstraction is needed. I could be wrong, but here you just have to write yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question