mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-11-04 01:37:31 +03:00 
			
		
		
		
	Remove duplicated doc for make_dsn()
This commit is contained in:
		
							parent
							
								
									b21c8f7a4e
								
							
						
					
					
						commit
						3f10b4dd31
					
				| 
						 | 
					@ -19,28 +19,6 @@ Instances of these classes are usually returned by factory functions or
 | 
				
			||||||
attributes. Their definitions are exposed here to allow subclassing,
 | 
					attributes. Their definitions are exposed here to allow subclassing,
 | 
				
			||||||
introspection etc.
 | 
					introspection etc.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. function:: make_dsn(**kwargs)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Wrap keyword parameters into a connection string, applying necessary
 | 
					 | 
				
			||||||
    quoting and escaping any special characters (namely, single quote and
 | 
					 | 
				
			||||||
    backslash).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Example (note the order of parameters in the resulting string is
 | 
					 | 
				
			||||||
    arbitrary)::
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        >>> psycopg2.extensions.make_dsn(dbname='test', user='postgres', password='secret')
 | 
					 | 
				
			||||||
        'user=postgres dbname=test password=secret'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    As a special case, the *database* keyword is translated to *dbname*::
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        >>> psycopg2.extensions.make_dsn(database='test')
 | 
					 | 
				
			||||||
        'dbname=test'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    An example of quoting (using `print()` for clarity)::
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        >>> print(psycopg2.extensions.make_dsn(database='test', password="some\\thing ''special"))
 | 
					 | 
				
			||||||
        password='some\\thing \'\'special' dbname=test
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
.. class:: connection(dsn, async=False)
 | 
					.. class:: connection(dsn, async=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Is the class usually returned by the `~psycopg2.connect()` function.
 | 
					    Is the class usually returned by the `~psycopg2.connect()` function.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user