"insert into" query to create albums. Can it be done?

andreste

Joined: 2006-06-02
Posts: 123
Posted: Fri, 2006-10-20 13:18

hello,
I have to create about 300 albums so I'm wondering if using an "insert into '....'" query directly to the database could work.
I don't want to screw up things, so I'm asking first.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2006-10-20 19:58

you should use the Gallery API, not SQL statements. the G2 sql schema and the dependencies are not obvious. only by using the API you ensure that you don't corrupt the data integrity of your database.

you can build a script with GalleryEmbed::init, GalleryCoreApi::createAlbum, GalleryEmbed::done.
see documentation -> API -> GalleryCore -> GalleryEmbed, GalleryCoreApi.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2006-10-20 19:59
 
andreste

Joined: 2006-06-02
Posts: 123
Posted: Fri, 2006-10-20 21:36

Thanks Valiant, I'll use the Add from server function. I thought it could be used for photos only, not whole directories, so I actually forgot about it altogether; until now!
thanks again!