Skip to content

Conversation

@arnaud-lacurie
Copy link
Collaborator

@arnaud-lacurie arnaud-lacurie commented Nov 28, 2025

This introduces three sections for the JDBC documentation:

  1. Basic doc (standard JDBC)
  2. Advanced doc (STRUCT / ARRAY extensions)
  3. Direct Access API doc (execute{Get,Scan,Delete,Insert})

@arnaud-lacurie arnaud-lacurie added the documentation Documentation change label Nov 28, 2025
Copy link
Collaborator

@alecgrieser alecgrieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good start! Just a few minor things, and there's a PRB failure from some indentation issues

Comment on lines +11 to +14
**Driver-Specific Classes**: When creating STRUCT and ARRAY values, use the appropriate builder for your JDBC driver:

- **Embedded Driver**: ``EmbeddedRelationalStruct`` and ``EmbeddedRelationalArray`` (from ``com.apple.foundationdb.relational.api``)
- **Server Driver**: ``JDBCRelationalStruct`` and ``JDBCRelationalArray`` (from ``com.apple.foundationdb.relational.jdbc``)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true? Do we not have an API that works for both the embedded and server use cases? I would have expected that there'd be something like a RelationalStruct object that the user could create (in the API package) and then something could translate that to the appropriate one.

It almost seems like this is a deficiency in our API that is worth addressing before we try and document it too much, including the infrastructure to have parallel documentation for the different paths, but maybe that ship has sailed

======================

.. important::
**Transition API**: The Key-Based Data Access API is provided primarily to ease migration from key-value based operations to SQL-based queries. While it remains supported, it is **not the recommended approach for new applications**. For most use cases, SQL queries provide better flexibility, optimization, and maintainability. This API may evolve or be deprecated in future versions as the SQL interface matures.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure "key-value" is quite right here. Potentially, it would be fairer to say that this is made to ease the transition for users of the FDBRecordStore API

// end::unwrap-statement[]
}

public static void scanBasic() throws SQLException {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm missing it, but I don't know if I see what's different between this and DirectAccessSnippets::scanBasic. I believe the only operations that are actually different are the ones that do inserts, so it may be nice to remove all of the ones that are the same


/**
* Code snippets for JDBC Guide basic documentation.
* This class is not meant to be run, but contains tagged sections referenced by the documentation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would kind of be nice if these could be run, and then we could assert they did what we thought they should, instead of just compiling, but having them compile is probably a good enough start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants