Is there an analog of the Levi–Civita connection for schemes?

There exists algebraic de Rham theory, $n$-forms on vector bundles (algebraically), and familiar constructions from differential geometry. This made me question whether or not there is an analog of the Levi–Civita connection for schemes.

A motivating example would be the following. Let $S$ be a Noetherian $R$-algebra of finite type over a commutative ring $R$. The $S$-module $\textbf{Der}_R (S)$ should be finitely generated from the hypothesis. From here, if we fix a set of generators for this $S$-module, then we can define a symmetric bilinear $2$-form $\textbf{Der}_R (S) \times \textbf{Der}_R (S) \to S$ that becomes the analog of a semi-Riemannian metric. Letting $R$ be a field $k$ of characteristic zero (so that there exists the monomorphism $\mathbb{Q} \to k$), then one should be able to concoct similar definitions for an (algebraic) connection and compatibility so that one has an 'algebraic' analog of the Levi–Civita theorem! Please do correct me if I am wrong, but this is just a motivating case for the question!

flatconnections. Levi-Civita connections are usually not flat. $\endgroup$1more comment