+parse_get_psql (struct lexer *lexer, struct dataset *ds)
+{
+ struct psql_read_info psql;
+ psql.allow_clear = false;
+ psql.conninfo = NULL;
+ psql.str_width = -1;
+ psql.bsize = -1;
+ ds_init_empty (&psql.sql);
+
+ lex_force_match (lexer, T_SLASH);
+
+ if (!lex_force_match_id (lexer, "CONNECT"))
+ goto error;
+
+ lex_force_match (lexer, T_EQUALS);
+
+ if (!lex_force_string (lexer))
+ goto error;
+
+ psql.conninfo = ss_xstrdup (lex_tokss (lexer));
+
+ lex_get (lexer);
+
+ while (lex_match (lexer, T_SLASH) )
+ {
+ if ( lex_match_id (lexer, "ASSUMEDSTRWIDTH"))
+ {
+ lex_match (lexer, T_EQUALS);
+ psql.str_width = lex_integer (lexer);
+ lex_get (lexer);
+ }
+ else if ( lex_match_id (lexer, "BSIZE"))
+ {
+ lex_match (lexer, T_EQUALS);
+ psql.bsize = lex_integer (lexer);
+ lex_get (lexer);
+ }
+ else if ( lex_match_id (lexer, "UNENCRYPTED"))
+ {
+ psql.allow_clear = true;
+ }
+ else if (lex_match_id (lexer, "SQL"))
+ {
+ lex_match (lexer, T_EQUALS);
+ if ( ! lex_force_string (lexer) )
+ goto error;
+
+ ds_put_substring (&psql.sql, lex_tokss (lexer));
+ lex_get (lexer);
+ }
+ }
+ {
+ struct dictionary *dict = NULL;
+ struct casereader *reader = psql_open_reader (&psql, &dict);
+
+ if ( reader )
+ {
+ dataset_set_dict (ds, dict);
+ dataset_set_source (ds, reader);
+ }
+ }
+
+ ds_destroy (&psql.sql);
+ free (psql.conninfo);
+
+ return CMD_SUCCESS;
+
+ error:
+
+ ds_destroy (&psql.sql);
+ free (psql.conninfo);
+
+ return CMD_FAILURE;
+}
+
+static struct spreadsheet_read_info *
+parse_spreadsheet (struct lexer *lexer)