Fix a minor issue in the generated sql if no database connection is enabled