Stay organized with collections
Save and categorize content based on your preferences.
Source code for google.appengine.api.rdbms
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""Relational database API for production.
Note that rdbms_mysqldb is the module used in dev_appserver.
"""
import logging
from google.storage.speckle.python.api import rdbms_apiproxy
from google.storage.speckle.python.api.rdbms_apiproxy import *
_instance = None
[docs]def set_instance(instance):
global _instance
_instance = instance
[docs]def connect(instance=None, database=None, **kwargs):
global _instance
if not instance and _instance:
instance = _instance
if 'db' in kwargs and not database:
database = kwargs.pop('db')
user = None
if 'user' in kwargs:
user = kwargs.pop('user')
password = None
if 'password' in kwargs:
password = kwargs.pop('password')
if kwargs:
logging.info('Ignoring extra kwargs to connect(): %r', kwargs)
return rdbms_apiproxy.connect('unused_address',
instance,
database=database,
user=user,
password=password)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["This document presents the source code for the relational database (RDBMS) API within Google App Engine, focusing on its production environment usage."],["The `rdbms_apiproxy` module, a component of `google.storage.speckle.python.api`, is integral to the functionality of this API and used to access the relational database."],["The code provides `set_instance` and `connect` functions for configuration and connection establishment to a database instance, respectively."],["The `connect` function in this module accepts various arguments such as `instance`, `database`, `user`, and `password` to establish database connections, while logging any extraneous keyword arguments that are not directly handled by the function."],["The file is released under the Apache License, Version 2.0, with specific terms and conditions for use and distribution."]]],[]]