support cross-database references

Automatically generated aliases would include illegal "."

Change-Id: Ie7479b2fc888c12f7089955457bc83ba7fac5c38