1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

Add the sqlite_open_aux_file() API. (CVS 646)

FossilOrigin-Name: 332164d6455658ca633a1dc49811d9fb0fd4b01c
This commit is contained in:
drh
2002-06-25 19:31:18 +00:00
parent e3c163e4e0
commit 411995dc0d
7 changed files with 116 additions and 26 deletions

View File

@@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
** $Id: shell.c,v 1.58 2002/06/25 01:09:12 drh Exp $
** $Id: shell.c,v 1.59 2002/06/25 19:31:18 drh Exp $
*/
#include <stdlib.h>
#include <string.h>
@@ -486,6 +486,7 @@ static char zHelp[] =
" \"insert\", \"list\", or \"html\"\n"
".mode insert TABLE Generate SQL insert statements for TABLE\n"
".nullvalue STRING Print STRING instead of nothing for NULL data\n"
".openaux FILENAME Use FILENAME to hold TEMP tables\n"
".output FILENAME Send output to FILENAME\n"
".output stdout Send output to the screen\n"
".prompt MAIN CONTINUE Replace the standard prompts\n"
@@ -702,6 +703,15 @@ static int do_meta_command(char *zLine, sqlite *db, struct callback_data *p){
sprintf(p->nullvalue, "%.*s", (int)ArraySize(p->nullvalue)-1, azArg[1]);
}else
if( c=='o' && strncmp(azArg[0], "openaux", n)==0 ){
char *zErrMsg = 0;
sqlite_open_aux_file(db, nArg>=2 ? azArg[1] : 0, &zErrMsg);
if( zErrMsg ){
fprintf(stderr,"Error: %s\n", zErrMsg);
free(zErrMsg);
}
}else
if( c=='o' && strncmp(azArg[0], "output", n)==0 && nArg==2 ){
if( p->out!=stdout ){
fclose(p->out);