Did you try opening the library as though it was a new one, i.e. through the Library dropdown ==> Switch/create library?
If it cannot find a metadata.db file there, then creating a blank file called metadata.db should allow calibre to open the folder... and then demand to rebuild the database when it cannot read it as a valid database.